Add SimReady package: XDM300_10058254G1 2026.10.14_01
Browse filesFiles changed (20)
- XDM300_10058254G1/.metadata/XDM300_10058254G1_benchmark.jsonAdded+312
- XDM300_10058254G1/.metadata/XDM300_10058254G1_validation.jsonAdded+62
- XDM300_10058254G1/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.jsonAdded+35
- XDM300_10058254G1/.metadata/com.nvidia.simready.conformance.Package@1.0.0.jsonAdded+35
- XDM300_10058254G1/.metadata/com.nvidia.simready.packaging.bom.jsonAdded+175
- XDM300_10058254G1/com.nvidia.simready.packaging.json+31-6
- XDM300_10058254G1/simready_usd/.thumbs/256x256/XDM300_10058254G1_main.usd.png
- XDM300_10058254G1/simready_usd/layers/.thumbs/256x256/XDM300_10058254G1_ConnectionPoints.usd.png → XDM300_10058254G1/simready_usd/.thumbs/256x256/XDM300_10058254G1_main.usd_light.pngRenamed
- XDM300_10058254G1/simready_usd/layers/.thumbs/256x256/XDM300_10058254G1_Properties.usda.png → XDM300_10058254G1/simready_usd/.thumbs/256x256/XDM300_10058254G1_main.usd_transparent.pngRenamed
- XDM300_10058254G1/simready_usd/XDM300_10058254G1_main.usd
- XDM300_10058254G1/simready_usd/layers/XDM300_10058254G1_ConnectionPoints.usd
- XDM300_10058254G1/simready_usd/layers/XDM300_10058254G1_Properties.usda+1-3
- XDM300_10058254G1/simready_usd/layers/apply_metadata.pyDeleted-356
- XDM300_10058254G1/simready_usd/layers/excel_to_json.pyDeleted-229
- XDM300_10058254G1/simready_usd/layers/properties.xlsxDeleted
- XDM300_10058254G1/simready_usd/payloads/.thumbs/256x256/external.usd.pngDeleted
- XDM300_10058254G1/simready_usd/payloads/.thumbs/256x256/internal.usd.pngDeleted
- XDM300_10058254G1/simready_usd/payloads/external.usd+2-2
- XDM300_10058254G1/simready_usd/payloads/internal.usd+1-1
- XDM300_10058254G1/simready_usd/textures/.thumbs/256x256/vertiv_logo.usd.pngDeleted
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312{
"schema_version": "1.0",
"asset": "XDM300_10058254G1",
"run_timestamp": "2026-10-13T16:49:12Z",
"passed": true,
"results": [
{
"test_name": "culling_xz",
"engine": "isaac_sim",
"engine_version": "6.2.0.0",
"status": "pass",
"passed": true,
"duration": 37.485,
"message": "",
"metrics": {
"_timing_capture_frame_total_s": {
"value": 3.265,
"unit": null
},
"_timing_capture_frame_count": {
"value": 16,
"unit": null
},
"_timing_capture_frame_avg_ms": {
"value": 204.06,
"unit": null
},
"_timing_encode_video_total_s": {
"value": 2.11,
"unit": null
},
"_timing_encode_video_count": {
"value": 2,
"unit": null
},
"_render_blank_retry_count": {
"value": 0,
"unit": null
},
"_render_blank_retry_unrecovered": {
"value": 0,
"unit": null
},
"culling_xz_max_diff": {
"value": 8.1e-05,
"unit": null
},
"culling_xz_mean_diff": {
"value": 1e-05,
"unit": null
},
"culling_xz_worst_angle": {
"value": 135.0,
"unit": null
},
"culling_xz_passed": {
"value": 1,
"unit": null
}
},
"kit_logs": []
},
{
"test_name": "light_response",
"engine": "isaac_sim",
"engine_version": "6.2.0.0",
"status": "pass",
"passed": true,
"duration": 20.219,
"message": "",
"metrics": {
"_timing_capture_frame_total_s": {
"value": 5.689,
"unit": null
},
"_timing_capture_frame_count": {
"value": 30,
"unit": null
},
"_timing_capture_frame_avg_ms": {
"value": 189.63,
"unit": null
},
"_timing_encode_video_total_s": {
"value": 0.75,
"unit": null
},
"_timing_encode_video_count": {
"value": 1,
"unit": null
},
"_render_blank_retry_count": {
"value": 0,
"unit": null
},
"_render_blank_retry_unrecovered": {
"value": 0,
"unit": null
},
"light_response_variation_ratio": {
"value": 0.586207,
"unit": null
},
"light_response_blank_ratio": {
"value": 0.0,
"unit": null
},
"light_response_blank_frames": {
"value": 0,
"unit": null
},
"light_response_total_frames": {
"value": 30,
"unit": null
},
"light_response_total_pairs": {
"value": 29,
"unit": null
},
"light_response_different_pairs": {
"value": 17,
"unit": null
},
"light_response_passed": {
"value": 1,
"unit": null
},
"light_response_max_pair_change": {
"value": 0.725151,
"unit": null
},
"light_response_min_pair_change": {
"value": 0.002624,
"unit": null
}
},
"kit_logs": []
},
{
"test_name": "normals_xz",
"engine": "isaac_sim",
"engine_version": "6.2.0.0",
"status": "pass",
"passed": true,
"duration": 13.828,
"message": "",
"metrics": {
"_timing_capture_frame_total_s": {
"value": 1.577,
"unit": null
},
"_timing_capture_frame_count": {
"value": 8,
"unit": null
},
"_timing_capture_frame_avg_ms": {
"value": 197.12,
"unit": null
},
"_timing_encode_video_total_s": {
"value": 0.266,
"unit": null
},
"_timing_encode_video_count": {
"value": 1,
"unit": null
},
"_render_blank_retry_count": {
"value": 0,
"unit": null
},
"_render_blank_retry_unrecovered": {
"value": 0,
"unit": null
},
"normals_xz_avg_dark": {
"value": 2.4e-05,
"unit": null
},
"normals_xz_max_dark": {
"value": 0.000144,
"unit": null
},
"normals_xz_problem_frames": {
"value": 0,
"unit": null
},
"normals_xz_passed": {
"value": 1,
"unit": null
}
},
"kit_logs": []
},
{
"test_name": "pivot",
"engine": "isaac_sim",
"engine_version": "6.2.0.0",
"status": "pass",
"passed": true,
"duration": 23.266,
"message": "",
"metrics": {
"_timing_capture_frame_total_s": {
"value": 4.436,
"unit": null
},
"_timing_capture_frame_count": {
"value": 20,
"unit": null
},
"_timing_capture_frame_avg_ms": {
"value": 221.8,
"unit": null
},
"_timing_encode_video_total_s": {
"value": 0.641,
"unit": null
},
"_timing_encode_video_count": {
"value": 2,
"unit": null
},
"_render_blank_retry_count": {
"value": 0,
"unit": null
},
"_render_blank_retry_unrecovered": {
"value": 0,
"unit": null
},
"pivot_score": {
"value": 0.9,
"unit": null
},
"pivot_pivot_height_pct": {
"value": 0.0,
"unit": null
},
"pivot_pivot_at_base": {
"value": 1,
"unit": null
},
"pivot_pivot_centered_xy": {
"value": 1,
"unit": null
},
"pivot_ground_penetration": {
"value": 1,
"unit": null
},
"pivot_orbital_motion": {
"value": 0,
"unit": null
},
"pivot_passed": {
"value": 1,
"unit": null
}
},
"kit_logs": []
},
{
"test_name": "presence",
"engine": "isaac_sim",
"engine_version": "6.2.0.0",
"status": "pass",
"passed": true,
"duration": 9.406,
"message": "",
"metrics": {
"_timing_capture_frame_total_s": {
"value": 0.36,
"unit": null
},
"_timing_capture_frame_count": {
"value": 2,
"unit": null
},
"_timing_capture_frame_avg_ms": {
"value": 180.0,
"unit": null
},
"_timing_encode_video_total_s": {
"value": 0.0,
"unit": null
},
"_timing_encode_video_count": {
"value": 0,
"unit": null
},
"_render_blank_retry_count": {
"value": 0,
"unit": null
},
"_render_blank_retry_unrecovered": {
"value": 0,
"unit": null
},
"presence_diff_ratio": {
"value": 0.192917,
"unit": null
},
"presence_passed": {
"value": 1,
"unit": null
}
},
"kit_logs": []
}
]
}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162{
"simready_usd/XDM300_10058254G1_main.usd": {
"features_summary": {
"FET200_AIF": {
"blocking_failure": false,
"dependencies": "[]",
"passed": true,
"version": "0.1.0"
},
"FET201_AIF": {
"blocking_failure": false,
"dependencies": "[{'FET200_AIF': {'version': '0.1.0'}}]",
"passed": true,
"version": "0.2.0"
},
"FET202_AIF": {
"blocking_failure": false,
"dependencies": "[{'FET201_AIF': {'version': '0.2.0'}}]",
"passed": true,
"version": "0.2.0"
},
"FET203_AIF": {
"blocking_failure": false,
"dependencies": "[{'FET201_AIF': {'version': '0.2.0'}}]",
"passed": true,
"version": "0.2.0"
},
"FET_000_STANDARD": {
"blocking_failure": false,
"dependencies": "[]",
"passed": true,
"version": "0.2.0"
},
"FET_001_STANDARD": {
"blocking_failure": false,
"dependencies": "[]",
"passed": true,
"version": "1.0.0"
},
"FET_031_STANDARD": {
"blocking_failure": false,
"dependencies": "[]",
"passed": true,
"version": "0.1.0"
},
"FET_033_STANDARD": {
"blocking_failure": false,
"dependencies": "[{'FET_031_STANDARD': {'version': '0.1.0'}}]",
"passed": true,
"version": "0.4.0"
}
},
"profile_id": "AIF-Entity",
"profile_version": "0.2.0",
"simready_validate_version": "2026.8.0",
"tier_versions": {
"sensors": "2026.8.0",
"tier_aif": "2026.8.0",
"tier_core": "2026.8.0"
}
}
}1234567891011121314151617181920212223242526272829303132333435{ "format_version": "1.0", "profile": "Package-Candidate", "profile_version": "1.0.0", "timestamp": "2026-10-14T06:44:54", "assets": [ { "asset": "simready_usd/XDM300_10058254G1_main.usd", "features": [ { "FET_031_STANDARD": { "version": "0.1.0", "passed": true, "failing_requirements": [], "dependencies": [] } }, { "FET_033_STANDARD": { "version": "0.1.0", "passed": true, "failing_requirements": [], "dependencies": [ { "FET_031_STANDARD": { "version": "0.1.0" } } ] } } ] } ]}1234567891011121314151617181920212223242526272829303132333435{ "format_version": "1.0", "profile": "Package", "profile_version": "1.0.0", "timestamp": "2026-10-14T06:44:54", "assets": [ { "asset": "com.nvidia.simready.packaging.json", "features": [ { "FET_030_STANDARD": { "version": "0.1.0", "passed": true, "failing_requirements": [], "dependencies": [] } }, { "FET_032_STANDARD": { "version": "0.1.0", "passed": true, "failing_requirements": [], "dependencies": [ { "FET_030_STANDARD": { "version": "0.1.0" } } ] } } ] } ]}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175{ "format_version": "1.0", "items": [ { "relative_path": "simready_usd/.thumbs/256x256/XDM300_10058254G1_main.usd.png", "size": 543735, "hash": { "sha256-flat-1mb": "61b341b3f9960e4433928f5fb74560597b2171dd38d37fbbfa56f1fb7fd21f94", "sha256": "2033e5b8d86c1da70476cf373e939909a92b37c176e163cc44d8ac503de16103" } }, { "relative_path": "simready_usd/.thumbs/256x256/XDM300_10058254G1_main.usd_light.png", "size": 463868, "hash": { "sha256-flat-1mb": "f0393e166421c5c3eace499be18709226c065784e841917ac8eef86c8b2875e1", "sha256": "6fb9f60e338e7e4be30a7083b1451ac532c84dd3a2499d798861e418ea244ecc" } }, { "relative_path": "simready_usd/.thumbs/256x256/XDM300_10058254G1_main.usd_transparent.png", "size": 332331, "hash": { "sha256-flat-1mb": "f3357539f31d64d2a2998c8d19364c8bf388f9fa7ebc77f32606dd91143a7223", "sha256": "048c8960c1f31b3921ec6cf700b8f9fd5d86c251bb9e3d5f7aa060f6e0c34717" } }, { "relative_path": "simready_usd/XDM300_10058254G1_main.usd", "size": 9526, "hash": { "sha256-flat-1mb": "196b45ed8a66be161604a215d16afa173240e90ccf0f3a848a4217633715328b", "sha256": "61a794008447608ae377d0dcc2e8aa4451ff821b8faaa416ccddbd6963533313" } }, { "relative_path": "simready_usd/layers/XDM300_10058254G1_ConnectionPoints.usd", "size": 15003, "hash": { "sha256-flat-1mb": "5318aa520cddd3b9f062df274d8d0777e367f237616304f330abc4ff80fc4919", "sha256": "667b44fa0bf78f2f776433e5b773b6c08f207c5cfd082d132077d2ed4e4851fa" } }, { "relative_path": "simready_usd/layers/XDM300_10058254G1_Properties.json", "size": 13939, "hash": { "sha256-flat-1mb": "57a949a5adcaedf44632b4f2eac126660d4ff1de18c37106a4f29163cb7577d2", "sha256": "3500bbe1a9727716c99bc7584c38cc8432b1b45841a46316f19bfb6e2391417c" } }, { "relative_path": "simready_usd/layers/XDM300_10058254G1_Properties.usda", "size": 6307, "hash": { "sha256-flat-1mb": "b7402e3ef1a7ee53b6cf098234f513ae6dc2532521bb1ada8614f483bc9b23f2", "sha256": "03ec2734d9673fb7fc86e9250d26bc4fef2cc18946d0c11b981d7cba7587b36c" } }, { "relative_path": "simready_usd/materials/Carpaint_Solid.mdl", "size": 44585, "hash": { "sha256-flat-1mb": "26159d8a8bbbc4ea913351f189b2eb1146ab7c2e51d9a8285262ecb0ab2964d7", "sha256": "e51996b5c78df239742fcf76ed3475002328afd0c5ba7922932bca89330a3b56" } }, { "relative_path": "simready_usd/materials/Felt_Plain.mdl", "size": 48613, "hash": { "sha256-flat-1mb": "7740661e6311010d4fafe20ff08795f3ca0bfcd59c66ef96cbb9eb61b0edd57b", "sha256": "5aa846a0de66dcd112d01eed66423adfaf1add2b463e7f0a69e7704237ba7c92" } }, { "relative_path": "simready_usd/materials/OmniPBR/OmniPBR.mdl", "size": 16010, "hash": { "sha256-flat-1mb": "ecc9a58be7f4dd86920d4d9e3c7ff37b4306bc818da5074c2e184950e43a143f", "sha256": "6e6b3acbccd236e21a6c29964a431d2a53e77251cc6b8b1bc975eb1c62da1781" } }, { "relative_path": "simready_usd/materials/OmniPBR/OmniPBRBase.mdl", "size": 19369, "hash": { "sha256-flat-1mb": "001afd3ed8918a1fd8623689cf100e375bf3797f1398cb0a8a2727300e83016f", "sha256": "a8fd9fe174e91892e94d06da90ba453a124024c2ce2c033be9d82c9e2f76a3b7" } }, { "relative_path": "simready_usd/materials/OmniPBR/OmniPBR_ClearCoat.mdl", "size": 29789, "hash": { "sha256-flat-1mb": "04bcb74cc928617064a7d3978735156b0976d66d0716fc57dfa7877b8f3d9f33", "sha256": "d84c5ba482561c0eaea2e0c5b607358af549e36cd921773462f92dbc4f32cbc3" } }, { "relative_path": "simready_usd/materials/WhiteMode.mdl", "size": 998, "hash": { "sha256-flat-1mb": "c07b0292c81dd4217326e9f2c755ff2d7ff470422fa974e6e03d907a2b62cc2f", "sha256": "3bc76f53a19cada6acc1c4f9463264f0934f3dd45805cbe6af56c7b7df895b5d" } }, { "relative_path": "simready_usd/payloads/external.usd", "size": 127073454, "hash": { "sha256-flat-1mb": "70d6651689ec2c8a75544e3136a1e01291844469c02305698dabef0904661c5b", "sha256": "802700ab654175c37ee4a0637d3fe558e575a9df0c34faa62aa5307d6e09a04b", "sha256-first1m": "961e0e37475c837057555782398406916e309c67e1d9072ee39416e6fb1928ec" } }, { "relative_path": "simready_usd/payloads/internal.usd", "size": 81773498, "hash": { "sha256-flat-1mb": "32fc767e41f3598e0f2da542fa0fb0fa4ff85a8fb8c5e5c9ffa05bb73aa569d9", "sha256": "0d87bee02e73a42825bfc778fb52bb6f31fcae5b6cf6cbc1d87142d9444349ee", "sha256-first1m": "f937d5db2190d466c9e24dd4e0b35b12ac46881cfcdf5991bd6a0d9a8560f563" } }, { "relative_path": "simready_usd/textures/image_screen.png", "size": 76762, "hash": { "sha256-flat-1mb": "f7e3f54531101b9a6d2102e940af44a80967179261e2d43ac286176a82baa1d4", "sha256": "269340ffe3e264c8c352142a15b452eaa96036eb1ee00494d9ea119566ad42a8" } }, { "relative_path": "simready_usd/textures/materials/OmniPBR/OmniPBR.mdl", "size": 16010, "hash": { "sha256-flat-1mb": "ecc9a58be7f4dd86920d4d9e3c7ff37b4306bc818da5074c2e184950e43a143f", "sha256": "6e6b3acbccd236e21a6c29964a431d2a53e77251cc6b8b1bc975eb1c62da1781" } }, { "relative_path": "simready_usd/textures/materials/OmniPBR/OmniPBRBase.mdl", "size": 19369, "hash": { "sha256-flat-1mb": "001afd3ed8918a1fd8623689cf100e375bf3797f1398cb0a8a2727300e83016f", "sha256": "a8fd9fe174e91892e94d06da90ba453a124024c2ce2c033be9d82c9e2f76a3b7" } }, { "relative_path": "simready_usd/textures/materials/OmniPBR/OmniPBR_ClearCoat.mdl", "size": 29789, "hash": { "sha256-flat-1mb": "04bcb74cc928617064a7d3978735156b0976d66d0716fc57dfa7877b8f3d9f33", "sha256": "d84c5ba482561c0eaea2e0c5b607358af549e36cd921773462f92dbc4f32cbc3" } }, { "relative_path": "simready_usd/textures/ver_logo_tm_hrz_rgb_rev.png", "size": 10575, "hash": { "sha256-flat-1mb": "8e9f4fed6ad9078bd072c34f5d0e6536dab1230150eae73f65ed78e50452684d", "sha256": "12470a0a485caf4e7d3db06e5a6ae594a8e428e0d16f0a23fba23edd40f31273" } }, { "relative_path": "simready_usd/textures/vertiv_logo.usd", "size": 33175, "hash": { "sha256-flat-1mb": "8c6ebfaed3cf0de43f49c27e9b0409b8982fa240174e8a4e3a933736f86e9559", "sha256": "458efd5efe194b02ef240fef4c72c6fb229cb7b4140f1c2f944c7440101c8ec2" } } ]}123456{"format_version": "1.0","package_id": "simready.hf.Vertiv.simready-assets.XDM300_10058254G1.2026.09.25_01","license": "cc-by-4.0","metadata": []}12345678910111213141516171819202122232425262728293031{"format_version": "1.0","package_id": "simready.hf.Vertiv.simready-assets.XDM300_10058254G1.2026.10.14_01","license": "cc-by-4.0","metadata": [{"name": "com.nvidia.simready.conformance.Package-Candidate@1.0.0.json","hash": {"sha256": "3440f6b8fc9177e6a03a047a8eb17a534e5752acb8eeea3cb967fc45808851c8"}},{"name": "com.nvidia.simready.packaging.bom.json","hash": {"sha256": "09bc0b56912d7165c9acbbbcbc666921c4ae395e73e7efae402cd8afc4378c8f"}},{"name": "com.nvidia.simready.root_usds.json","hash": {"sha256": "6fde1d7f23cebdf927efe9249aa1c97f30ecd0194176a5b34e78966e05838eb9"}}],"content_hash": {"sha256": "1f6c42a4c869c64046f67f94685ac367f0d328eb54de1c3e1d50d29fac1f9b0e"},"package_hash": {"sha256": "09952f98abd32ce0ad74e493993ae88e53f60a24669407057e7db365f7dd574c"}}
37 unmodified lines38394041424344454637 unmodified linescustom uniform float3 aif:core:overallGeometryDimensions = (610, 3041, 3182) (doc = "Overall Geometry (WxDxH) in mm [AIF-MANAGED]")custom uniform float aif:core:simreadyVersion = 0.1 (doc = "SimReady asset version [AIF-MANAGED]")custom uniform int aif:core:weight = 1491 (doc = "Approximate dry weight in kg (lower plus upper module) [AIF-MANAGED]")37 unmodified lines3839404142434437 unmodified linescustom uniform float3 aif:core:overallGeometryDimensions = (610, 3041, 3182) (doc = "Overall Geometry (WxDxH) in mm [AIF-MANAGED]")custom string aif:core:simreadyVersion = "0.2.0"custom uniform int aif:core:weight = 1491 (doc = "Approximate dry weight in kg (lower plus upper module) [AIF-MANAGED]")
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356"""Apply Metadata to USD=====================
Reads a metadata JSON file, validates it, and creates a USD properties layer.The layer is written to the specified output location as a .usda file.Properties are namespaced as aif:<type>:property_name (e.g., aif:core:Manufacturer).
Usage: python apply_metadata.py --input <metadata.json> --output <properties.usda> --default_prim <prim_name> python apply_metadata.py --input core.json --output core_props.usda --default_prim Root python apply_metadata.py --input electrical.json --output elec_props.usda --default_prim Root --namespace electrical"""
import jsonimport argparseimport osfrom pxr import Usd, Sdf, Vt, Gffrom typing import Optional
def validate_metadata_json(json_data): """ Validate the metadata JSON structure. Returns (is_valid, error_message) """ if not isinstance(json_data, dict): return False, "Root JSON must be an object/dictionary" if "properties" not in json_data: return False, "Missing required 'properties' key" properties = json_data["properties"] if not isinstance(properties, dict): return False, "'properties' must be an object/dictionary" # Validate each property for prop_name, prop_config in properties.items(): if not isinstance(prop_config, dict): return False, f"Property '{prop_name}' must be an object/dictionary" if "type" not in prop_config: return False, f"Property '{prop_name}' missing required 'type' field" if "value" not in prop_config: return False, f"Property '{prop_name}' missing required 'value' field" return True, None
def get_usd_type_from_string(type_str, value): """ Convert JSON type specs to USD's strongly-typed attribute system. """ # Basic type mapping basic_type_mapping = { "string": Sdf.ValueTypeNames.String, "float": Sdf.ValueTypeNames.Float, "double": Sdf.ValueTypeNames.Double, "int": Sdf.ValueTypeNames.Int, "bool": Sdf.ValueTypeNames.Bool, "vector3f": Sdf.ValueTypeNames.Vector3f, "vector3d": Sdf.ValueTypeNames.Vector3d, "color3f": Sdf.ValueTypeNames.Color3f, "token": Sdf.ValueTypeNames.Token, "asset": Sdf.ValueTypeNames.Asset, } # 2D Array type mapping array_type_mapping = { "float2d_array": Sdf.ValueTypeNames.Float2Array, "double2d_array": Sdf.ValueTypeNames.Double2Array, "int2d_array": Sdf.ValueTypeNames.Int2Array, "string2d_array": Sdf.ValueTypeNames.StringArray, "bool2d_array": Sdf.ValueTypeNames.BoolArray, "vector3f2d_array": Sdf.ValueTypeNames.Vector3fArray, "vector3d2d_array": Sdf.ValueTypeNames.Vector3dArray, "color3f2d_array": Sdf.ValueTypeNames.Color3fArray, "color3d2d_array": Sdf.ValueTypeNames.Color3dArray, "token2d_array": Sdf.ValueTypeNames.TokenArray, "asset2d_array": Sdf.ValueTypeNames.AssetArray } # Fallback mapping for types that don't exist as 2D arrays fallback_mapping = { "float2d_array": Sdf.ValueTypeNames.FloatArray, "double2d_array": Sdf.ValueTypeNames.DoubleArray, "int2d_array": Sdf.ValueTypeNames.IntArray, "string2d_array": Sdf.ValueTypeNames.StringArray, "bool2d_array": Sdf.ValueTypeNames.BoolArray, "vector3f2d_array": Sdf.ValueTypeNames.Vector3fArray, "vector3d2d_array": Sdf.ValueTypeNames.Vector3dArray, "color3f2d_array": Sdf.ValueTypeNames.Color3fArray, "color3d2d_array": Sdf.ValueTypeNames.Color3dArray, "token2d_array": Sdf.ValueTypeNames.TokenArray, "asset2d_array": Sdf.ValueTypeNames.AssetArray } # Check basic types first if type_str.lower() in basic_type_mapping: return basic_type_mapping[type_str.lower()] # Check 2D array types with validation if type_str.lower() in array_type_mapping: usd_type = array_type_mapping[type_str.lower()] try: _ = getattr(Sdf.ValueTypeNames, usd_type.typeName) return usd_type except AttributeError: print(f"Warning: 2D array type '{type_str}' not available, using fallback") return fallback_mapping.get(type_str.lower(), Sdf.ValueTypeNames.StringArray) print(f"Warning: Unknown type '{type_str}', defaulting to String") return Sdf.ValueTypeNames.String
def make_valid_usd_attr_name(prop_name): """ Convert human-readable names to USD-compliant attribute identifiers. """ return prop_name.replace(" ", "_").replace("-", "_").replace("(", "").replace(")", "")
def convert_value_for_usd(value, usd_type): """ Transform Python data types into USD's native representation. """ # Handle 2D array types if usd_type == Sdf.ValueTypeNames.Float2Array: if isinstance(value, list) and all(isinstance(row, list) and len(row) == 2 for row in value): return Vt.Float2Array([Vt.Float2(row[0], row[1]) for row in value]) elif usd_type == Sdf.ValueTypeNames.Double2Array: if isinstance(value, list) and all(isinstance(row, list) and len(row) == 2 for row in value): return Vt.Double2Array([Vt.Double2(row[0], row[1]) for row in value]) elif usd_type == Sdf.ValueTypeNames.Int2Array: if isinstance(value, list) and all(isinstance(row, list) and len(row) == 2 for row in value): return Vt.Int2Array([Vt.Int2(row[0], row[1]) for row in value]) # Handle array fallback types elif usd_type == Sdf.ValueTypeNames.FloatArray: if isinstance(value, list) and all(isinstance(row, list) for row in value): flattened = [item for row in value for item in row] return Vt.FloatArray(flattened) elif isinstance(value, list): return Vt.FloatArray(value) elif usd_type == Sdf.ValueTypeNames.DoubleArray: if isinstance(value, list) and all(isinstance(row, list) for row in value): flattened = [item for row in value for item in row] return Vt.DoubleArray(flattened) elif isinstance(value, list): return Vt.DoubleArray(value) elif usd_type == Sdf.ValueTypeNames.IntArray: if isinstance(value, list) and all(isinstance(row, list) for row in value): flattened = [item for row in value for item in row] return Vt.IntArray(flattened) elif isinstance(value, list): return Vt.IntArray(value) # Handle single value types elif usd_type == Sdf.ValueTypeNames.Vector3f: if isinstance(value, list) and len(value) == 3: return Gf.Vec3f(value[0], value[1], value[2]) elif usd_type == Sdf.ValueTypeNames.Color3f: if isinstance(value, list) and len(value) == 3: return Gf.Vec3f(value[0], value[1], value[2]) elif usd_type == Sdf.ValueTypeNames.Asset: return Sdf.AssetPath(str(value)) return value
def create_properties_layer(metadata_config, output_path, default_prim_name): """ Create isolated USD layer containing only custom properties. """ print(f"Creating properties layer: {output_path}") # Create new USD layer layer = Sdf.Layer.CreateNew(output_path) if not layer: raise RuntimeError(f"Failed to create layer at: {output_path}") # Create stage from layer stage = Usd.Stage.Open(layer) # Create default prim - handle both with and without leading slash if default_prim_name.startswith('/'): default_prim_path = default_prim_name else: default_prim_path = f"/{default_prim_name}" default_prim = stage.OverridePrim(default_prim_path) print(f" Created default prim: {default_prim_path}") stage.SetDefaultPrim(default_prim) # Set edit target properties_layer = stage.GetRootLayer() stage.SetEditTarget(properties_layer) print(f" Set authoring layer to: {properties_layer.identifier}") print(f" Adding properties to: {default_prim_path}") # Get namespace from metadata or override metadata = metadata_config.get("metadata", {}) base_namespace = metadata.get("namespace", "aif") template_type = metadata.get("template_type", "custom") print(f" Base namespace: {base_namespace}") # Add custom properties properties = metadata_config.get("properties", {}) for prop_name, prop_config in properties.items(): prop_type = prop_config.get("type", "string") prop_value = prop_config.get("value") prop_description = prop_config.get("description", "") # Get USD type usd_type = get_usd_type_from_string(prop_type, prop_value) # Convert value if needed converted_value = convert_value_for_usd(prop_value, usd_type) # If property name already contains namespace (has colons), use it as-is # Otherwise, construct namespace using template_type if ":" in prop_name: # Property already has namespace (e.g., "aif:core:manufacturer") attr_name = make_valid_usd_attr_name(prop_name) valid_prop_name = prop_name else: # Property needs namespace prefix (e.g., "manufacturer" -> "aif:custom:manufacturer") valid_prop_name = make_valid_usd_attr_name(prop_name) attr_name = f"{base_namespace}:{template_type}:{valid_prop_name}" if prop_name != valid_prop_name: print(f" Converted property name: '{prop_name}' -> '{valid_prop_name}'") # Create typed attribute attr = default_prim.CreateAttribute(attr_name, usd_type) attr.Set(converted_value) print(f" Created: {attr_name} = {converted_value} ({prop_type})") # Add documentation managed_doc = f"{prop_description} [AIF-MANAGED]" if prop_description else "[AIF-MANAGED]" attr.SetDocumentation(managed_doc) # Lock property in UI using customData custom_data = { 'omni': { 'kit': { 'locked': True } } } attr.SetCustomData(custom_data) print(f" Locked property: {attr_name}") # Add layer metadata metadata = metadata_config.get("metadata", {}) if metadata: root_layer = stage.GetRootLayer() for key, value in metadata.items(): root_layer.customLayerData[key] = value # Save the layer stage.Save() print(f" Created and saved properties layer: {output_path}") return output_path
def main(): """Apply metadata from JSON to create USD properties layer.""" parser = argparse.ArgumentParser( description="Apply metadata from JSON to create a USD properties layer", formatter_class=argparse.RawDescriptionHelpFormatter ) parser.add_argument( "--input", required=True, help="Input metadata.json file path" ) parser.add_argument( "--output", required=True, help="Output .usda properties layer file path" ) parser.add_argument( "--default_prim", required=True, help="Name of the default prim to create (e.g., 'Root', 'Asset')" ) parser.add_argument( "--namespace", required=False, help="Optional namespace override (e.g., 'core', 'electrical'). If not specified, uses template_type from metadata." ) args = parser.parse_args() print("=== Applying Metadata to USD ===") print(f"Input JSON: {args.input}") print(f"Output USDA: {args.output}") print(f"Default Prim: {args.default_prim}") if args.namespace: print(f"Namespace Override: {args.namespace}") # Validate input file exists if not os.path.exists(args.input): print(f"X Error: Input file does not exist: {args.input}") return 1 # Load and validate JSON print("\nLoading metadata JSON...") try: with open(args.input, 'r') as f: metadata_config = json.load(f) except json.JSONDecodeError as e: print(f"X Error: Invalid JSON in input file: {e}") return 1 print("Validating metadata structure...") is_valid, error_msg = validate_metadata_json(metadata_config) if not is_valid: print(f"X Error: Invalid metadata structure: {error_msg}") return 1 print("OK Metadata validated successfully") print(f" Properties: {len(metadata_config['properties'])}") # Apply namespace override if provided if args.namespace: if "metadata" not in metadata_config: metadata_config["metadata"] = {} metadata_config["metadata"]["template_type"] = args.namespace print(f" Namespace overridden to: {args.namespace}") # Create output directory if needed output_dir = os.path.dirname(args.output) if output_dir and not os.path.exists(output_dir): os.makedirs(output_dir) print(f"Created output directory: {output_dir}") # Create properties layer print("\nCreating USD properties layer...") try: create_properties_layer(metadata_config, args.output, args.default_prim) print(f"\nOK Successfully created properties layer: {args.output}") return 0 except Exception as e: print(f"\nX Error creating properties layer: {e}") return 1
if __name__ == "__main__": exit(main())
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
import json
import os
from openpyxl import load_workbook
def convert_value_from_string(value_str, value_type):
"""
Convert string values from Excel to appropriate Python types.
Args:
value_str: String value from Excel
value_type: Target type (string, int, float, bool, etc.)
Returns:
Converted value in appropriate Python type
"""
if value_str is None or value_str == "":
return ""
value_type_lower = value_type.lower().strip()
try:
if value_type_lower == "int":
return int(float(value_str)) # Handle cases like "123.0"
elif value_type_lower == "float" or value_type_lower == "double":
return float(value_str)
elif value_type_lower == "bool":
if isinstance(value_str, bool):
return value_str
value_str_lower = str(value_str).lower().strip()
return value_str_lower in ["true", "1", "yes"]
elif value_type_lower in ["vector3f", "vector3d", "color3f"]:
# Handle vector types - expect format like "[1.0, 2.0, 3.0]" or "1.0, 2.0, 3.0"
if isinstance(value_str, str):
# Remove brackets and split
clean_str = value_str.strip().strip("[]()").strip()
values = [float(x.strip()) for x in clean_str.split(",")]
if len(values) == 3:
return values
else:
print(f"Warning: Vector type expects 3 values, got {len(values)}. Using as string.")
return str(value_str)
return str(value_str)
else:
# Default to string
return str(value_str)
except Exception as e:
print(f"Warning: Could not convert '{value_str}' to type '{value_type}': {e}")
print(f"Using original value as string.")
return str(value_str)
def create_json_from_excel(excel_path, json_path=None):
"""
Create a properties.json file from an Excel file.
Args:
excel_path: Path to the Excel file
json_path: Optional output path for JSON file (defaults to same directory as Excel)
Returns:
Path to created JSON file or None if failed
"""
print(f"Loading Excel file: {excel_path}")
try:
# Load workbook
wb = load_workbook(excel_path, data_only=True)
# Get Properties sheet
if "Properties" in wb.sheetnames:
ws = wb["Properties"]
else:
# Use active sheet if Properties sheet doesn't exist
ws = wb.active
print(f"Warning: 'Properties' sheet not found, using active sheet: {ws.title}")
except Exception as e:
print(f"Error: Failed to load Excel file: {e}")
return None
# Determine output path
if json_path is None:
excel_dir = os.path.dirname(os.path.abspath(excel_path))
json_path = os.path.join(excel_dir, "properties.json")
print(f"Creating JSON file: {json_path}")
# Read headers to find column positions
headers = {}
for col_num in range(1, ws.max_column + 1):
cell_value = ws.cell(row=1, column=col_num).value
if cell_value:
headers[cell_value.strip().lower()] = col_num
print(f"Found columns: {list(headers.keys())}")
# Verify required columns exist
required_columns = ["key", "type", "value", "description"]
missing_columns = [col for col in required_columns if col not in headers]
if missing_columns:
print(f"Error: Missing required columns: {missing_columns}")
print(f"Available columns: {list(headers.keys())}")
return None
# Get column indices
key_col = headers["key"]
type_col = headers["type"]
value_col = headers["value"]
desc_col = headers["description"]
# Build properties dictionary
properties = {}
row_count = 0
for row_num in range(2, ws.max_row + 1):
key = ws.cell(row=row_num, column=key_col).value
# Skip empty rows
if not key:
continue
key = str(key).strip()
prop_type = ws.cell(row=row_num, column=type_col).value
prop_value = ws.cell(row=row_num, column=value_col).value
prop_description = ws.cell(row=row_num, column=desc_col).value
# Set defaults for missing values
if not prop_type:
prop_type = "string"
print(f"Warning: No type specified for '{key}', defaulting to 'string'")
if prop_value is None:
prop_value = ""
if not prop_description:
prop_description = ""
# Convert value to appropriate type
converted_value = convert_value_from_string(prop_value, prop_type)
# Add to properties dictionary
properties[key] = {
"type": str(prop_type).strip(),
"value": converted_value,
"description": str(prop_description).strip()
}
row_count += 1
print(f"Processed {row_count} properties")
# Load metadata if Metadata sheet exists
metadata = {}
if "Metadata" in wb.sheetnames:
ws_meta = wb["Metadata"]
print("Loading metadata from Metadata sheet...")
for row_num in range(2, ws_meta.max_row + 1):
meta_key = ws_meta.cell(row=row_num, column=1).value
meta_value = ws_meta.cell(row=row_num, column=2).value
if meta_key:
metadata[str(meta_key).strip()] = str(meta_value).strip() if meta_value else ""
else:
# Use default metadata
metadata = {
"description": "AIF properties for USD equipment models",
"version": "1.0",
"created": "2025-12-02"
}
print("No Metadata sheet found, using default metadata")
# Create final JSON structure
json_data = {
"properties": properties,
"metadata": metadata
}
# Save JSON file
try:
with open(json_path, 'w', encoding='utf-8') as f:
json.dump(json_data, f, indent=2, ensure_ascii=False)
print(f"JSON file created successfully: {json_path}")
print(f"Total properties: {len(properties)}")
print(f"Metadata entries: {len(metadata)}")
return json_path
except Exception as e:
print(f"Error: Failed to save JSON file: {e}")
return None
if __name__ == "__main__":
# Get the directory where this script is located
script_dir = os.path.dirname(os.path.abspath(__file__))
# Excel file is in the same directory as this script
excel_path = os.path.join(script_dir, "properties.xlsx")
# Check if Excel file exists
if not os.path.exists(excel_path):
print(f"Error: Excel file not found at {excel_path}")
print("Please ensure properties.xlsx is in the same directory as this script.")
print(f"\nScript directory: {script_dir}")
print("\nLooking for Excel files in current directory...")
# Try to find any Excel files in the directory
excel_files = [f for f in os.listdir(script_dir) if f.endswith(('.xlsx', '.xls'))]
if excel_files:
print(f"Found Excel files: {excel_files}")
print(f"Please rename one of these to 'properties.xlsx' or update the script.")
else:
print("No Excel files found in the current directory.")
else:
# Create JSON file (will save to same directory as Excel)
json_path = create_json_from_excel(excel_path)
if json_path:
print(f"\n=== Conversion Complete ===")
print(f"Input: {excel_path}")
print(f"Output: {json_path}")
print(f"\nYou can now use this properties.json file with the USD property scripts.")
else:
print("\n=== Conversion Failed ===")
print("Please check the error messages above and ensure:")
print("1. Excel file has 'Key', 'Type', 'Value', and 'Description' columns")
print("2. Excel file is not open in another program")
print("3. You have write permissions in the directory")123version https://git-lfs.github.com/spec/v1oid sha256:f21be6a61f947dc637fa47177c1d4729b67c0c9ee89be997fe64a6f9aeed3c97size 127069994123version https://git-lfs.github.com/spec/v1oid sha256:802700ab654175c37ee4a0637d3fe558e575a9df0c34faa62aa5307d6e09a04bsize 127073454
123version https://git-lfs.github.com/spec/v1oid sha256:cddd7f9ccb9f35864c2a684ea0232b2ddd1c88e7bde608ec79391943a123fc2bsize 81773498123version https://git-lfs.github.com/spec/v1oid sha256:0d87bee02e73a42825bfc778fb52bb6f31fcae5b6cf6cbc1d87142d9444349eesize 81773498
XDM300_10058254G1/.metadata/XDM300_10058254G1_benchmark.jsonAdded+312
XDM300_10058254G1/.metadata/XDM300_10058254G1_validation.jsonAdded+62
XDM300_10058254G1/.metadata/com.nvidia.simready.conformance.Package-Candidate@1.0.0.jsonAdded+35
XDM300_10058254G1/.metadata/com.nvidia.simready.conformance.Package@1.0.0.jsonAdded+35
XDM300_10058254G1/.metadata/com.nvidia.simready.packaging.bom.jsonAdded+175
XDM300_10058254G1/com.nvidia.simready.packaging.json+31-6
XDM300_10058254G1/simready_usd/.thumbs/256x256/XDM300_10058254G1_main.usd.png
Large File Pointer Details
- SHA256: f207457d3a28a1e14c1c94b443fc9c90c23a19e2474030d64adfcb56576088d2
- Pointer size: 129 Bytes
- Size of remote file: 3.03 kB
Large File Pointer Details
- SHA256: 2033e5b8d86c1da70476cf373e939909a92b37c176e163cc44d8ac503de16103
- Pointer size: 131 Bytes
- Size of remote file: 544 kB
XDM300_10058254G1/simready_usd/layers/.thumbs/256x256/XDM300_10058254G1_ConnectionPoints.usd.png → XDM300_10058254G1/simready_usd/.thumbs/256x256/XDM300_10058254G1_main.usd_light.pngRenamed
Large File Pointer Details
- SHA256: f207457d3a28a1e14c1c94b443fc9c90c23a19e2474030d64adfcb56576088d2
- Pointer size: 129 Bytes
- Size of remote file: 3.03 kB
Large File Pointer Details
- SHA256: 6fb9f60e338e7e4be30a7083b1451ac532c84dd3a2499d798861e418ea244ecc
- Pointer size: 131 Bytes
- Size of remote file: 464 kB
XDM300_10058254G1/simready_usd/layers/.thumbs/256x256/XDM300_10058254G1_Properties.usda.png → XDM300_10058254G1/simready_usd/.thumbs/256x256/XDM300_10058254G1_main.usd_transparent.pngRenamed
Large File Pointer Details
- SHA256: f207457d3a28a1e14c1c94b443fc9c90c23a19e2474030d64adfcb56576088d2
- Pointer size: 129 Bytes
- Size of remote file: 3.03 kB
Large File Pointer Details
- SHA256: 048c8960c1f31b3921ec6cf700b8f9fd5d86c251bb9e3d5f7aa060f6e0c34717
- Pointer size: 131 Bytes
- Size of remote file: 332 kB
XDM300_10058254G1/simready_usd/XDM300_10058254G1_main.usd
XDM300_10058254G1/simready_usd/layers/XDM300_10058254G1_ConnectionPoints.usd
XDM300_10058254G1/simready_usd/layers/XDM300_10058254G1_Properties.usda+1-3
XDM300_10058254G1/simready_usd/layers/apply_metadata.pyDeleted-356
XDM300_10058254G1/simready_usd/layers/excel_to_json.pyDeleted-229
XDM300_10058254G1/simready_usd/layers/properties.xlsxDeleted
XDM300_10058254G1/simready_usd/payloads/.thumbs/256x256/external.usd.pngDeleted
Large File Pointer Details
- SHA256: f207457d3a28a1e14c1c94b443fc9c90c23a19e2474030d64adfcb56576088d2
- Pointer size: 129 Bytes
- Size of remote file: 3.03 kB
XDM300_10058254G1/simready_usd/payloads/.thumbs/256x256/internal.usd.pngDeleted
Large File Pointer Details
- SHA256: f207457d3a28a1e14c1c94b443fc9c90c23a19e2474030d64adfcb56576088d2
- Pointer size: 129 Bytes
- Size of remote file: 3.03 kB
XDM300_10058254G1/simready_usd/payloads/external.usd+2-2
XDM300_10058254G1/simready_usd/payloads/internal.usd+1-1
XDM300_10058254G1/simready_usd/textures/.thumbs/256x256/vertiv_logo.usd.pngDeleted
Large File Pointer Details
- SHA256: f207457d3a28a1e14c1c94b443fc9c90c23a19e2474030d64adfcb56576088d2
- Pointer size: 129 Bytes
- Size of remote file: 3.03 kB