Repository navigation
Expand file tree
/
Copy pathcodegen_rules.json
More file actions
1533 lines (1499 loc) · 87.1 KB
/
Copy pathcodegen_rules.json
File metadata and controls
1533 lines (1499 loc) · 87.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"_meta": {
"description": "Definitive rules for URLab Unreal codegen. Drives generate_ue_components.py: which schema attrs to emit, how to type-map them, which canonicalisations absorb multi-attr clusters, which categories use single-UCLASS or multi-UCLASS or no-subclass layouts, and which mjxmacro pointer fields belong on which view struct.",
"version": "5.0"
},
"_doc_transform_widget_policy": "Categories whose Pos/Quat are authored via the UE Transform widget (geom/site/camera/frame/inertial) hide the canon Pos/Quat UPROPERTYs from the Details panel. The UPROPERTYs still exist for the import seed + BP read access, but EditConditionHides keeps them out of the user-facing surface so authoring stays in one place. Per-element _note_hidden entries point at this policy instead of restating it.",
"global_exclusions": [
"user", "name", "class", "type", "objtype", "reftype"
],
"default_type": "float",
"_note_property_renames": "Schema attr -> UPROPERTY identifier. Used when the UE-side identifier must differ from the verbatim schema attr (typically to avoid C++ keyword collisions or to keep PascalCase for legacy consumers). qpos/qvel/etc are PascalCase on UMjKeyframe because BP graphs / runtime accessors reference them that way.",
"property_renames": {
"qpos": "Qpos",
"qvel": "Qvel",
"act": "Act",
"ctrl": "Ctrl",
"mpos": "Mpos",
"mquat": "Mquat",
"time": "Time",
"actuatorfrclimited": "ActFrcLimited",
"actuatorfrcrange": "ActFrcRange",
"axis": "Axis"
},
"_note_setto_param_defaults": "Per-(function,param) 'not overridden' values, used ONLY for params MuJoCo treats as genuinely optional — i.e. it guards them with `>= 0` (muscle) or a null pointer, so the sentinel means 'leave the default alone'. Params MuJoCo writes unconditionally by value must NOT appear here (a sentinel would clobber the inherited value); use `inherit_fields` in subtype_setto instead. Values are strings so the codegen drops them verbatim into the generated C++ call without forcing a 1 vs 1.0 vs 1.0f format choice.",
"setto_param_defaults": {
"mjs_setToPosition": {"inheritrange": "0.0"},
"mjs_setToIntVelocity": {"inheritrange": "0.0"},
"mjs_setToMuscle": {"tausmooth": "0.0"},
"mjs_setToDCMotor": {"resistance": "0.0", "input_mode": "0"}
},
"_note_unmodeled_elements": "Top-level MJCF elements that the codegen drift-diagnostic silences. Each entry is the reason it's skipped — change the value to '' to make the diagnostic fire again if you want to revisit.",
"intentionally_unmodeled_elements": {
"freejoint": "Handled as a joint subtype (UMjFreeJoint) — the freejoint XML tag maps to the joint category via the parser, not as a top-level category.",
"light": "URLab doesn't model MJCF <light> as a UE component — UE has its own light primitives that override MJCF light placement.",
"flex": "Children of <deformable>. URLab generates flexes via UMjFlexcomp (which expands to a flex at parse time); the direct <flex> element is not a UE component.",
"skin": "Children of <asset>. URLab handles skinning via UE skeletal meshes; <skin> in MJCF would need a dedicated asset pipeline."
},
"_note_hand_vs_generated_enums": "URLab keeps every EMj*Type enum hand-rolled. Subtype-driving enums (EMjJointType, EMjGeomType, etc.) must stay hand-rolled because each member drives a UClass subclass — adding one is a product decision, not mechanical. Pure-mapping enums (EMjGainType, EMjBiasType, ...) are mechanically codegenable but live next to their parent UClass; moving them to Generated/ would require include reordering for no functional gain. The hand_enum_drift phase in generate_ue_components.py provides the equivalent forward-maintainability guarantee: any new mjt* value upstream surfaces as a diagnostic instead of a silent runtime fallthrough.",
"_note_compiler_attr_field_map": "MJCF <compiler attr=...> XML attrs URLab honours, mapped to their FMjCompilerSettings field name. The field is hand-rolled in MuJoCo/Utils/MjOrientationUtils.h; the drift check uses this map purely as an allowlist. New MuJoCo compiler flags surface as a diagnostic until added here or to intentionally_unmodeled_compiler_attrs.",
"compiler_attr_field_map": {
"angle": "bAngleInDegrees",
"eulerseq": "EulerSeq",
"meshdir": "MeshDir",
"assetdir": "AssetDir",
"autolimits": "bAutoLimits"
},
"_note_intentionally_unmodeled_compiler_attrs": "<compiler> XML attrs that don't affect URLab's UE-side parsing — physics tuning knobs, compiler-only optimisations, paths URLab supersedes with UE asset routing. Listed explicitly so the compiler-coverage diagnostic stays clean while remaining loud on additions.",
"intentionally_unmodeled_compiler_attrs": [
"boundmass", "boundinertia", "settotalmass", "balanceinertia",
"strippath", "coordinate", "fitaabb", "discardvisual",
"usethread", "fusestatic", "inertiafromgeom", "inertiagrouprange",
"saveinertial", "texturedir", "alignfree"
],
"_note_intentionally_default_typed_attrs": "Attrs that legitimately want default_type ('float') — single scalar floats whose UE shape happens to match the rule fallback. Listed explicitly so the new_attr_typing diagnostic stays clean. Any new MuJoCo XML attr added in a future version that ISN'T a scalar float will surface as a diagnostic.",
"intentionally_default_typed_attrs": [
"active", "actuatorgravcomp", "area", "armature", "bias",
"cranklength", "cutoff", "dampratio", "density", "diameter",
"force", "fovy", "fpmax", "frictionloss", "fvmax",
"gain", "gap", "gravcomp", "inheritrange", "ipd",
"kp", "kv", "lmax", "lmin", "margin",
"mass", "noise", "output", "radius", "ref",
"resistance", "solmix", "springref", "tausmooth", "torquescale",
"vmax", "width"
],
"_note_intentionally_unmapped_mj_enum_values": "MuJoCo enum constants the codegen knowingly does NOT expose as URLab enum members. Silences the hand_enum_drift diagnostic. Two scopes: top-level keys are mjt* enum names whose entries apply to EVERY element using that enum (visualizer-only types, sentinel counts, alternative-class subsumption); '__per_element__' carries per-(element, attr) overrides for cases where the same mjt* enum admits a different subset depending on the host (e.g. <site> rejects mjGEOM_PLANE/HFIELD/MESH but <geom> accepts them).",
"intentionally_unmapped_mj_enum_values": {
"mjtGain": ["mjGAIN_DCMOTOR"],
"mjtBias": ["mjBIAS_DCMOTOR"],
"mjtDyn": ["mjDYN_DCMOTOR"],
"mjtGeom": [
"mjNGEOMTYPES",
"mjGEOM_ARROW", "mjGEOM_ARROW1", "mjGEOM_ARROW2",
"mjGEOM_LINE", "mjGEOM_LINEBOX", "mjGEOM_LABEL", "mjGEOM_TRIANGLE",
"mjGEOM_FLEX", "mjGEOM_SKIN", "mjGEOM_SDF", "mjGEOM_NONE"
],
"__per_element__": {
"_note_site_type": "Site exposes Mesh + Hfield. Plane stays omitted because a site is a point/extent surface, not an infinite plane; SDF stays omitted because it carries heavy resource data the spawn-surface UX doesn't need.",
"site.type": ["mjGEOM_PLANE"]
}
},
"_note_intentionally_unmodeled_mjs_fields": "Per-mjsX-struct list of fields URLab knows about but doesn't model via codegen. Silences the mjsX-field-drift diagnostic. Add entries for fields handled by a different UE component, by canon, or that we deliberately skip.",
"intentionally_unmodeled_mjs_fields": {
"mjsBody": [
"inertia", "ipos", "ialt", "mass", "iquat", "fullinertia", "alt",
"plugin"
],
"mjsFrame": [
"pos", "quat", "childclass", "alt"
],
"mjsFlex": [
"solimp", "solmix", "contype", "activelayers", "edgedamping", "elem",
"size", "passive", "condim", "order", "nodebody",
"vertbody", "elemtexcoord", "selfcollide", "poisson", "vert", "margin",
"conaffinity", "damping", "priority", "edgestiffness", "node",
"solref", "gap", "elastic2d", "young", "friction", "thickness", "internal"
],
"mjsCamera": [
"intrinsic", "alt"
],
"mjsGeom": [
"alt", "plugin"
],
"mjsSite": [
"alt"
],
"mjsActuator": [
"plugin"
],
"mjsJoint": [
"align"
],
"mjsSensor": [
"datatype", "dim", "intprm", "needstage", "objname", "plugin",
"refname", "reftype"
]
},
"type_mappings": {
"axis": "FVector",
"dir": "FVector",
"size": "TArray<float>",
"principal": "TArray<float>",
"focal": "TArray<float>",
"sensorsize": "TArray<float>",
"fluidcoef": "TArray<float>",
"count": "TArray<int32>",
"cellcount": "TArray<int32>",
"spacing": "TArray<float>",
"scale": "TArray<float>",
"point": "TArray<float>",
"element": "TArray<int32>",
"texcoord": "TArray<float>",
"inertiabox": "float",
"rigid": "bool",
"flatskin": "bool",
"origin": "TArray<float>",
"dim": "int32",
"rgba": "FLinearColor",
"range": "TArray<float>",
"actuatorfrcrange": "TArray<float>",
"ctrlrange": "TArray<float>",
"forcerange": "TArray<float>",
"actrange": "TArray<float>",
"lengthrange": "TArray<float>",
"gear": "TArray<float>",
"springdamper": "TArray<float>",
"springlength": "TArray<float>",
"timeconst": "TArray<float>",
"motorconst": "TArray<float>",
"nominal": "TArray<float>",
"saturation": "TArray<float>",
"inductance": "TArray<float>",
"cogging": "TArray<float>",
"controller": "TArray<float>",
"thermal": "TArray<float>",
"lugre": "TArray<float>",
"stiffness": "TArray<float>",
"damping": "TArray<float>",
"friction": "TArray<float>",
"fullinertia": "TArray<float>",
"diaginertia": "TArray<float>",
"resolution": "TArray<int32>",
"focalpixel": "TArray<int32>",
"principalpixel": "TArray<int32>",
"solref": "TArray<float>",
"solimp": "TArray<float>",
"solreflimit": "TArray<float>",
"solimplimit": "TArray<float>",
"solreffriction": "TArray<float>",
"solimpfriction": "TArray<float>",
"gainprm": "TArray<float>",
"biasprm": "TArray<float>",
"dynprm": "TArray<float>",
"polycoef": "TArray<float>",
"limited": "bool",
"mocap": "bool",
"actlimited": "bool",
"ctrllimited": "bool",
"forcelimited": "bool",
"actuatorfrclimited":"bool",
"actearly": "bool",
"shellinertia": "bool",
"fitscale": "double",
"fitaabb": "bool",
"discardvisual": "bool",
"objname": "FString",
"refname": "FString",
"gaintype": "FString",
"biastype": "FString",
"dyntype": "FString",
"fluidshape": "FString",
"site": "FString",
"joint": "FString",
"tendon": "FString",
"actuator": "FString",
"geom": "FString",
"geom1": "FString",
"geom2": "FString",
"body": "FString",
"body1": "FString",
"body2": "FString",
"site1": "FString",
"site2": "FString",
"joint1": "FString",
"joint2": "FString",
"tendon1": "FString",
"tendon2": "FString",
"mesh": "FString",
"material": "FString",
"hfield": "FString",
"childclass": "FString",
"texture": "FString",
"file": "FString",
"target": "FString",
"mode": "FString",
"anchor": "TArray<float>",
"relpose": "TArray<float>",
"ctrl": "TArray<float>",
"qpos": "TArray<float>",
"qvel": "TArray<float>",
"act": "TArray<float>",
"mpos": "TArray<float>",
"mquat": "TArray<float>",
"time": "float",
"group": "int32",
"contype": "int32",
"conaffinity": "int32",
"condim": "int32",
"priority": "int32",
"actdim": "int32",
"nsample": "int32",
"interp": "int32",
"interval": "TArray<float>",
"delay": "float",
"input": "EMjDcMotorInput"
},
"canonicalizations": {
"spatial_pose": {
"absorbs_attrs": ["pos"],
"emits_property": {"name": "Pos", "type": "FVector"},
"import_helper": "MjUtils::ReadVec3InMeters",
"export_helper": "MjUtils::UEToMjPosition"
},
"orientation": {
"absorbs_attrs": ["quat", "euler", "axisangle", "xyaxes", "zaxis"],
"emits_property": {"name": "Quat", "type": "FQuat"},
"import_helper": "MjOrientationUtils::OrientationToMjQuat",
"export_helper": "MjUtils::UEToMjRotation"
},
"actuator_transmission": {
"_note": "MJCF actuators encode their transmission via one of {joint, tendon, site, body, jointinparent} (the target name) plus optional {slidersite, refsite}. URLab collapses this to a single EMjActuatorTrnType enum + TargetName/SliderSite/RefSite strings. Codegen emits the parse+write blocks inline (no rule-side helper); the UPROPERTY declarations stay hand-side on UMjActuator.",
"absorbs_attrs": ["joint", "tendon", "site", "body", "jointinparent", "slidersite", "refsite"],
"emits_property": null
},
"body_sleep_policy": {
"_note": "MJCF body.sleep is one of {'never','allowed','init'} or absent; mjsBody.sleep is the mjtSleepPolicy enum. URLab exposes EMjBodySleepPolicy SleepPolicy (with a Default entry that means 'let the global option decide'). Codegen emits the string<->enum mapping on both sides inline (no rule-side helper); the SleepPolicy UPROPERTY itself stays declared hand-side on UMjBody.",
"absorbs_attrs": ["sleep"],
"emits_property": null
},
"fromto_decompose": {
"_note": "MJCF's `fromto` is an alternative form for capsule/cylinder/box/ellipsoid (an XY-XY segment). Decompose at import into Pos/Quat plus a half-length scalar written into size[1] (Y slot, e.g. capsule half-length) or size[2] (Z slot, e.g. box half-height) depending on shape Type. The codegen-owned size TArray<float> is grown as needed.",
"absorbs_attrs": ["fromto"],
"emits_property": null,
"import_helper": "MjUtils::DecomposeFromTo",
"category_specifics": {
"geom": {
"z_slot_check": "(Type == EMjGeomType::Box || Type == EMjGeomType::Ellipsoid)"
},
"site": {
"z_slot_check": "(Type == EMjSiteType::Box || Type == EMjSiteType::Ellipsoid)"
}
}
}
},
"element_rules": {
"actuator": {
"_note_enums": "gaintype/biastype/dyntype are mjtGain/mjtBias/mjtDyn enums on mjsActuator. URLab declares EMjGainType/EMjBiasType/EMjDynType hand-side on UMjActuator; codegen owns the XML<->enum map via xml_enum_attrs. dcmotor 'input' is per-subtype (only on UMjDcMotorActuator) — emitter gates on attr-in-subtype-schema for that case.",
"common_imports": ["class"],
"applies_canonicalizations": ["actuator_transmission"],
"xml_enum_attrs": {
"gaintype": {
"ue_property": "GainType",
"ue_enum_type": "EMjGainType",
"mjs_field": "gaintype",
"mjs_cast": "mjtGain",
"emit_property_decl": true,
"property_default": "Fixed",
"value_map": {
"fixed": ["Fixed", "mjGAIN_FIXED"],
"affine": ["Affine", "mjGAIN_AFFINE"],
"muscle": ["Muscle", "mjGAIN_MUSCLE"],
"user": ["User", "mjGAIN_USER"]
}
},
"biastype": {
"ue_property": "BiasType",
"ue_enum_type": "EMjBiasType",
"mjs_field": "biastype",
"mjs_cast": "mjtBias",
"emit_property_decl": true,
"property_default": "None",
"value_map": {
"none": ["None", "mjBIAS_NONE"],
"affine": ["Affine", "mjBIAS_AFFINE"],
"muscle": ["Muscle", "mjBIAS_MUSCLE"],
"user": ["User", "mjBIAS_USER"]
}
},
"dyntype": {
"ue_property": "DynType",
"ue_enum_type": "EMjDynType",
"mjs_field": "dyntype",
"mjs_cast": "mjtDyn",
"emit_property_decl": true,
"property_default": "None",
"value_map": {
"none": ["None", "mjDYN_NONE"],
"integrator": ["Integrator", "mjDYN_INTEGRATOR"],
"filter": ["Filter", "mjDYN_FILTER"],
"filterexact": ["FilterExact", "mjDYN_FILTEREXACT"],
"muscle": ["Muscle", "mjDYN_MUSCLE"],
"user": ["User", "mjDYN_USER"]
}
},
"input": {
"ue_property": "input",
"ue_enum_type": "EMjDcMotorInput",
"mjs_field": null,
"value_map": {
"voltage": ["Voltage", "0"],
"position": ["Position", "1"],
"velocity": ["Velocity", "2"]
}
}
}
},
"sensor": {
"_note": "Sensor reads its target name from one of several xor attrs depending on subtype (site for touch/accel/gyro, joint for jointpos, etc.). target_collations collapses them into UE FString TargetName. ReferenceName is direct from 'refname'. ObjType / RefType are EMjObjType enums with their own string<->enum mapping (xml_enum_attrs).",
"common_imports": ["class"],
"target_collations": {
"TargetName": {
"mjs_field": "objname",
"absorbs_attrs": ["site", "joint", "tendon", "actuator", "body", "geom", "objname", "camera", "mesh"]
},
"ReferenceName": {
"mjs_field": "refname",
"absorbs_attrs": ["refname"]
}
},
"xml_enum_attrs": {
"objtype": {
"ue_property": "ObjType",
"ue_enum_type": "EMjObjType",
"has_override_toggle": false,
"value_map": {
"body": ["Body", "mjOBJ_BODY"],
"xbody": ["XBody", "mjOBJ_XBODY"],
"joint": ["Joint", "mjOBJ_JOINT"],
"dof": ["DoF", "mjOBJ_DOF"],
"geom": ["Geom", "mjOBJ_GEOM"],
"site": ["Site", "mjOBJ_SITE"],
"camera": ["Camera", "mjOBJ_CAMERA"],
"light": ["Light", "mjOBJ_LIGHT"],
"mesh": ["Mesh", "mjOBJ_MESH"],
"hfield": ["HField", "mjOBJ_HFIELD"],
"texture": ["Texture", "mjOBJ_TEXTURE"],
"material": ["Material", "mjOBJ_MATERIAL"],
"pair": ["Pair", "mjOBJ_PAIR"],
"exclude": ["Exclude", "mjOBJ_EXCLUDE"],
"equality": ["Equality", "mjOBJ_EQUALITY"],
"tendon": ["Tendon", "mjOBJ_TENDON"],
"actuator": ["Actuator", "mjOBJ_ACTUATOR"]
}
},
"reftype": {
"ue_property": "RefType",
"ue_enum_type": "EMjObjType",
"has_override_toggle": false,
"value_map": {
"body": ["Body", "mjOBJ_BODY"],
"xbody": ["XBody", "mjOBJ_XBODY"],
"joint": ["Joint", "mjOBJ_JOINT"],
"geom": ["Geom", "mjOBJ_GEOM"],
"site": ["Site", "mjOBJ_SITE"],
"camera": ["Camera", "mjOBJ_CAMERA"]
}
}
}
},
"joint": {
"_note_axis_pos": "axis: MuJoCo direction vector with opposite Y handedness vs UE; vec3_convert.axis = y_negate flips on import + export. pos: spatial_pose canon emits the Pos UPROPERTY pair + drives SetRelativeLocation on import.",
"common_imports": ["class"],
"applies_canonicalizations": ["spatial_pose"],
"vec3_convert": {"axis": "y_negate"},
"property_defaults": {"axis": "FVector(0.0f, 0.0f, 1.0f)"},
"_note_hidden": "Pos is the joint anchor offset — derived from the UE component's RelativeLocation. Axis stays visible as a direction (not a position) and is the user-authored joint hinge direction.",
"hidden_canon_properties": ["spatial_pose"],
"_note_property_meta": "Joint fields whose unit semantics shift with the joint Type get a tooltip that spells out the per-type interpretation, so a user reading the Details panel knows whether the number is metres or degrees. UE's Units meta is intentionally NOT used here — a static label would be wrong for the other Type.",
"property_meta": {
"axis": "ToolTip=\"Joint axis in the parent body's local frame. Hinge: rotation axis. Slide: translation direction. Ignored for Ball and Free.\"",
"range": "ToolTip=\"Joint position bounds [min, max]. Hinge/Ball: degrees. Slide: centimetres. Ignored when 'limited' is false.\"",
"ref": "ToolTip=\"Reference (zero) position. Hinge/Ball: degrees. Slide: centimetres.\"",
"springref": "ToolTip=\"Equilibrium position for the joint spring. Hinge/Ball: degrees. Slide: centimetres.\"",
"stiffness": "ToolTip=\"Per-axis spring stiffness. Hinge/Ball: N·m/rad. Slide: N/m.\"",
"damping": "ToolTip=\"Per-axis damping. Hinge/Ball: N·m·s/rad. Slide: N·s/m.\"",
"springdamper": "ToolTip=\"Compact spring spec [stiffness, damping]; populated when MJCF used <joint springdamper='...'>. Overrides stiffness + damping when set.\"",
"armature": "ToolTip=\"Added rotor inertia for hinges (kg·m²) or added mass for slides (kg). Models reflected inertia of the actuator.\"",
"frictionloss": "ToolTip=\"Dry-friction loss. Hinge/Ball: N·m. Slide: N.\"",
"actuatorgravcomp": "ToolTip=\"Gravity compensation factor passed to actuators on this joint. 0 = no compensation, 1 = full gravity cancelled.\"",
"actuatorfrcrange": "ToolTip=\"Actuator force bounds [min, max] when 'ActFrcLimited' is true. Hinge/Ball: N·m. Slide: N.\"",
"margin": "ToolTip=\"Contact-detection margin (m). Joints inherit this when computing limit constraints.\"",
"group": "ToolTip=\"Visualisation group 0–5. MuJoCo viewer uses this to toggle visibility.\""
},
"xml_enum_attrs": {
"type": {
"ue_property": "Type",
"ue_enum_type": "EMjJointType",
"mjs_field": "type",
"mjs_cast": "mjtJoint",
"value_map": {
"hinge": ["Hinge", "mjJNT_HINGE"],
"slide": ["Slide", "mjJNT_SLIDE"],
"ball": ["Ball", "mjJNT_BALL"],
"free": ["Free", "mjJNT_FREE"]
}
}
},
"_note_unit_conversion": "URLab stores joint range/ref/springref in UE conventions (degrees for hinge/ball, centimetres for slide). MJCF XML carries them in the compiler.angle unit (deg/rad) for angular joints and metres for linear; URLab's spec wrapper sets compiler.degree=false so mjsJoint.range[] must be radians on the wire. The conversions below normalize at the IO boundary so the rest of URLab can treat the UPROPERTYs as UE-native values.",
"unit_conversion": {
"range": [
{"condition": "Type == EMjJointType::Slide",
"import_op": "m_to_cm", "export_op": "cm_to_m"},
{"condition": "(Type == EMjJointType::Hinge) || (Type == EMjJointType::Ball)",
"import_op": "rad_to_deg_if_xml_radians", "export_op": "deg_to_rad"}
],
"ref": [
{"condition": "Type == EMjJointType::Slide",
"import_op": "m_to_cm", "export_op": "cm_to_m"},
{"condition": "(Type == EMjJointType::Hinge) || (Type == EMjJointType::Ball)",
"import_op": "rad_to_deg_if_xml_radians", "export_op": "deg_to_rad"}
],
"springref": [
{"condition": "Type == EMjJointType::Slide",
"import_op": "m_to_cm", "export_op": "cm_to_m"},
{"condition": "(Type == EMjJointType::Hinge) || (Type == EMjJointType::Ball)",
"import_op": "rad_to_deg_if_xml_radians", "export_op": "deg_to_rad"}
]
}
},
"geom": {
"_note": "size is codegen-owned TArray<float>; fromto-decomposed half-length is written into size[1]/[2] by the canon. material is codegen-owned for IMPORT (FString -> UE material lookup) but SKIPPED on export because URLab handles materials as UE assets and does not register them in the mjsSpec (mjs_setString on Element->material would reference a non-existent spec entry and fail mj_compile). Orientation cluster absorbed by `orientation`; fromto absorbed by `fromto_decompose`. type is an URLab enum (EMjGeomType); codegen owns the XML<->enum string map via xml_enum_attrs.",
"common_imports": ["class"],
"_note_hfield": "hfield references URLab's own hfield actor system, not a mjsHField spec entry. Codegen still imports the string for editor visibility but skips the spec write to avoid 'hfield not found' on compile.",
"export_skip_attrs": ["material", "hfield"],
"applies_canonicalizations": ["spatial_pose", "orientation", "fromto_decompose"],
"_note_sentinel": "fromto-only XML inputs leave the radius slot unset; the canon writes -1.0f as the sentinel and the per-attr size export skips those slots so the parent default's radius is preserved.",
"sentinel_skip_export": {"size": "-1.0f"},
"_note_property_units": "Scalar lengths exposed in mjsGeom carry meta=(Units=\"m\") so the editor shows a 'm' suffix or auto-converts to cm/mm when 'Display Units' is enabled. Storage stays raw MJ metres; export path unaffected. size is hidden (Scale3D is canonical) — see hidden_attrs.",
"property_units": {
"margin": "m",
"gap": "m"
},
"_note_hidden": "See _doc_transform_widget_policy. size is hidden too — Scale3D is canonical.",
"hidden_canon_properties": ["spatial_pose", "orientation"],
"hidden_attrs": ["size"],
"_note_attr_to_mjs_field": "MuJoCo renames fluidcoef -> fluid_coefs on the mjsGeom struct. shellinertia and fluidshape are handled by xml_enum_attrs below (they need string<->enum + field-rename together).",
"attr_to_mjs_field": {
"fluidcoef": "fluid_coefs"
},
"xml_enum_attrs": {
"type": {
"ue_property": "Type",
"ue_enum_type": "EMjGeomType",
"mjs_field": "type",
"mjs_cast": "mjtGeom",
"value_map": {
"plane": ["Plane", "mjGEOM_PLANE"],
"hfield": ["Hfield", "mjGEOM_HFIELD"],
"sphere": ["Sphere", "mjGEOM_SPHERE"],
"capsule": ["Capsule", "mjGEOM_CAPSULE"],
"ellipsoid": ["Ellipsoid", "mjGEOM_ELLIPSOID"],
"cylinder": ["Cylinder", "mjGEOM_CYLINDER"],
"box": ["Box", "mjGEOM_BOX"],
"mesh": ["Mesh", "mjGEOM_MESH"],
"sdf": ["SDF", "mjGEOM_SDF"]
}
},
"shellinertia": {
"_note": "XML attr is bool-ish (true/false). MuJoCo stores it as mjtGeomInertia (mjINERTIA_VOLUME=0 default, mjINERTIA_SHELL=1) in mjsGeom.typeinertia.",
"ue_property": "ShellInertia",
"ue_enum_type": "EMjGeomInertia",
"mjs_field": "typeinertia",
"mjs_cast": "mjtGeomInertia",
"value_map": {
"false": ["Volume", "mjINERTIA_VOLUME"],
"true": ["Shell", "mjINERTIA_SHELL"]
}
},
"fluidshape": {
"_note": "XML attr is none/ellipsoid. MuJoCo stores 0.0/1.0 in mjsGeom.fluid_ellipsoid (mjtNum).",
"ue_property": "FluidShape",
"ue_enum_type": "EMjFluidShape",
"mjs_field": "fluid_ellipsoid",
"mjs_cast": "mjtNum",
"value_map": {
"none": ["None", "0.0"],
"ellipsoid": ["Ellipsoid", "1.0"]
}
}
}
},
"site": {
"_note": "Same as geom: size codegen-owned TArray; material codegen-owned for IMPORT but export-skipped (UE-side materials); orientation + fromto canonicalized. mjsSite.type uses mjtGeom (sites are visual 'geoms'). Site has no bOverride_Type — Type always carries a value (default Sphere).",
"export_skip_attrs": ["material"],
"applies_canonicalizations": ["spatial_pose", "orientation", "fromto_decompose"],
"sentinel_skip_export": {"size": "-1.0f"},
"_note_hidden": "See _doc_transform_widget_policy. size hidden too — Scale3D is canonical.",
"hidden_canon_properties": ["spatial_pose", "orientation"],
"hidden_attrs": ["size"],
"xml_enum_attrs": {
"type": {
"ue_property": "Type",
"ue_enum_type": "EMjSiteType",
"mjs_field": "type",
"mjs_cast": "mjtGeom",
"has_override_toggle": false,
"value_map": {
"sphere": ["Sphere", "mjGEOM_SPHERE"],
"capsule": ["Capsule", "mjGEOM_CAPSULE"],
"ellipsoid": ["Ellipsoid", "mjGEOM_ELLIPSOID"],
"cylinder": ["Cylinder", "mjGEOM_CYLINDER"],
"box": ["Box", "mjGEOM_BOX"],
"mesh": ["Mesh", "mjGEOM_MESH"],
"hfield": ["Hfield", "mjGEOM_HFIELD"]
}
}
}
},
"tendon": {
"common_imports": ["class"],
"_note_material": "material codegen-owned for IMPORT but export-skipped — URLab handles materials as UE assets, not mjsMaterial spec entries.",
"export_skip_attrs": ["material"],
"_note_property_units": "springlength is unambiguously a length in metres. range is intentionally NOT tagged — it can be a length (slide-mode tendon) or an angle (rare hinge-coupled tendon) and labelling it with one unit would be wrong as often as right.",
"property_units": {
"springlength": "m"
}
},
"equality": {
"_note_target_collation": "MJCF equality elements address one or two of {body, site, joint, tendon, flex} per the equality kind. URLab collapses to FString Obj1/Obj2 (hand-declared UPROPERTYs with dynamic GetOptions based on EqualityType). Excluded from codegen so they don't appear as separate UPROPERTYs; target_collations rule emits the import collation + mjs_setString export. site1/site2 stay as their own UPROPERTYs (codegen-owned) so the objtype switch in ExportTo can detect site-mode connects/welds and pick mjOBJ_SITE.",
"exclude_attrs": ["body1", "body2", "joint1", "joint2", "tendon1", "tendon2", "flex"],
"target_collations": {
"Obj1": {
"absorbs_attrs": ["body1", "site1", "joint1", "tendon1", "flex"],
"mjs_field": "name1"
},
"Obj2": {
"absorbs_attrs": ["body2", "site2", "joint2", "tendon2"],
"mjs_field": "name2"
}
},
"_note_data_packed": "mjsEquality has no per-attr fields for anchor/relpose/polycoef/torquescale; they all pack into data[] per the connect/weld/joint/tendon layout (verified via probe_eq_spec.py against the installed MuJoCo). Codegen-emitted exports replace the default per-attr emission with the packed write under the right EqualityType condition. anchor carries a cm_to_m export op so the URLab-side cm convention round-trips into spec metres. relpose is stored opaquely (raw MJ format: metres for the first 3 floats, MuJoCo quat for the last 4) — weld constraints are rare enough that the inconsistency is worth the simpler emitter.",
"_note_unit_conversion": "anchor is a position offset in body1's local frame; URLab stores it in centimetres (matching every other position UPROPERTY). The unit_conversion below handles the import side (XML m -> UPROPERTY cm); the data-packed export carries its own cm_to_m op so it converts in flight before writing data[0..2].",
"unit_conversion": {
"anchor": [
{"condition": "(EqualityType == EMjEqualityType::Connect) || (EqualityType == EMjEqualityType::Weld)",
"import_op": "m_to_cm"}
]
},
"_note_property_units": "anchor is stored in UE centimetres (post unit_conversion). Tagging the field with Units=\"cm\" so the editor shows the suffix that matches the actual stored value — no auto-conversion needed.",
"property_units": {
"anchor": "cm"
},
"mjs_data_packed_attrs": {
"anchor": {
"slot_range": [0, 3],
"condition": "(EqualityType == EMjEqualityType::Connect) || (EqualityType == EMjEqualityType::Weld)",
"export_op": "cm_to_m"
},
"relpose": {
"slot_range": [3, 10],
"condition": "EqualityType == EMjEqualityType::Weld"
},
"polycoef": {
"_note": "polycoef is a 5-element MJCF attribute (default '0 1 0 0 0'). mjsEquality.data layout reserves slots 0..4 for it on joint/tendon equalities; slots 5..10 hold other fields (e.g. weld's torquescale at 10). Capping the slot_range here keeps a TArray<float> longer than 5 entries from overflowing into those slots.",
"slot_range": [0, 5],
"condition": "(EqualityType == EMjEqualityType::Joint) || (EqualityType == EMjEqualityType::Tendon)"
},
"torquescale": {
"slot": 10,
"condition": "EqualityType == EMjEqualityType::Weld"
}
}
},
"camera": {
"_note": "MJCF camera.mode is a tracking mode (mjtCamLight subset). URLab declares EMjCameraTrackingMode hand-side; codegen owns the XML<->enum map. NOT to be confused with URLab's EMjCameraMode which is a UE-side render-mode selector (RGB/Depth/Segmentation).",
"_note_common_imports": "Camera also reads name; the hand-written ImportFromXml has a fallback `if MjName empty -> 'Camera'` that runs AFTER this read.",
"common_imports": ["name"],
"applies_canonicalizations": ["spatial_pose", "orientation"],
"_note_hidden": "See _doc_transform_widget_policy. Intrinsics (fovy, ipd, focal, etc.) stay visible.",
"hidden_canon_properties": ["spatial_pose", "orientation"],
"_note_attr_to_mjs_field": "MuJoCo renames a handful of camera attrs between the XML schema and the mjsCamera struct: target -> targetbody (mjString*), projection -> proj (mjtProjection enum), focal -> focal_length, principal -> principal_length. sensorsize auto-resolves to sensor_size via the underscore-normalise heuristic. Without this map the auto-resolver in _resolve_mjs_field can't bridge target/focal/principal and they were silently dropped on export.",
"attr_to_mjs_field": {
"target": "targetbody",
"focal": "focal_length",
"principal": "principal_length"
},
"_note_property_units": "Camera lengths (ipd, focal, principal, sensorsize) stay in raw MJ metres on the UE side; tagging them with Units=\"m\" gives the editor a suffix and lets Display Units convert to mm/cm. fovy is degrees per the MJCF spec. focalpixel / principalpixel are pixel counts (not lengths) and are intentionally untagged.",
"property_units": {
"ipd": "m",
"focal": "m",
"principal": "m",
"sensorsize": "m",
"fovy": "deg"
},
"xml_enum_attrs": {
"mode": {
"ue_property": "TrackingMode",
"ue_enum_type": "EMjCameraTrackingMode",
"mjs_field": "mode",
"mjs_cast": "mjtCamLight",
"value_map": {
"fixed": ["Fixed", "mjCAMLIGHT_FIXED"],
"track": ["Track", "mjCAMLIGHT_TRACK"],
"trackcom": ["TrackCom", "mjCAMLIGHT_TRACKCOM"],
"targetbody": ["TargetBody", "mjCAMLIGHT_TARGETBODY"],
"targetbodycom": ["TargetBodyCom", "mjCAMLIGHT_TARGETBODYCOM"]
}
},
"projection": {
"ue_property": "Projection",
"ue_enum_type": "EMjCameraProjection",
"mjs_field": "proj",
"mjs_cast": "mjtProjection",
"value_map": {
"orthographic": ["Orthographic", "mjPROJ_ORTHOGRAPHIC"],
"perspective": ["Perspective", "mjPROJ_PERSPECTIVE"]
}
}
}
},
"body": {
"common_imports": ["name"],
"applies_canonicalizations": ["spatial_pose", "orientation", "body_sleep_policy"],
"_note_canon_export_skip": "Body's pos/quat are written by MjSpecWrapper::CreateBody from the UE component transform (the source of truth for body placement). The codegen-emitted spatial_pose/orientation export would overwrite those with the Pos/Quat UPROPERTYs, which are stale for any body not freshly imported from XML. Skip the export side for these two canons.",
"canon_export_skip": ["spatial_pose", "orientation"],
"_note_hidden": "See _doc_transform_widget_policy. canon_export_skip routes the write through the UE transform.",
"hidden_canon_properties": ["spatial_pose", "orientation"],
"property_meta": {
"mocap": "DisplayName=\"Driven By Unreal\"",
"childclass": "GetOptions=\"GetChildClassOptions\""
}
},
"inertial": {
"applies_canonicalizations": ["spatial_pose", "orientation"],
"_note_hidden": "See _doc_transform_widget_policy. UMjInertial::RegisterToSpec (hand-rolled) writes ParentBody->ipos/iquat from the UE transform.",
"hidden_canon_properties": ["spatial_pose", "orientation"]
},
"frame": {
"_note": "Like body: the UE component transform is the source of truth for placement. Codegen imports XML pos/quat into Pos/Quat UPROPERTYs (UE units / UE frame) and the cpp drives SetRelativeLocation/SetRelativeRotation from them. Spec export is skipped for the canon Pos/Quat because MjSpecWrapper::CreateFrame writes pos/quat from the UE transform.",
"applies_canonicalizations": ["spatial_pose", "orientation"],
"canon_export_skip": ["spatial_pose", "orientation"],
"hidden_canon_properties": ["spatial_pose", "orientation"]
},
"flexcomp": {
"_note": "Flexcomp doesn't register via mjs_addX — at spec time UMjFlexcomp builds a tiny standalone MJCF fragment and re-parses it via mj_parseXMLString + mjs_attach (the flexcomp macro is expanded by MuJoCo's XML parser, not the spec API). Codegen still owns the UPROPERTY surface so new MJCF attrs auto-appear; BuildFlexcompXml in MjFlexcomp.cpp reads from those codegen-owned fields. Sub-elements (<contact>/<edge>/<elasticity>/<pin>) remain hand-rolled because the codegen doesn't have per-sub-element UPROPERTY support yet.",
"_note_material": "material codegen-owned for IMPORT but export-skipped — URLab handles materials as UE assets, not mjsMaterial spec entries.",
"export_skip_attrs": ["material"],
"applies_canonicalizations": ["spatial_pose", "orientation"],
"canon_export_skip": ["spatial_pose", "orientation"],
"hidden_canon_properties": ["spatial_pose", "orientation"],
"property_units": {
"radius": "m",
"spacing": "m"
},
"xml_enum_attrs": {
"type": {
"ue_property": "FlexcompType",
"ue_enum_type": "EMjFlexcompType",
"mjs_field": "type",
"mjs_cast": "int",
"value_map": {
"grid": ["Grid", "0"],
"box": ["Box", "1"],
"cylinder": ["Cylinder", "2"],
"ellipsoid": ["Ellipsoid", "3"],
"square": ["Square", "4"],
"disc": ["Disc", "5"],
"circle": ["Circle", "6"],
"mesh": ["Mesh", "7"],
"gmsh": ["Gmsh", "8"],
"direct": ["Direct", "9"]
}
},
"dof": {
"ue_property": "FlexcompDof",
"ue_enum_type": "EMjFlexcompDof",
"mjs_field": "dof",
"mjs_cast": "int",
"value_map": {
"full": ["Full", "0"],
"radial": ["Radial", "1"],
"trilinear": ["Trilinear", "2"],
"quadratic": ["Quadratic", "3"],
"2d": ["TwoD", "4"]
}
}
}
},
"freejoint": {
},
"contact_pair": {
"common_imports": [{"attr": "name", "ue_field": "Name"}],
"property_units": {
"margin": "m",
"gap": "m"
}
},
"contact_exclude": {
"common_imports": [{"attr": "name", "ue_field": "Name"}]
},
"keyframe": {
"_note": "qpos/qvel/act/ctrl/mpos/mquat target mjsKey's mjDoubleVec* fields (std::vector<double>*) — require ->clear()+->push_back() rather than direct assignment. Codegen emits the import (TArray<float> read) + the mjs_double_vec-style export. RegisterToSpec hand-rolls freejoint-padding for qpos/qvel.",
"mjs_double_vec_attrs": ["qpos", "qvel", "act", "ctrl", "mpos", "mquat"]
}
},
"categories": {
"actuator": {
"layout": "single_uclass_per_file",
"base_class_name": "UMjActuator",
"base_class_header": "MuJoCo/Components/Actuators/MjActuator.h",
"subclass_directory_pub": "MuJoCo/Components/Actuators",
"subclass_directory_priv": "MuJoCo/Components/Actuators",
"mjs_struct": "mjsActuator",
"schema_common_block": "actuator_common.attrs",
"schema_common_extra_attrs": ["gainprm", "biasprm", "dynprm", "gaintype", "biastype", "dyntype", "actdim"],
"schema_subtypes_block": "actuator_types",
"type_enum_name": "EMjActuatorType",
"subtypes": [
{"key": "general", "enum_value": "Motor", "class_name": "UMjGeneralActuator", "header": "MjGeneralActuator.h"},
{"key": "motor", "enum_value": "Motor", "class_name": "UMjMotorActuator", "header": "MjMotorActuator.h"},
{"key": "position", "enum_value": "Position", "class_name": "UMjPositionActuator", "header": "MjPositionActuator.h"},
{"key": "velocity", "enum_value": "Velocity", "class_name": "UMjVelocityActuator", "header": "MjVelocityActuator.h"},
{"key": "intvelocity", "enum_value": "IntVelocity","class_name": "UMjIntVelocityActuator", "header": "MjIntVelocityActuator.h"},
{"key": "damper", "enum_value": "Damper", "class_name": "UMjDamperActuator", "header": "MjDamperActuator.h"},
{"key": "cylinder", "enum_value": "Cylinder", "class_name": "UMjCylinderActuator", "header": "MjCylinderActuator.h"},
{"key": "muscle", "enum_value": "Muscle", "class_name": "UMjMuscleActuator", "header": "MjMuscleActuator.h"},
{"key": "adhesion", "enum_value": "Adhesion", "class_name": "UMjAdhesionActuator", "header": "MjAdhesionActuator.h"},
{"key": "dcmotor", "enum_value": "DcMotor", "class_name": "UMjDcMotorActuator", "header": "MjDcMotorActuator.h"}
],
"_note_subtype_setto": "Codegen-driven mjs_setTo* call config. Function signatures come from the clang-AST introspect snapshot, projected by _mjspec_from_introspect; the generator emits the call from the signature + the per-subtype config below. NO hand-written C++ literals in this file.",
"_note_inherit_fields": "MuJoCo's mjs_setTo* write some params UNCONDITIONALLY by value (e.g. gainprm[0] = kp), so there is no sentinel meaning 'unset' — passing one clobbers the value the default class already put on the element via mjs_addActuator. For those params, `inherit_fields` names the C++ expression the generator re-asserts when the UPROPERTY isn't overridden, preserving the inherited value. `nullable_params` are pointer args (double x[1]) MuJoCo skips on nullptr; passing nullptr when unset is MuJoCo's actual 'leave default alone' convention (its own Python binding maps -1 -> nullptr). Muscle/dcmotor are unaffected: muscle guards every param with `>= 0` so the -1.0 sentinel is correct, and dcmotor already passes nullptr for unset arrays.",
"subtype_setto": {
"general": null,
"motor": {"call": "mjs_setToMotor"},
"position": {"call": "mjs_setToPosition",
"inherit_fields": {"kp": "Element->gainprm[0]"},
"nullable_params": ["kv", "dampratio", "timeconst"]},
"velocity": {"call": "mjs_setToVelocity",
"inherit_fields": {"kv": "Element->gainprm[0]"}},
"intvelocity": {"call": "mjs_setToIntVelocity",
"inherit_fields": {"kp": "Element->gainprm[0]"},
"nullable_params": ["kv", "dampratio", "timeconst"]},
"_todo_damper_inherit": "TODO(jonat): decide fidelity vs correctness for damper's inherited kv. MuJoCo's xml_native_reader.cc OneActuator() seeds `double kv = 0` for the damper case (all sibling types seed from the inherited field, e.g. position `kp = actuator->gainprm[0]`), so mj_loadXML SILENTLY DROPS a damper's class-inherited kv to 0 — verified a bug, present in upstream main. URLab's inherit_fields below re-asserts -gainprm[2], so URLab is MORE correct (keeps kv) but DIVERGES from mj_loadXML, which can break UE-vs-bridge sim2sim. Revisit: either match MuJoCo bug-for-bug for fidelity, or upstream a fix (seed `kv = -actuator->gainprm[2]`). See MjActuatorInheritanceTests InheritedDamperKv_Preserved.",
"damper": {"call": "mjs_setToDamper",
"inherit_fields": {"kv": "-Element->gainprm[2]"}},
"cylinder": {"call": "mjs_setToCylinder",
"inherit_fields": {"timeconst": "Element->dynprm[0]", "bias": "Element->biasprm[0]", "area": "Element->gainprm[0]"}},
"muscle": {"call": "mjs_setToMuscle",
"projections": {"scale": "X"}},
"adhesion": {"call": "mjs_setToAdhesion",
"inherit_fields": {"gain": "Element->gainprm[0]"}},
"dcmotor": {"call": "mjs_setToDCMotor",
"nullable_arrays": true,
"use_filldouble": true,
"param_renames": {"input_mode": "input"}}
}
},
"sensor": {
"layout": "single_uclass_per_file",
"base_class_name": "UMjSensor",
"base_class_header": "MuJoCo/Components/Sensors/MjSensor.h",
"subclass_directory_pub": "MuJoCo/Components/Sensors",
"subclass_directory_priv": "MuJoCo/Components/Sensors",
"mjs_struct": "mjsSensor",
"schema_common_block": "sensor_common.attrs",
"schema_subtypes_block": "sensor_types",
"type_enum_name": "EMjSensorType",
"subtypes": [
{"key": "touch", "enum_value": "Touch", "class_name": "UMjTouchSensor", "header": "MjTouchSensor.h", "fully_emitted": true},
{"key": "accelerometer", "enum_value": "Accelerometer", "class_name": "UMjAccelerometer", "header": "MjAccelerometer.h", "fully_emitted": true},
{"key": "velocimeter", "enum_value": "Velocimeter", "class_name": "UMjVelocimeter", "header": "MjVelocimeter.h", "fully_emitted": true},
{"key": "gyro", "enum_value": "Gyro", "class_name": "UMjGyro", "header": "MjGyro.h", "fully_emitted": true},
{"key": "force", "enum_value": "Force", "class_name": "UMjForceSensor", "header": "MjForceSensor.h", "fully_emitted": true},
{"key": "torque", "enum_value": "Torque", "class_name": "UMjTorqueSensor", "header": "MjTorqueSensor.h", "fully_emitted": true},
{"key": "magnetometer", "enum_value": "Magnetometer", "class_name": "UMjMagnetometer", "header": "MjMagnetometer.h", "fully_emitted": true},
{"key": "camprojection", "enum_value": "CamProjection", "class_name": "UMjCamProjectionSensor", "header": "MjCamProjectionSensor.h", "fully_emitted": true},
{"key": "rangefinder", "enum_value": "RangeFinder", "class_name": "UMjRangeFinderSensor", "header": "MjRangeFinderSensor.h",
"case_body_override": "Element->type = mjSENS_RANGEFINDER; Element->objtype = (ObjType == EMjObjType::Camera) ? mjOBJ_CAMERA : mjOBJ_SITE;",
"fully_emitted": true},
{"key": "jointpos", "enum_value": "JointPos", "class_name": "UMjJointPosSensor", "header": "MjJointPosSensor.h"},
{"key": "jointvel", "enum_value": "JointVel", "class_name": "UMjJointVelSensor", "header": "MjJointVelSensor.h", "fully_emitted": true},
{"key": "ballquat", "enum_value": "BallQuat", "class_name": "UMjBallQuatSensor", "header": "MjBallQuatSensor.h", "fully_emitted": true},
{"key": "ballangvel", "enum_value": "BallAngVel", "class_name": "UMjBallAngVelSensor", "header": "MjBallAngVelSensor.h", "fully_emitted": true},
{"key": "jointlimitpos", "enum_value": "JointLimitPos", "class_name": "UMjJointLimitPosSensor", "header": "MjJointLimitPosSensor.h", "fully_emitted": true},
{"key": "jointlimitvel", "enum_value": "JointLimitVel", "class_name": "UMjJointLimitVelSensor", "header": "MjJointLimitVelSensor.h", "fully_emitted": true},
{"key": "jointlimitfrc", "enum_value": "JointLimitFrc", "class_name": "UMjJointLimitFrcSensor", "header": "MjJointLimitFrcSensor.h", "fully_emitted": true},
{"key": "tendonpos", "enum_value": "TendonPos", "class_name": "UMjTendonPosSensor", "header": "MjTendonPosSensor.h", "fully_emitted": true},
{"key": "tendonvel", "enum_value": "TendonVel", "class_name": "UMjTendonVelSensor", "header": "MjTendonVelSensor.h", "fully_emitted": true},
{"key": "tendonlimitpos", "enum_value": "TendonLimitPos", "class_name": "UMjTendonLimitPosSensor", "header": "MjTendonLimitPosSensor.h", "fully_emitted": true},
{"key": "tendonlimitvel", "enum_value": "TendonLimitVel", "class_name": "UMjTendonLimitVelSensor", "header": "MjTendonLimitVelSensor.h", "fully_emitted": true},
{"key": "tendonlimitfrc", "enum_value": "TendonLimitFrc", "class_name": "UMjTendonLimitFrcSensor", "header": "MjTendonLimitFrcSensor.h", "fully_emitted": true},
{"key": "actuatorpos", "enum_value": "ActuatorPos", "class_name": "UMjActuatorPosSensor", "header": "MjActuatorPosSensor.h", "fully_emitted": true},
{"key": "actuatorvel", "enum_value": "ActuatorVel", "class_name": "UMjActuatorVelSensor", "header": "MjActuatorVelSensor.h", "fully_emitted": true},
{"key": "actuatorfrc", "enum_value": "ActuatorFrc", "class_name": "UMjActuatorFrcSensor", "header": "MjActuatorFrcSensor.h", "fully_emitted": true},
{"key": "jointactuatorfrc", "enum_value": "JointActFrc", "class_name": "UMjJointActFrcSensor", "header": "MjJointActFrcSensor.h", "fully_emitted": true},
{"key": "tendonactuatorfrc","enum_value": "TendonActFrc", "class_name": "UMjTendonActFrcSensor", "header": "MjTendonActFrcSensor.h", "fully_emitted": true},
{"key": "framepos", "enum_value": "FramePos", "class_name": "UMjFramePosSensor", "header": "MjFramePosSensor.h", "fully_emitted": true},
{"key": "framequat", "enum_value": "FrameQuat", "class_name": "UMjFrameQuatSensor", "header": "MjFrameQuatSensor.h", "fully_emitted": true},
{"key": "framexaxis", "enum_value": "FrameXAxis", "class_name": "UMjFrameXAxisSensor", "header": "MjFrameXAxisSensor.h", "fully_emitted": true},
{"key": "frameyaxis", "enum_value": "FrameYAxis", "class_name": "UMjFrameYAxisSensor", "header": "MjFrameYAxisSensor.h", "fully_emitted": true},
{"key": "framezaxis", "enum_value": "FrameZAxis", "class_name": "UMjFrameZAxisSensor", "header": "MjFrameZAxisSensor.h", "fully_emitted": true},
{"key": "framelinvel", "enum_value": "FrameLinVel", "class_name": "UMjFrameLinVelSensor", "header": "MjFrameLinVelSensor.h", "fully_emitted": true},
{"key": "frameangvel", "enum_value": "FrameAngVel", "class_name": "UMjFrameAngVelSensor", "header": "MjFrameAngVelSensor.h", "fully_emitted": true},
{"key": "framelinacc", "enum_value": "FrameLinAcc", "class_name": "UMjFrameLinAccSensor", "header": "MjFrameLinAccSensor.h", "fully_emitted": true},
{"key": "frameangacc", "enum_value": "FrameAngAcc", "class_name": "UMjFrameAngAccSensor", "header": "MjFrameAngAccSensor.h", "fully_emitted": true},
{"key": "subtreecom", "enum_value": "SubtreeCom", "class_name": "UMjSubtreeComSensor", "header": "MjSubtreeComSensor.h", "fully_emitted": true},
{"key": "subtreelinvel", "enum_value": "SubtreeLinVel", "class_name": "UMjSubtreeLinVelSensor", "header": "MjSubtreeLinVelSensor.h", "fully_emitted": true},
{"key": "subtreeangmom", "enum_value": "SubtreeAngMom", "class_name": "UMjSubtreeAngMomSensor", "header": "MjSubtreeAngMomSensor.h", "fully_emitted": true},
{"key": "insidesite", "enum_value": "InsideSite", "class_name": "UMjInsideSiteSensor", "header": "MjInsideSiteSensor.h", "fully_emitted": true},
{"key": "distance", "enum_value": "GeomDist", "class_name": "UMjGeomDistSensor", "header": "MjGeomDistSensor.h", "fully_emitted": true},
{"key": "normal", "enum_value": "GeomNormal", "class_name": "UMjGeomNormalSensor", "header": "MjGeomNormalSensor.h", "fully_emitted": true},
{"key": "fromto", "enum_value": "GeomFromTo", "class_name": "UMjGeomFromToSensor", "header": "MjGeomFromToSensor.h", "fully_emitted": true},
{"key": "contact", "enum_value": "Contact", "class_name": "UMjContactSensor", "header": "MjContactSensor.h", "fully_emitted": true},
{"key": "e_potential", "enum_value": "EPotential", "class_name": "UMjEPotentialSensor", "header": "MjEPotentialSensor.h", "fully_emitted": true},
{"key": "e_kinetic", "enum_value": "EKinetic", "class_name": "UMjEKineticSensor", "header": "MjEKineticSensor.h", "fully_emitted": true},
{"key": "clock", "enum_value": "Clock", "class_name": "UMjClockSensor", "header": "MjClockSensor.h", "fully_emitted": true},
{"key": "tactile", "enum_value": "Tactile", "class_name": "UMjTactileSensor", "header": "MjTactileSensor.h"},
{"key": "user", "enum_value": "User", "class_name": "UMjUserSensor", "header": "MjUserSensor.h", "fully_emitted": true},
{"key": "plugin", "enum_value": "Plugin", "class_name": "UMjPluginSensor", "header": "MjPluginSensor.h", "fully_emitted": true}
]
},
"joint": {
"layout": "single_uclass_per_file",
"base_class_name": "UMjJoint",
"base_class_header": "MuJoCo/Components/Joints/MjJoint.h",
"subclass_directory_pub": "MuJoCo/Components/Joints",
"subclass_directory_priv": "MuJoCo/Components/Joints",
"mjs_struct": "mjsJoint",
"schema_common_block": "joint.attrs",
"type_enum_name": "EMjJointType",
"subtypes": [
{"key": "hinge", "enum_value": "Hinge", "class_name": "UMjHingeJoint", "header": "MjHingeJoint.h", "fully_emitted": true,
"_note_extra_ctor": "UMjJoint::ExportTo only writes Element->type when bOverride_Type is true. Without this flag set in the subclass ctor, BP-spawned joints fall back to the mjsJoint default (mjJNT_HINGE), silently substituting Ball/Slide joints for Hinge.",
"extra_constructor": "bOverride_Type = true;"},
{"key": "slide", "enum_value": "Slide", "class_name": "UMjSlideJoint", "header": "MjSlideJoint.h", "fully_emitted": true,
"extra_constructor": "bOverride_Type = true;"},
{"key": "ball", "enum_value": "Ball", "class_name": "UMjBallJoint", "header": "MjBallJoint.h", "fully_emitted": true,
"extra_constructor": "bOverride_Type = true;"},
{"key": "free", "enum_value": "Free", "class_name": "UMjFreeJoint", "header": "MjFreeJoint.h"}
]
},
"site": {
"layout": "multi_uclass",
"base_class_name": "UMjSite",
"base_class_header": "MuJoCo/Components/Geometry/MjSite.h",
"mjs_struct": "mjsSite",
"schema_common_block": "site.attrs",
"type_enum_name": "EMjSiteType",
"subtypes": [
{"key": "box", "enum_value": "Box", "class_name": "UMjBoxSite"},
{"key": "sphere", "enum_value": "Sphere", "class_name": "UMjSphereSite"},
{"key": "capsule", "enum_value": "Capsule", "class_name": "UMjCapsuleSite"},
{"key": "cylinder", "enum_value": "Cylinder", "class_name": "UMjCylinderSite"},
{"key": "ellipsoid", "enum_value": "Ellipsoid", "class_name": "UMjEllipsoidSite"}
]
},
"tendon": {
"layout": "multi_uclass",
"base_class_name": "UMjTendon",
"base_class_header": "MuJoCo/Components/Tendons/MjTendon.h",
"mjs_struct": "mjsTendon",
"schema_common_block": "tendon.spatial.attrs",
"type_enum_name": "EMjTendonType",
"subtypes": [
{"key": "spatial", "enum_value": "Spatial", "class_name": "UMjSpatialTendon"},
{"key": "fixed", "enum_value": "Fixed", "class_name": "UMjFixedTendon"}
]
},
"equality": {
"layout": "multi_uclass",
"base_class_name": "UMjEquality",
"base_class_header": "MuJoCo/Components/Constraints/MjEquality.h",
"mjs_struct": "mjsEquality",
"schema_common_block": "equality.weld",
"schema_common_extra_attrs": ["polycoef"],
"type_enum_name": "EMjEqualityType",
"_note_objtype_dispatch": "mjsEquality.objtype tells MuJoCo what kind of object name1/name2 refer to. Connect/Weld are dual-mode: site-to-site if site1 was specified, else body-to-body. Codegen emits a switch on EqualityType into the CODEGEN_OBJTYPE_DISPATCH markers in MjEquality.cpp.",
"objtype_dispatch": {
"discriminator": "EqualityType",
"target": "Element->objtype",
"default": "mjOBJ_UNKNOWN",
"cases": [
{"keys": ["Connect", "Weld"], "expr": "!site1.IsEmpty() ? mjOBJ_SITE : mjOBJ_BODY"},
{"keys": ["Joint"], "expr": "mjOBJ_JOINT"},
{"keys": ["Tendon"], "expr": "mjOBJ_TENDON"},
{"keys": ["Flex", "FlexVert", "FlexStrain"], "expr": "mjOBJ_FLEX"}
]
},
"subtypes": [
{"key": "connect", "enum_value": "Connect", "class_name": "UMjConnectEquality"},
{"key": "weld", "enum_value": "Weld", "class_name": "UMjWeldEquality"},
{"key": "joint", "enum_value": "Joint", "class_name": "UMjJointEquality"},
{"key": "tendon", "enum_value": "Tendon", "class_name": "UMjTendonEquality"},
{"key": "flex", "enum_value": "Flex", "class_name": "UMjFlexEquality"},
{"key": "flexvert", "enum_value": "FlexVert", "class_name": "UMjFlexVertEquality"},
{"key": "flexstrain", "enum_value": "FlexStrain", "class_name": "UMjFlexStrainEquality"}
]
},
"geom": {
"layout": "single_uclass_per_file",
"base_class_name": "UMjGeom",
"base_class_header": "MuJoCo/Components/Geometry/MjGeom.h",
"subclass_directory_pub": "MuJoCo/Components/Geometry/Primitives",
"subclass_directory_priv": "MuJoCo/Components/Geometry/Primitives",
"mjs_struct": "mjsGeom",
"schema_common_block": "geom.attrs",
"type_enum_name": "EMjGeomType",
"_note_geom_final_type": "Mesh-name export depends on the COMPILE-TIME geom type, which is either the UPROPERTY Type (if overridden) or the Default geom's type (otherwise). Codegen emits the resolution + the conditional mesh-name write into the CODEGEN_GEOM_FINAL_TYPE markers in MjGeom.cpp. The value_map is pulled from element_rules.geom.xml_enum_attrs.type so there's only one source of truth for the XML/UE/mj triplet.",
"geom_final_type": {
"xml_enum_ref": "type",
"override_field": "bOverride_Type",
"default_lookup": "Default->geom->type",
"default_fallback": "mjGEOM_MESH",
"name_field": "MeshName",
"name_export_for": "mjGEOM_MESH",
"name_target": "Element->meshname",
"name_setter": "MjSetStringRaw"
},
"subtypes": [
{"key": "box", "enum_value": "Box", "class_name": "UMjBox", "header": "MjBox.h"},
{"key": "sphere", "enum_value": "Sphere", "class_name": "UMjSphere", "header": "MjSphere.h"},
{"key": "capsule", "enum_value": "Capsule", "class_name": "UMjCapsule", "header": "MjCapsule.h"},
{"key": "cylinder", "enum_value": "Cylinder", "class_name": "UMjCylinder", "header": "MjCylinder.h"},
{"key": "ellipsoid", "enum_value": "Ellipsoid", "class_name": "UMjEllipsoid", "header": "MjEllipsoid.h", "fully_emitted": true},
{"key": "plane", "enum_value": "Plane", "class_name": "UMjPlane", "header": "MjPlane.h", "fully_emitted": true},
{"key": "sdf", "enum_value": "SDF", "class_name": "UMjSdf", "header": "MjSdf.h", "fully_emitted": true}
],
"_note_skipped_subtypes": ["hfield (URLab has its own hfield actor system)", "mesh (existing UMjMeshGeom)"]
},
"camera": {
"layout": "no_subclasses",
"base_class_name": "UMjCamera",
"base_class_header": "MuJoCo/Components/Sensors/MjCamera.h",
"mjs_struct": "mjsCamera",
"schema_common_block": "camera.attrs"
},
"flexcomp": {
"_note": "flexcomp doesn't register via mjs_addX — at spec time UMjFlexcomp builds a tiny standalone MJCF fragment and re-parses it via mj_parseXMLString + mjs_attach (the flexcomp macro is expanded by MuJoCo's XML parser, not the spec API). xml_passthrough_emission flips the export side from mjs writes to MJCF attribute-string writes (BuildSchemaAttrsXml), so any new schema attr flows end-to-end without a hand-edit.",
"layout": "no_subclasses",
"base_class_name": "UMjFlexcomp",
"base_class_header": "MuJoCo/Components/Deformable/MjFlexcomp.h",
"mjs_struct": "mjsFlex",
"schema_common_block": "flexcomp.attrs",
"xml_passthrough_emission": true
},
"body": {
"layout": "no_subclasses",
"base_class_name": "UMjBody",
"base_class_header": "MuJoCo/Components/Bodies/MjBody.h",
"mjs_struct": "mjsBody",
"schema_common_block": "body.attrs"
},
"frame": {
"_note": "MJCF <frame> nests inside <body>/<worldbody> and supplies a coordinate offset that the MuJoCo compiler bakes into the pos/quat of its child elements. UE-side the frame is a USceneComponent with a relative transform; MjFrame::Setup walks children and dispatches RegisterToSpec. The codegen-emitted Import populates Pos/Quat UPROPERTYs from XML — but the source of truth for placement is the UE transform (set via SetRelativeLocation/Rotation in ImportFromXml), so canon export is skipped for spatial_pose/orientation. childclass is codegen-owned (FString -> mjs_setString).",
"layout": "no_subclasses",
"base_class_name": "UMjFrame",
"base_class_header": "MuJoCo/Components/Bodies/MjFrame.h",