file_path
stringlengths
21
224
content
stringlengths
0
80.8M
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/core/service/resources/Blender/UMMLibrary/Target/Principled Omni Glass.json
{ "_header": { "_module": "omni.universalmaterialmap.core.data", "_class_name": "Target" }, "_content": { "_id": "6f24859c-7a05-46b0-8101-c9e821a95773", "_inputs": [], "_outputs": [], "_display_name": "Principled Omni Glass", "_position": null, "_expansion_state": 0, "_show_inputs": true, "_show_outputs": true, "_show_peripheral": false, "_nodes": [ { "_id": "0f41da46-a4ce-4c55-8773-f8d5d3f2206b", "_inputs": [], "_outputs": [], "_class_name": "Principled Omni Glass" }, { "_id": "Frame", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" }, { "_id": "Frame.004", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" }, { "_id": "Frame.003", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" }, { "_id": "Frame.001", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" }, { "_id": "Frame.002", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" }, { "_id": "Frame.005", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" }, { "_id": "Material Output", "_inputs": [], "_outputs": [], "_class_name": "ShaderNodeOutputMaterial" }, { "_id": "UV Map", "_inputs": [], "_outputs": [], "_class_name": "ShaderNodeUVMap" }, { "_id": "Base Mapping", "_inputs": [ { "_id": "a65a5c59-3b2a-438b-b8f0-da785647667b", "_name": "Rotation", "_display_name": "Texture Rotate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] }, { "_id": "9808b227-ddc8-4c6a-bec7-6268707c99cf", "_name": "Scale", "_display_name": "Texture Scale", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "2c14160d-35fb-4883-ac1f-8de6f5d8dd5b", "_name": "Location", "_display_name": "Texture Translate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] } ], "_outputs": [ { "_id": "b5fb653a-d5ce-43bb-b25b-166cb957e0f3", "_name": "Rotation", "_display_name": "Texture Rotate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] }, { "_id": "716aeb91-8a35-451f-8014-4136b12a340c", "_name": "Scale", "_display_name": "Texture Scale", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "9e1b7060-92f9-42f6-ad82-f1db0601e68a", "_name": "Location", "_display_name": "Texture Translate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] } ], "_class_name": "ShaderNodeMapping" }, { "_id": "Glass Color Texture", "_inputs": [ { "_id": "5bbef826-b6ab-418d-b17d-6ff22a41ebb2", "_name": "image", "_display_name": "Glass Color Texture", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "63984f84-2788-430a-b45f-271b8fb5469b", "_name": "image", "_display_name": "Glass Color Texture", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Reflection Color Texture", "_inputs": [ { "_id": "6a7e3518-5941-4462-a270-db469617e2e7", "_name": "image", "_display_name": "Reflection Color Texture", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "1de0097a-d427-49dc-9977-3d0dd58a131b", "_name": "image", "_display_name": "Reflection Color Texture", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Roughness Texture", "_inputs": [ { "_id": "addc0a18-c5cf-4d5a-b7c9-deb51e750604", "_name": "image", "_display_name": "Roughness Texture", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "451fef73-35ca-4721-8786-aa0f6fbe1d7a", "_name": "image", "_display_name": "Roughness Texture", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Normal Map", "_inputs": [ { "_id": "1dd47f1d-bb93-40b0-ada3-1f6ab834ee4c", "_name": "image", "_display_name": "Normal Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "5ae7c295-a1f6-4711-93af-aeb9b7fb3497", "_name": "image", "_display_name": "Normal Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Opacity Map", "_inputs": [ { "_id": "c44513db-c8df-4940-8677-c7ccce275cae", "_name": "image", "_display_name": "Opacity Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "cde02b50-7b3d-47fd-aedf-8bb6846c3002", "_name": "image", "_display_name": "Opacity Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "OmniGlass Compute", "_inputs": [ { "_id": "835f72fb-85d8-4539-8558-69cfb1551dc2", "_name": "Glass Color", "_display_name": "Glass Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "6017786d-a54d-420f-95f1-945aaff9af74", "_name": "Use Glass Color Texture", "_display_name": "Use Glass Color Texture", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1, "_value": 1, "_enum_values": [] }, { "_id": "7d8a1959-8803-4922-9127-70fb48f86454", "_name": "Volume Absorbtion Scale", "_display_name": "Volume Absorbtion Scale", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0010000000474974513, "_value": 0.0010000000474974513, "_enum_values": [] }, { "_id": "05f45b49-c8ca-4eb6-a4b0-f07437280505", "_name": "Glass Roughness", "_display_name": "Glass Roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "6ac305ce-bb3a-47be-b72a-50cda725f6af", "_name": "Roughness Texture Influence", "_display_name": "Roughness Texture Influence", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "c3a8b2db-d87e-43d5-ade8-daa39bcdfbc5", "_name": "Glass IOR", "_display_name": "Glass IOR", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1.4910000562667847, "_value": 1.4910000562667847, "_enum_values": [] }, { "_id": "261bf041-4c70-4ada-b39d-fdee6c1ae7cf", "_name": "Thin Walled", "_display_name": "Thin Walled", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "b6943940-3845-4b79-ad79-fbc70cdb8209", "_name": "Reflection Color", "_display_name": "Reflection Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "cc6f122e-a40c-449a-9286-210d5591d5cd", "_name": "Normal Map Strength", "_display_name": "Normal Map Strength", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1.0, "_value": 1.0, "_enum_values": [] }, { "_id": "df5c3da3-33b5-4921-a72b-0d322341aebe", "_name": "Enable Opacity", "_display_name": "Enable Opacity", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "b43912f3-d364-44bc-a744-c547093e1880", "_name": "Opacity Amount", "_display_name": "Opacity Amount", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1.0, "_value": 1.0, "_enum_values": [] }, { "_id": "64d728ea-c9a2-4abe-ae48-0c29ce652bf7", "_name": "Opacity Threshold", "_display_name": "Opacity Threshold", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "6b073dee-9e26-4973-bc6a-0e69fe23a078", "_name": "Opacity Mono Source", "_display_name": "Opacity Mono Source", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1, "_value": 1, "_enum_values": [] }, { "_id": "3d832a8e-63a1-4497-9b71-2df571eba0c5", "_name": "Enable Project UVW Coordinates", "_display_name": "Enable Project UVW Coordinates", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "c24e1e0f-8ce5-4922-ad9f-ae5f8a5bf043", "_name": "Enable World Space", "_display_name": "Enable World Space", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "835e81bc-624b-413a-8635-bba94be89711", "_name": "UV Space Index", "_display_name": "UV Space Index", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "6cd3c0d1-0fd7-4b56-9624-af3d9fe2474a", "_name": "Absorbtion Coeff", "_display_name": "Absorbtion Coeff", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0, 1.0 ], "_value": [ 0.0, 0.0, 0.0, 1.0 ], "_enum_values": [] }, { "_id": "94f11e0f-4db2-4b15-9c4c-912393e81a03", "_name": "Normal Map Flip U Tangent", "_display_name": "Normal Map Flip U Tangent", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "181a2206-aa30-4b46-96c5-235a3f03f968", "_name": "Normal Map Flip V Tangent", "_display_name": "Normal Map Flip V Tangent", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1, "_value": 1, "_enum_values": [] } ], "_outputs": [ { "_id": "f3d5be79-5854-45b1-9985-9b1d22f24431", "_name": "Glass Color", "_display_name": "Glass Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "219e550f-7583-4065-928e-75bba3aa344c", "_name": "Use Glass Color Texture", "_display_name": "Use Glass Color Texture", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1, "_value": 1, "_enum_values": [] }, { "_id": "296447d6-391d-4252-885f-624ecc6f83ea", "_name": "Volume Absorbtion Scale", "_display_name": "Volume Absorbtion Scale", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0010000000474974513, "_value": 0.0010000000474974513, "_enum_values": [] }, { "_id": "704b296e-b6d2-4887-b122-c966e8ac09fa", "_name": "Glass Roughness", "_display_name": "Glass Roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "db647ff5-aadd-4c70-a6f8-1a9852760397", "_name": "Roughness Texture Influence", "_display_name": "Roughness Texture Influence", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "db04cc3d-9712-4cc1-b3d6-208741fcaebc", "_name": "Glass IOR", "_display_name": "Glass IOR", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1.4910000562667847, "_value": 1.4910000562667847, "_enum_values": [] }, { "_id": "04bfa9e4-858c-428c-b9bb-2e63b3fbee96", "_name": "Thin Walled", "_display_name": "Thin Walled", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "5ff64634-4fa8-495f-8d0b-d4f8cb18b0b7", "_name": "Reflection Color", "_display_name": "Reflection Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "05acd1f7-c874-4847-ac7e-c7c31aa4e254", "_name": "Normal Map Strength", "_display_name": "Normal Map Strength", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1.0, "_value": 1.0, "_enum_values": [] }, { "_id": "a8545b79-b6b1-406e-9c1e-9540346d0df3", "_name": "Enable Opacity", "_display_name": "Enable Opacity", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "cfa8adcf-5504-4bd5-a452-d6767d332697", "_name": "Opacity Amount", "_display_name": "Opacity Amount", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1.0, "_value": 1.0, "_enum_values": [] }, { "_id": "76f5f342-2d9c-49c5-ad54-4cb23e89f833", "_name": "Opacity Threshold", "_display_name": "Opacity Threshold", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "310386ff-7e0f-40d4-81e8-da88abe6a8fb", "_name": "Opacity Mono Source", "_display_name": "Opacity Mono Source", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1, "_value": 1, "_enum_values": [] }, { "_id": "59bfc1a9-1486-429a-ad74-05c48ae6961c", "_name": "Enable Project UVW Coordinates", "_display_name": "Enable Project UVW Coordinates", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "d260ab7e-d335-40e4-8069-10b0fed2ded2", "_name": "Enable World Space", "_display_name": "Enable World Space", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "09a551a0-c6f2-4fe0-ad1d-0bb3744047a4", "_name": "UV Space Index", "_display_name": "UV Space Index", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "97aa0f87-dfcc-48dc-b6a2-2334f3af2c9f", "_name": "Absorbtion Coeff", "_display_name": "Absorbtion Coeff", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0, 1.0 ], "_value": [ 0.0, 0.0, 0.0, 1.0 ], "_enum_values": [] }, { "_id": "625f222b-36b0-467a-8c59-6b38a813dc02", "_name": "Normal Map Flip U Tangent", "_display_name": "Normal Map Flip U Tangent", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "ccd76123-0caa-4d2c-8ce3-4d144723305a", "_name": "Normal Map Flip V Tangent", "_display_name": "Normal Map Flip V Tangent", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1, "_value": 1, "_enum_values": [] } ], "_class_name": "ShaderNodeGroup" }, { "_id": "Principled BSDF", "_inputs": [], "_outputs": [], "_class_name": "ShaderNodeBsdfPrincipled" } ], "_metadata": { "_category": "Connector Materials", "_name": "", "_keywords": [ "Blender", "Principled Omni Glass", "Principled Omni Glass" ], "_supported_clients": [ { "_name": "Blender", "_version": "any" } ] }, "_root_node_id": "0f41da46-a4ce-4c55-8773-f8d5d3f2206b", "_revision": 4, "_connections": [] } }
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/core/service/resources/Blender/UMMLibrary/Target/Principled Omni PBR.json
{ "_header": { "_module": "omni.universalmaterialmap.core.data", "_class_name": "Target" }, "_content": { "_id": "6f1b2df1-ff10-4461-b93d-1a6f9497b15d", "_inputs": [], "_outputs": [], "_display_name": "Principled Omni PBR", "_position": null, "_expansion_state": 0, "_show_inputs": true, "_show_outputs": true, "_show_peripheral": false, "_nodes": [ { "_id": "c7bd6124-2e74-493e-9448-d5e046e42cd6", "_inputs": [], "_outputs": [], "_class_name": "Principled Omni PBR" }, { "_id": "Albedo Map", "_inputs": [ { "_id": "7bc70f7b-21a2-450e-bd8c-26aedee1fef8", "_name": "image", "_display_name": "Albedo Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "fd217f64-2aff-44ec-bcf3-a2012c04f453", "_name": "image", "_display_name": "Albedo Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "ORM Map", "_inputs": [ { "_id": "1bf6fefa-f969-424b-aabd-3b9194d8a477", "_name": "image", "_display_name": "ORM Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "cba9e245-12df-43c3-9bf9-1fccfe90a832", "_name": "image", "_display_name": "ORM Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "AO Map", "_inputs": [ { "_id": "c9a8661e-e2cd-45b4-95fa-f61bd02a8e1b", "_name": "image", "_display_name": "AO Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "92fa3344-dffa-47dd-86e6-6e11d2e2cc35", "_name": "image", "_display_name": "AO Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Metallic Map", "_inputs": [ { "_id": "59c95354-7294-4ce2-8a62-09e7b0a4b0a9", "_name": "image", "_display_name": "Metallic Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "9572f1fd-13d5-4155-abf9-efbdd55a467c", "_name": "image", "_display_name": "Metallic Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Roughness Map", "_inputs": [ { "_id": "02f2d4c0-3ffc-4b1d-a8d8-07f01c42cff0", "_name": "image", "_display_name": "Roughness Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "4c756497-c71e-4d04-82a5-b5a782d509ab", "_name": "image", "_display_name": "Roughness Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Principled BSDF", "_inputs": [ { "_id": "56cc72f9-171b-4469-a6b4-21d2bf27d399", "_name": "Transmission", "_display_name": "Transmission", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "ec90c9bb-5421-405b-991f-607bc125b770", "_name": "IOR", "_display_name": "IOR", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1.4500000476837158, "_value": 1.4500000476837158, "_enum_values": [] } ], "_outputs": [ { "_id": "2676ed22-0d16-49e4-aac4-d68552b1cd70", "_name": "Transmission", "_display_name": "Transmission", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "4a9cb63a-cb5a-40e2-a871-0faae8935910", "_name": "IOR", "_display_name": "IOR", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1.4500000476837158, "_value": 1.4500000476837158, "_enum_values": [] } ], "_class_name": "ShaderNodeBsdfPrincipled" }, { "_id": "Emissive Map", "_inputs": [ { "_id": "e08cd19b-7ce5-4ee6-9bea-5552dddc46e4", "_name": "image", "_display_name": "Emissive Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "c3e92225-fe0c-4743-a627-3f5a0ad57870", "_name": "image", "_display_name": "Emissive Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Normal Map.001", "_inputs": [], "_outputs": [], "_class_name": "ShaderNodeTexImage" }, { "_id": "Normal Map", "_inputs": [ { "_id": "8c6d4085-26a1-4a4e-a297-c9824d5d4377", "_name": "image", "_display_name": "Normal Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "4413610f-d048-4ed5-b399-e59099b4a442", "_name": "image", "_display_name": "Normal Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Detail Mapping", "_inputs": [ { "_id": "5c097c0c-c521-4d4e-8208-3d0aa6d65d09", "_name": "Rotation", "_display_name": "Detail Texture Rotate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] }, { "_id": "391386f1-7b60-4fc8-ace4-8e6a19e5b591", "_name": "Scale", "_display_name": "Detail Texture Scale", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "5a33f391-dfd5-426a-9daf-a540803d52d6", "_name": "Location", "_display_name": "Detail Texture Translate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] } ], "_outputs": [ { "_id": "cdcd92a3-306d-457c-ba1e-edd1d0bf20ac", "_name": "Rotation", "_display_name": "Detail Texture Rotate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] }, { "_id": "b8b13c5f-daac-4d9f-aac2-9cc1736580ac", "_name": "Scale", "_display_name": "Detail Texture Scale", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "2ef6f801-2379-4b16-aa4d-dec03ab73b6b", "_name": "Location", "_display_name": "Detail Texture Translate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] } ], "_class_name": "ShaderNodeMapping" }, { "_id": "Base Mapping", "_inputs": [ { "_id": "b2fd7847-7450-4713-af3b-e680ccac7764", "_name": "Rotation", "_display_name": "Texture Rotate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] }, { "_id": "14778cfd-92c0-443a-9fcf-73ae58e325f7", "_name": "Scale", "_display_name": "Texture Scale", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "cb7a2081-d8d5-4307-9aa2-b71b71af5725", "_name": "Location", "_display_name": "Texture Translate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] } ], "_outputs": [ { "_id": "286a6e8d-cbf1-4bda-9b53-0bcfe71a44a8", "_name": "Rotation", "_display_name": "Texture Rotate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] }, { "_id": "951bb09a-d43d-4476-91b3-edf225cab8c5", "_name": "Scale", "_display_name": "Texture Scale", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "4f92f52c-5678-4665-a814-3af4e20c6b8e", "_name": "Location", "_display_name": "Texture Translate", "_value_type": "list", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ], "_enum_values": [] } ], "_class_name": "ShaderNodeMapping" }, { "_id": "UV Map", "_inputs": [], "_outputs": [], "_class_name": "ShaderNodeUVMap" }, { "_id": "OmniPBR Compute", "_inputs": [ { "_id": "27327169-f7a4-4b77-9610-87125d222c10", "_name": "Albedo Add", "_display_name": "Albedo Add", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "040f2285-1b8d-4397-8e58-b33d6f685219", "_name": "Albedo Brightness", "_display_name": "Albedo Brightness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1.0, "_value": 1.0, "_enum_values": [] }, { "_id": "e02740de-8a71-4e09-b566-2d9bc5ea0f70", "_name": "Albedo Desaturation", "_display_name": "Albedo Desaturation", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "baa65222-18d9-4506-86e4-5405cd5be172", "_name": "AO to Diffuse", "_display_name": "AO to Diffuse", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "631a737b-c8e2-4a35-9fb2-a10434d53f26", "_name": "Normal Map Strength", "_display_name": "Normal Map Strength", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1.0, "_value": 1.0, "_enum_values": [] }, { "_id": "6f95ecea-7691-4ed8-9e7f-1855ba25cfaa", "_name": "Detail Normal Strength", "_display_name": "Detail Normal Strength", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1.0, "_value": 1.0, "_enum_values": [] }, { "_id": "c938e31a-98dc-4cdf-8a13-803cb910de54", "_name": "Albedo RGB", "_display_name": "Albedo RGB", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 1.0 ], "_value": [ 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 1.0 ], "_enum_values": [] }, { "_id": "f022cd14-2f8f-4d33-af13-ace9516fe210", "_name": "Albedo Tint", "_display_name": "Albedo Tint", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "279e1f57-1d32-4de2-8339-35903efe0cb1", "_name": "Emissive Color", "_display_name": "Emissive Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0, 1.0 ], "_value": [ 0.0, 0.0, 0.0, 1.0 ], "_enum_values": [] }, { "_id": "66b11ff4-e103-4dcc-82c0-30907d8df6ca", "_name": "Emissive Intensity", "_display_name": "Emissive Intensity", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 40.0, "_value": 40.0, "_enum_values": [] }, { "_id": "257b714c-a044-4626-918b-f4705f5cf51f", "_name": "Enable Emission", "_display_name": "Enable Emission", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "0fe4a168-1a25-4aef-b5f5-d83e669cb748", "_name": "Use ORM Map", "_display_name": "Use ORM Map", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "6f468e93-edce-4f75-bc57-fc91b2be5412", "_name": "Metallic Amount", "_display_name": "Metallic Amount", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "2513695f-587c-46c0-9c7f-1e2c599e0a20", "_name": "Metallic Map Influence", "_display_name": "Metallic Map Influence", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "5db802bb-029b-4d0e-a5b9-d3e5bd1d2fbf", "_name": "Roughness Amount", "_display_name": "Roughness Amount", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.5, "_value": 0.5, "_enum_values": [] }, { "_id": "9fb6055a-7d85-41dd-9939-9d9c39896e64", "_name": "Roughness Map Influence", "_display_name": "Roughness Map Influence", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "42e4c080-de78-4f58-8f47-a6f5cb8dfd7f", "_name": "Specular", "_display_name": "Specular", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.5, "_value": 0.5, "_enum_values": [] }, { "_id": "77bddccc-5126-47b3-b97b-8ad9d20316fa", "_name": "Enable Opacity", "_display_name": "Enable Opacity", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "c8ab57cf-5bef-4d22-b965-61fa2caa7358", "_name": "Opacity Amount", "_display_name": "Opacity Amount", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "11c8ed1d-7e94-486c-bb0d-99d2e5ea553b", "_name": "Enable Opacity Texture", "_display_name": "Enable Opacity Texture", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "acae313e-9654-439a-be6f-340ed2a5c596", "_name": "Opacity Threshold", "_display_name": "Opacity Threshold", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "3bd3f2bc-9c3d-44be-81eb-8c7eac140fa8", "_name": "Enable Project UVW Coordinates", "_display_name": "Enable Project UVW Coordinates", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "bbd553cf-741b-4338-a898-4f02a0963b1a", "_name": "Enable World Space", "_display_name": "Enable World Space", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "1155a386-73af-417f-9be5-ecd67f900ac9", "_name": "Opacity Mono Source", "_display_name": "Opacity Mono Source", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1, "_value": 1, "_enum_values": [] }, { "_id": "0d247625-0085-4f5c-9f77-8f8882834dba", "_name": "UV Space Index", "_display_name": "UV Space Index", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "6aca8cf7-481e-4d77-8116-113792354b56", "_name": "Normal Map Flip U Tangent", "_display_name": "Normal Map Flip U Tangent", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "8ee4ea8c-60e4-4e81-a706-64ec5ba3c606", "_name": "Normal Map Flip V Tangent", "_display_name": "Normal Map Flip V Tangent", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": 1, "_value": 1, "_enum_values": [] } ], "_outputs": [ { "_id": "8035c987-2d86-4b21-b243-248b760f0921", "_name": "Albedo Add", "_display_name": "Albedo Add", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "62990c97-8d21-4b41-80f4-2c348c66b2aa", "_name": "Albedo Brightness", "_display_name": "Albedo Brightness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1.0, "_value": 1.0, "_enum_values": [] }, { "_id": "18e6886e-616e-488d-b1c3-bd0c09c5b53d", "_name": "Albedo Desaturation", "_display_name": "Albedo Desaturation", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "1d28901c-aa82-4370-88ad-a4eb2059e5d3", "_name": "AO to Diffuse", "_display_name": "AO to Diffuse", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "d505b6e1-1c8c-434a-8a41-310d9f7c6411", "_name": "Normal Map Strength", "_display_name": "Normal Map Strength", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1.0, "_value": 1.0, "_enum_values": [] }, { "_id": "29520faa-3951-4a5b-9f30-ffd3f9326620", "_name": "Detail Normal Strength", "_display_name": "Detail Normal Strength", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1.0, "_value": 1.0, "_enum_values": [] }, { "_id": "6db27867-0a8d-48f8-bf28-62659ca6f1b0", "_name": "Albedo RGB", "_display_name": "Albedo RGB", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 1.0 ], "_value": [ 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 1.0 ], "_enum_values": [] }, { "_id": "6bde25c2-a5ea-4ecf-a6be-fe5169cb4e32", "_name": "Albedo Tint", "_display_name": "Albedo Tint", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 1.0, 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0, 1.0 ], "_enum_values": [] }, { "_id": "9122f0ee-3617-4ffd-8535-45646df94332", "_name": "Emissive Color", "_display_name": "Emissive Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": [ 0.0, 0.0, 0.0, 1.0 ], "_value": [ 0.0, 0.0, 0.0, 1.0 ], "_enum_values": [] }, { "_id": "6c4ea638-4901-43b9-961e-f8019f368262", "_name": "Emissive Intensity", "_display_name": "Emissive Intensity", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 40.0, "_value": 40.0, "_enum_values": [] }, { "_id": "7ca3672d-5504-4501-9993-3e45ab0089f3", "_name": "Enable Emission", "_display_name": "Enable Emission", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "0fb0e24f-dea7-472d-92b8-9e06d5a31aad", "_name": "Use ORM Map", "_display_name": "Use ORM Map", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "eba053bd-57c5-400b-865a-510daeffe7d6", "_name": "Metallic Amount", "_display_name": "Metallic Amount", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "1866859e-0163-44ac-a263-add902286129", "_name": "Metallic Map Influence", "_display_name": "Metallic Map Influence", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "90dfa10f-657e-4516-8b19-68c96e278c5d", "_name": "Roughness Amount", "_display_name": "Roughness Amount", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.5, "_value": 0.5, "_enum_values": [] }, { "_id": "448df5e0-cdba-4f69-9e2e-ba08292b4805", "_name": "Roughness Map Influence", "_display_name": "Roughness Map Influence", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "2246c0b0-4864-4cc5-ae23-32bea2648d66", "_name": "Specular", "_display_name": "Specular", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.5, "_value": 0.5, "_enum_values": [] }, { "_id": "943b1c5c-8f0e-445d-8f28-cf61d978b957", "_name": "Enable Opacity", "_display_name": "Enable Opacity", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "dbda4e78-dc9c-4c1c-8e68-fc313f119bd4", "_name": "Opacity Amount", "_display_name": "Opacity Amount", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "ca875221-49e7-4abd-891d-349ee499bf2d", "_name": "Enable Opacity Texture", "_display_name": "Enable Opacity Texture", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "12d90cd3-4e06-4d1c-9fb0-868c7aa2bff1", "_name": "Opacity Threshold", "_display_name": "Opacity Threshold", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0.0, "_value": 0.0, "_enum_values": [] }, { "_id": "589e3208-ed4b-4519-8b06-0714c8762eff", "_name": "Enable Project UVW Coordinates", "_display_name": "Enable Project UVW Coordinates", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "6f228ca3-675e-4429-a32a-6835681e38bf", "_name": "Enable World Space", "_display_name": "Enable World Space", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "e4933be0-5585-4b97-a950-85183be6768a", "_name": "Opacity Mono Source", "_display_name": "Opacity Mono Source", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1, "_value": 1, "_enum_values": [] }, { "_id": "c103dc61-49e6-468a-a85c-897a7dc1c641", "_name": "UV Space Index", "_display_name": "UV Space Index", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "0e0661c4-dc86-4c8e-8970-f3be3eab6f52", "_name": "Normal Map Flip U Tangent", "_display_name": "Normal Map Flip U Tangent", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 0, "_value": 0, "_enum_values": [] }, { "_id": "30c3b04a-af6e-470f-a209-8cb02d625fef", "_name": "Normal Map Flip V Tangent", "_display_name": "Normal Map Flip V Tangent", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": 1, "_value": 1, "_enum_values": [] } ], "_class_name": "ShaderNodeGroup" }, { "_id": "Material Output", "_inputs": [], "_outputs": [], "_class_name": "ShaderNodeOutputMaterial" }, { "_id": "Detail Normal Map", "_inputs": [ { "_id": "2a32fd16-7e99-44b5-9a09-fbd9c30c216f", "_name": "image", "_display_name": "Detail Normal Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "ffddd34a-adfc-4a16-ba91-62a62744a2d9", "_name": "image", "_display_name": "Detail Normal Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Mapping", "_inputs": [], "_outputs": [], "_class_name": "ShaderNodeMapping" }, { "_id": "Mapping.001", "_inputs": [], "_outputs": [], "_class_name": "ShaderNodeMapping" }, { "_id": "Emissive Mask Map", "_inputs": [ { "_id": "6ffdd438-f65b-4ddd-afa6-1c290ff96114", "_name": "image", "_display_name": "Emissive Mask Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "9cb526f6-3e0e-424c-8e22-e10ec52d5c09", "_name": "image", "_display_name": "Emissive Mask Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Opacity Map", "_inputs": [ { "_id": "6998e9d6-6989-4769-9ff2-9c3cc5ed1283", "_name": "image", "_display_name": "Opacity Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_outputs": [ { "_id": "cb1e031c-5bdc-4059-895e-7ca512ee86df", "_name": "image", "_display_name": "Opacity Map", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_is_removable": false, "_default_value": "['', 'raw']", "_value": "['', 'raw']", "_enum_values": [] } ], "_class_name": "ShaderNodeTexImage" }, { "_id": "Frame.002", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" }, { "_id": "Frame.001", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" }, { "_id": "Frame", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" }, { "_id": "Frame.004", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" }, { "_id": "Frame.003", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" }, { "_id": "Frame.005", "_inputs": [], "_outputs": [], "_class_name": "NodeFrame" } ], "_metadata": { "_category": "Connector Materials", "_name": "", "_keywords": [ "Blender", "Principled Omni PBR", "Principled Omni PBR" ], "_supported_clients": [ { "_name": "Blender", "_version": "any" } ] }, "_root_node_id": "c7bd6124-2e74-493e-9448-d5e046e42cd6", "_revision": 18, "_connections": [] } }
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/core/service/resources/Blender/UMMLibrary/Target/ShaderNodeBsdfRefraction.json
{ "_header": { "_module": "omni.universalmaterialmap.core.data", "_class_name": "Target" }, "_content": { "_id": "46e980f8-2e59-440c-ba87-404e5b15424f", "_inputs": [], "_outputs": [], "_display_name": "ShaderNodeBsdfRefraction", "_position": null, "_expansion_state": 0, "_show_inputs": true, "_show_outputs": true, "_show_peripheral": false, "_nodes": [ { "_id": "a3e45046-435e-47a0-91e4-59e9ce0532d2", "_inputs": [ { "_id": "cb68406d-36c2-4f3f-a920-2cbcac38e753", "_name": "Color", "_display_name": "Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ], "_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ] }, { "_id": "526d905d-2bf9-4fc7-bf06-c3dde7da3aea", "_name": "Roughness", "_display_name": "Roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.0, "_value": 0.0 }, { "_id": "e84ca2a0-a9bc-4b73-bf5c-3791ba272aea", "_name": "IOR", "_display_name": "IOR", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 1.4500000476837158, "_value": 1.4500000476837158 }, { "_id": "84c04504-a4fc-436c-848c-d6a942b37f24", "_name": "Normal", "_display_name": "Normal", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ] } ], "_outputs": [ { "_id": "7b7af7cc-b107-480c-b8fd-c145cf1566aa", "_name": "Color", "_display_name": "Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ], "_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ] }, { "_id": "b971307f-88c0-4381-8a6d-91fcd12ddae6", "_name": "Roughness", "_display_name": "Roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.0, "_value": 0.0 }, { "_id": "e298c85e-0ac4-43a9-9cc5-0d9cd04dfc7e", "_name": "IOR", "_display_name": "IOR", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 1.4500000476837158, "_value": 1.4500000476837158 }, { "_id": "71d06cbd-a323-40f1-9f8e-f361d3aaad10", "_name": "Normal", "_display_name": "Normal", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ] } ], "_class_name": "bpy.types.ShaderNodeBsdfRefraction" } ], "_metadata": { "_category": "Connector Materials", "_name": "", "_keywords": [ "Blender", "bpy.types.ShaderNodeBsdfRefraction", "ShaderNodeBsdfRefraction" ], "_supported_clients": [ { "_name": "Blender", "_version": "any" } ] }, "_root_node_id": "a3e45046-435e-47a0-91e4-59e9ce0532d2", "_revision": 1 } }
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/core/service/resources/Blender/UMMLibrary/Target/Material.json
{ "_header": { "_module": "omni.universalmaterialmap.core.data", "_class_name": "Target" }, "_content": { "_id": "3f4ed058-5ed5-4125-8d23-32f6fc293a23", "_inputs": [], "_outputs": [], "_display_name": "Material", "_position": null, "_expansion_state": 0, "_show_inputs": true, "_show_outputs": true, "_show_peripheral": false, "_nodes": [ { "_id": "1f1c4005-887c-4d9a-947c-f4d1ca20cd25", "_inputs": [ { "_id": "1d9ca95d-8254-46b9-b928-d1f02a698213", "_name": "diffuse_color", "_display_name": "diffuse_color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.10653112083673477, 0.10653112083673477, 0.10653112083673477, 1.0 ], "_value": [ 0.10653112083673477, 0.10653112083673477, 0.10653112083673477, 1.0 ] }, { "_id": "fbcb76c0-3bf8-4360-b15e-b24cc86559ff", "_name": "metallic", "_display_name": "metallic", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.0, "_value": 0.0 }, { "_id": "cae5adb6-fdf0-43a7-9a97-1dd0f2c9535d", "_name": "specular_color", "_display_name": "specular_color", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_default_value": "<Color (r=1.0000, g=1.0000, b=1.0000)>", "_value": "<Color (r=1.0000, g=1.0000, b=1.0000)>" }, { "_id": "88f4f41d-dbfa-4e11-aabf-c6d33d61b7c1", "_name": "roughness", "_display_name": "roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.5, "_value": 0.5 }, { "_id": "b138be48-a071-4172-a73a-958f10f915d8", "_name": "use_backface_culling", "_display_name": "use_backface_culling", "_value_type": "bool", "_internal_value_type": "BOOLEAN", "_is_peripheral": false, "_is_editable": false, "_default_value": false, "_value": false }, { "_id": "6f55a3c6-c368-4217-a594-9097dcfc0399", "_name": "blend_method", "_display_name": "blend_method", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_default_value": "OPAQUE", "_value": "OPAQUE" }, { "_id": "caaf0984-43c3-4019-a863-853f69661be3", "_name": "shadow_method", "_display_name": "shadow_method", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": false, "_default_value": "OPAQUE", "_value": "OPAQUE" }, { "_id": "e7eb44b4-37e7-4259-8c5f-82c19435459a", "_name": "alpha_threshold", "_display_name": "alpha_threshold", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.0, "_value": 0.0 }, { "_id": "574f3a85-dbab-4586-914e-f6d0e3d86cf4", "_name": "use_screen_refraction", "_display_name": "use_screen_refraction", "_value_type": "bool", "_internal_value_type": "BOOLEAN", "_is_peripheral": false, "_is_editable": false, "_default_value": false, "_value": false }, { "_id": "680f293b-ff61-4213-8437-0dd6a94a8d3c", "_name": "refraction_depth", "_display_name": "refraction_depth", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.0, "_value": 0.0 }, { "_id": "91628c12-4cc8-4be9-874e-5020976996bb", "_name": "use_sss_translucency", "_display_name": "use_sss_translucency", "_value_type": "bool", "_internal_value_type": "BOOLEAN", "_is_peripheral": false, "_is_editable": false, "_default_value": false, "_value": false }, { "_id": "009e82f0-e06f-4794-9832-b107b6ebe522", "_name": "pass_index", "_display_name": "pass_index", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": false, "_default_value": 0, "_value": 0 } ], "_outputs": [ { "_id": "bff7ca52-25c6-4abb-a69e-fd282c74edff", "_name": "diffuse_color", "_display_name": "diffuse_color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.10653112083673477, 0.10653112083673477, 0.10653112083673477, 1.0 ], "_value": [ 0.10653112083673477, 0.10653112083673477, 0.10653112083673477, 1.0 ] }, { "_id": "fad7e661-30f3-4375-be09-096f5bcd94c1", "_name": "metallic", "_display_name": "metallic", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.0, "_value": 0.0 }, { "_id": "633eb886-6fdb-455a-8332-8e6112772d15", "_name": "specular_color", "_display_name": "specular_color", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_default_value": "<Color (r=1.0000, g=1.0000, b=1.0000)>", "_value": "<Color (r=1.0000, g=1.0000, b=1.0000)>" }, { "_id": "2d2dd095-e327-4a92-9653-7595504855d2", "_name": "roughness", "_display_name": "roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.5, "_value": 0.5 }, { "_id": "61395586-068f-4549-8775-ecdf2db14d00", "_name": "use_backface_culling", "_display_name": "use_backface_culling", "_value_type": "bool", "_internal_value_type": "BOOLEAN", "_is_peripheral": false, "_is_editable": true, "_default_value": false, "_value": false }, { "_id": "b69aabfa-5490-4c1d-8a56-138ea0abcedd", "_name": "blend_method", "_display_name": "blend_method", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_default_value": "OPAQUE", "_value": "OPAQUE" }, { "_id": "a798c56e-6dfd-4569-b602-fac9ec5fcda1", "_name": "shadow_method", "_display_name": "shadow_method", "_value_type": "str", "_internal_value_type": "STRING", "_is_peripheral": false, "_is_editable": true, "_default_value": "OPAQUE", "_value": "OPAQUE" }, { "_id": "0405e856-f785-4b7b-8eb4-e690571fb26f", "_name": "alpha_threshold", "_display_name": "alpha_threshold", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.0, "_value": 0.0 }, { "_id": "d004fc2e-25b9-47b5-ad8d-dedb408b37f9", "_name": "use_screen_refraction", "_display_name": "use_screen_refraction", "_value_type": "bool", "_internal_value_type": "BOOLEAN", "_is_peripheral": false, "_is_editable": true, "_default_value": false, "_value": false }, { "_id": "313665ed-8e49-43da-9d99-4ac0ec1b3b85", "_name": "refraction_depth", "_display_name": "refraction_depth", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.0, "_value": 0.0 }, { "_id": "df7d1e73-1e3c-4639-9380-6d78f2c1f696", "_name": "use_sss_translucency", "_display_name": "use_sss_translucency", "_value_type": "bool", "_internal_value_type": "BOOLEAN", "_is_peripheral": false, "_is_editable": true, "_default_value": false, "_value": false }, { "_id": "084b6be8-eac5-4db5-9465-35f69ea965f8", "_name": "pass_index", "_display_name": "pass_index", "_value_type": "int", "_internal_value_type": "INT", "_is_peripheral": false, "_is_editable": true, "_default_value": 0, "_value": 0 } ], "_class_name": "bpy.types.Material" } ], "_metadata": { "_category": "Connector Materials", "_name": "", "_keywords": [ "Blender", "bpy.types.Material", "Material" ], "_supported_clients": [ { "_name": "Blender", "_version": "any" } ] }, "_root_node_id": "1f1c4005-887c-4d9a-947c-f4d1ca20cd25", "_revision": 1 } }
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/core/service/resources/Blender/UMMLibrary/Target/ShaderNodeEmission.json
{ "_header": { "_module": "omni.universalmaterialmap.core.data", "_class_name": "Target" }, "_content": { "_id": "f5456451-0a8c-45e4-93fc-7642ba46c799", "_inputs": [], "_outputs": [], "_display_name": "ShaderNodeEmission", "_position": null, "_expansion_state": 0, "_show_inputs": true, "_show_outputs": true, "_show_peripheral": false, "_nodes": [ { "_id": "12f88157-ff36-43e8-a493-f6d3457ef24f", "_inputs": [ { "_id": "b4a88b72-d770-466b-be37-bd278a28718a", "_name": "Color", "_display_name": "Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 1.0, 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0, 1.0 ] }, { "_id": "519b8480-4ed2-4aeb-9e54-5928b827a83d", "_name": "Strength", "_display_name": "Strength", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 1.0, "_value": 1.0 } ], "_outputs": [ { "_id": "0e5c6a59-a766-426a-a712-305ebd92843c", "_name": "Color", "_display_name": "Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 1.0, 1.0, 1.0, 1.0 ], "_value": [ 1.0, 1.0, 1.0, 1.0 ] }, { "_id": "3142888a-782b-4510-9085-8ef630c97945", "_name": "Strength", "_display_name": "Strength", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 1.0, "_value": 1.0 } ], "_class_name": "bpy.types.ShaderNodeEmission" } ], "_metadata": { "_category": "Connector Materials", "_name": "", "_keywords": [ "Blender", "bpy.types.ShaderNodeEmission", "ShaderNodeEmission" ], "_supported_clients": [ { "_name": "Blender", "_version": "any" } ] }, "_root_node_id": "12f88157-ff36-43e8-a493-f6d3457ef24f", "_revision": 1 } }
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/core/service/resources/Blender/UMMLibrary/Target/ShaderNodeEeveeSpecular.json
{ "_header": { "_module": "omni.universalmaterialmap.core.data", "_class_name": "Target" }, "_content": { "_id": "efcfccdf-7b68-4a31-873a-2e6ec2647f5e", "_inputs": [], "_outputs": [], "_display_name": "ShaderNodeEeveeSpecular", "_position": null, "_expansion_state": 0, "_show_inputs": true, "_show_outputs": true, "_show_peripheral": false, "_nodes": [ { "_id": "ab2cca67-a24b-4992-a660-b0524d361f72", "_inputs": [ { "_id": "536ff9b2-5624-489d-a454-4bcee5e2ac87", "_name": "Base Color", "_display_name": "Base Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ], "_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ] }, { "_id": "3e7511db-73dc-4967-bf09-9fa15123cd61", "_name": "Specular", "_display_name": "Specular", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.029999999329447746, 0.029999999329447746, 0.029999999329447746, 1.0 ], "_value": [ 0.029999999329447746, 0.029999999329447746, 0.029999999329447746, 1.0 ] }, { "_id": "bfa24f42-46e1-4938-869e-b85cc689e54b", "_name": "Roughness", "_display_name": "Roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.20000000298023224, "_value": 0.20000000298023224 }, { "_id": "f014e6f4-f986-4af8-8239-fec454fddbf4", "_name": "Emissive Color", "_display_name": "Emissive Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.0, 0.0, 0.0, 1.0 ], "_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "_id": "de540d17-36df-46a6-bc7f-27110a83b86c", "_name": "Transparency", "_display_name": "Transparency", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.0, "_value": 0.0 }, { "_id": "5cf8491a-f5ca-4061-b048-9a24f27388d8", "_name": "Normal", "_display_name": "Normal", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ] }, { "_id": "bd357c18-bab2-4b0e-87ca-28b28a789c3e", "_name": "Clear Coat", "_display_name": "Clear Coat", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.0, "_value": 0.0 }, { "_id": "22c1ba69-37d8-4d38-99c9-64f6cfb44c27", "_name": "Clear Coat Roughness", "_display_name": "Clear Coat Roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.0, "_value": 0.0 }, { "_id": "27f862d8-e78e-4682-9171-4799cd6ce65e", "_name": "Clear Coat Normal", "_display_name": "Clear Coat Normal", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ] }, { "_id": "697dc75a-1366-4d11-8a40-ebd1179c95fb", "_name": "Ambient Occlusion", "_display_name": "Ambient Occlusion", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 1.0, "_value": 1.0 } ], "_outputs": [ { "_id": "eaa08842-e42c-419f-bccc-823e59953397", "_name": "Base Color", "_display_name": "Base Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ], "_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ] }, { "_id": "073b7e98-01b5-45ae-8fbb-57e885b2a57f", "_name": "Specular", "_display_name": "Specular", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.029999999329447746, 0.029999999329447746, 0.029999999329447746, 1.0 ], "_value": [ 0.029999999329447746, 0.029999999329447746, 0.029999999329447746, 1.0 ] }, { "_id": "1c1f560b-6634-4d6a-99c7-99410d2f2536", "_name": "Roughness", "_display_name": "Roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.20000000298023224, "_value": 0.20000000298023224 }, { "_id": "692b0145-a7ae-4c29-868f-6085bf400086", "_name": "Emissive Color", "_display_name": "Emissive Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.0, 0.0, 0.0, 1.0 ], "_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "_id": "a2a82252-ca1b-4533-a3e8-4c33a626cb3c", "_name": "Transparency", "_display_name": "Transparency", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.0, "_value": 0.0 }, { "_id": "47b4dbe2-49d9-4f27-83cb-5befb10910d2", "_name": "Normal", "_display_name": "Normal", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ] }, { "_id": "c2123168-b6f8-4c7e-b339-5e7ff9f1d2c0", "_name": "Clear Coat", "_display_name": "Clear Coat", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.0, "_value": 0.0 }, { "_id": "f7ae74b2-fbd1-4a9d-8fac-f38b496c07f1", "_name": "Clear Coat Roughness", "_display_name": "Clear Coat Roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.0, "_value": 0.0 }, { "_id": "92ffeabe-3a5e-4544-9154-85f21fa70ced", "_name": "Clear Coat Normal", "_display_name": "Clear Coat Normal", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ] }, { "_id": "f27ea3ed-12fd-43f9-a657-f6306af2597b", "_name": "Ambient Occlusion", "_display_name": "Ambient Occlusion", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 1.0, "_value": 1.0 } ], "_class_name": "bpy.types.ShaderNodeEeveeSpecular" } ], "_metadata": { "_category": "Connector Materials", "_name": "", "_keywords": [ "Blender", "bpy.types.ShaderNodeEeveeSpecular", "ShaderNodeEeveeSpecular" ], "_supported_clients": [ { "_name": "Blender", "_version": "any" } ] }, "_root_node_id": "ab2cca67-a24b-4992-a660-b0524d361f72", "_revision": 1 } }
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/core/service/resources/Blender/UMMLibrary/Target/ShaderNodeBsdfGlossy.json
{ "_header": { "_module": "omni.universalmaterialmap.core.data", "_class_name": "Target" }, "_content": { "_id": "d41abde8-4d99-4b5a-b57d-259bab45081d", "_inputs": [], "_outputs": [], "_display_name": "ShaderNodeBsdfGlossy", "_position": null, "_expansion_state": 0, "_show_inputs": true, "_show_outputs": true, "_show_peripheral": false, "_nodes": [ { "_id": "6c7fa685-f0e9-44de-98a3-fcb04d866c2c", "_inputs": [ { "_id": "c14367f4-f4fc-45b1-acad-68641c5954cc", "_name": "Color", "_display_name": "Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ], "_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ] }, { "_id": "25514c76-9fed-4ecf-944f-5ea19d2f5de5", "_name": "Roughness", "_display_name": "Roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.5, "_value": 0.5 }, { "_id": "25214c93-e2b3-467c-a94b-77a4cb9ff661", "_name": "Normal", "_display_name": "Normal", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ] } ], "_outputs": [ { "_id": "8dbf9784-00bb-4466-bb68-8c4f466286b1", "_name": "Color", "_display_name": "Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ], "_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ] }, { "_id": "1c09a532-4f5a-44e8-83dd-86c4cc89642f", "_name": "Roughness", "_display_name": "Roughness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.5, "_value": 0.5 }, { "_id": "a29a34dd-d4fa-499b-97bf-7666746b97b1", "_name": "Normal", "_display_name": "Normal", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ] } ], "_class_name": "bpy.types.ShaderNodeBsdfGlossy" } ], "_metadata": { "_category": "Connector Materials", "_name": "", "_keywords": [ "Blender", "bpy.types.ShaderNodeBsdfGlossy", "ShaderNodeBsdfGlossy" ], "_supported_clients": [ { "_name": "Blender", "_version": "any" } ] }, "_root_node_id": "6c7fa685-f0e9-44de-98a3-fcb04d866c2c", "_revision": 1 } }
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/core/service/resources/Blender/UMMLibrary/Target/ShaderNodeSubsurfaceScattering.json
{ "_header": { "_module": "omni.universalmaterialmap.core.data", "_class_name": "Target" }, "_content": { "_id": "c6dec56f-e3d2-42b3-9c06-a6bd22b5db27", "_inputs": [], "_outputs": [], "_display_name": "ShaderNodeSubsurfaceScattering", "_position": null, "_expansion_state": 0, "_show_inputs": true, "_show_outputs": true, "_show_peripheral": false, "_nodes": [ { "_id": "cf97af78-0b08-413c-b82e-58bbf6f2853c", "_inputs": [ { "_id": "1cdc9dcb-2dc2-4d51-b959-fa32a620f543", "_name": "Color", "_display_name": "Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ], "_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ] }, { "_id": "d9fdea92-702f-4d98-a68d-598fbe3a1376", "_name": "Scale", "_display_name": "Scale", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 1.0, "_value": 1.0 }, { "_id": "7974748d-3720-4cc3-9afd-15ab9e90c43c", "_name": "Radius", "_display_name": "Radius", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 1.0, 0.20000000298023224, 0.10000000149011612 ], "_value": [ 1.0, 0.20000000298023224, 0.10000000149011612 ] }, { "_id": "326bb331-fe31-4204-bfea-1ef29ada9de0", "_name": "Sharpness", "_display_name": "Sharpness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.0, "_value": 0.0 }, { "_id": "df0fd28a-a27f-4f88-b13c-8c793e3331e4", "_name": "Texture Blur", "_display_name": "Texture Blur", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": false, "_default_value": 0.0, "_value": 0.0 }, { "_id": "8674e240-4cc6-4196-9570-89953ee453c9", "_name": "Normal", "_display_name": "Normal", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": false, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ] } ], "_outputs": [ { "_id": "7fbac237-f747-47a1-b812-e5dd4b74ef97", "_name": "Color", "_display_name": "Color", "_value_type": "vector4", "_internal_value_type": "RGBA", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ], "_value": [ 0.800000011920929, 0.800000011920929, 0.800000011920929, 1.0 ] }, { "_id": "ad9c8cca-7e12-4f87-b782-3c91cfb94de3", "_name": "Scale", "_display_name": "Scale", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 1.0, "_value": 1.0 }, { "_id": "e14849e6-d76f-40a6-8331-a88bd31ee40e", "_name": "Radius", "_display_name": "Radius", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 1.0, 0.20000000298023224, 0.10000000149011612 ], "_value": [ 1.0, 0.20000000298023224, 0.10000000149011612 ] }, { "_id": "2cf970e4-de78-4a39-badf-659efd922c7c", "_name": "Sharpness", "_display_name": "Sharpness", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.0, "_value": 0.0 }, { "_id": "56862d26-c6d9-41a6-96eb-d85cc29e4ae2", "_name": "Texture Blur", "_display_name": "Texture Blur", "_value_type": "float", "_internal_value_type": "VALUE", "_is_peripheral": false, "_is_editable": true, "_default_value": 0.0, "_value": 0.0 }, { "_id": "21263234-d062-4e48-a8b8-96ff63b990d4", "_name": "Normal", "_display_name": "Normal", "_value_type": "vector3", "_internal_value_type": "VECTOR", "_is_peripheral": false, "_is_editable": true, "_default_value": [ 0.0, 0.0, 0.0 ], "_value": [ 0.0, 0.0, 0.0 ] } ], "_class_name": "bpy.types.ShaderNodeSubsurfaceScattering" } ], "_metadata": { "_category": "Connector Materials", "_name": "", "_keywords": [ "Blender", "bpy.types.ShaderNodeSubsurfaceScattering", "ShaderNodeSubsurfaceScattering" ], "_supported_clients": [ { "_name": "Blender", "_version": "any" } ] }, "_root_node_id": "cf97af78-0b08-413c-b82e-58bbf6f2853c", "_revision": 1 } }
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/blender/converter.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. import typing import sys import traceback import os import re import json import math import bpy import bpy_types from . import get_library, get_value, CORE_MATERIAL_PROPERTIES, create_template, developer_mode, get_template_data_by_shader_node, get_template_data_by_class_name, create_from_template from ..core.converter.core import ICoreConverter, IObjectConverter, IDataConverter from ..core.converter import util from ..core.service import store from ..core.data import Plug, ConversionManifest, DagNode, ConversionGraph, TargetInstance __initialized: bool = False __manifest: ConversionManifest = None def _get_manifest() -> ConversionManifest: if not getattr(sys.modules[__name__], '__manifest'): setattr(sys.modules[__name__], '__manifest', store.get_conversion_manifest(library=get_library())) if developer_mode: manifest: ConversionManifest = getattr(sys.modules[__name__], '__manifest') print('UMM DEBUG: blender.converter._get_manifest(): num entries = "{0}"'.format(len(manifest.conversion_maps))) for conversion_map in manifest.conversion_maps: print('UMM DEBUG: blender.converter._get_manifest(): Entry: graph_id = "{0}", render_context = "{1}"'.format(conversion_map.conversion_graph_id, conversion_map.render_context)) return getattr(sys.modules[__name__], '__manifest') def _get_conversion_graph_impl(source_class: str, render_context: str) -> typing.Union[ConversionGraph, typing.NoReturn]: if developer_mode: print('UMM DEBUG: blender.converter._get_conversion_graph_impl(source_class="{0}", render_context="{1}")'.format(source_class, render_context)) for conversion_map in _get_manifest().conversion_maps: if not conversion_map.render_context == render_context: if developer_mode: print('UMM DEBUG: blender.converter._get_conversion_graph_impl: conversion_map.render_context "{0}" != "{1}")'.format(conversion_map.render_context, render_context)) continue if not conversion_map.conversion_graph: if developer_mode: print('UMM DEBUG: blender.converter._get_conversion_graph_impl: conversion_map.conversion_graph "{0}")'.format(conversion_map.conversion_graph)) continue if not conversion_map.conversion_graph.source_node: if developer_mode: print('UMM DEBUG: blender.converter._get_conversion_graph_impl: conversion_map.source_node "{0}")'.format(conversion_map.conversion_graph.source_node)) continue if not conversion_map.conversion_graph.source_node.target.root_node.class_name == source_class: if developer_mode: print('UMM DEBUG: blender.converter._get_conversion_graph_impl: conversion_map.conversion_graph.source_node.target.root_node.class_name "{0}" != "{1}")'.format(conversion_map.conversion_graph.source_node.target.root_node.class_name, source_class)) continue if developer_mode: print('UMM DEBUG: blender.converter._get_conversion_graph_impl: found match "{0}")'.format(conversion_map.conversion_graph.filename)) return conversion_map.conversion_graph if developer_mode: print('UMM DEBUG: blender.converter._get_conversion_graph_impl: found no match!)') return None def _instance_to_output_entity(graph: ConversionGraph, instance: object) -> TargetInstance: if developer_mode: print('_instance_to_output_entity') for output in graph.source_node.outputs: if output.name == 'node_id_output': continue if util.can_set_plug_value(instance=instance, plug=output): util.set_plug_value(instance=instance, plug=output) else: print('UMM Warning: Unable to set output plug "{0}"... using default value of "{1}"'.format(output.name, output.default_value)) output.value = output.default_value return graph.get_output_entity() def _data_to_output_entity(graph: ConversionGraph, data: typing.List[typing.Tuple[str, typing.Any]]) -> TargetInstance: for output in graph.source_node.outputs: if output.name == 'node_id_output': continue o = [o for o in data if o[0] == output.name] if len(o): output.value = o[0][1] else: output.value = output.default_value return graph.get_output_entity() def _instance_to_data(instance: object, graph: ConversionGraph) -> typing.List[typing.Tuple[str, typing.Any]]: target_instance = _instance_to_output_entity(graph=graph, instance=instance) if developer_mode: print('_instance_to_data') print('\ttarget_instance.target.store_id', target_instance.target.store_id) # Compute target attribute values attribute_data = [(util.TARGET_CLASS_IDENTIFIER, target_instance.target.root_node.class_name)] for plug in target_instance.inputs: if not plug.input: continue if developer_mode: print('\t{} is invalid: {}'.format(plug.name, plug.is_invalid)) if plug.is_invalid and isinstance(plug.parent, DagNode): plug.parent.compute() if developer_mode: print('\t{} computed value = {}'.format(plug.name, plug.computed_value)) attribute_data.append((plug.name, plug.computed_value)) return attribute_data def _to_convertible_instance(instance: object, material: bpy.types.Material = None) -> object: if developer_mode: print('_to_convertible_instance', type(instance)) if material is None: if isinstance(instance, bpy.types.Material): material = instance else: for m in bpy.data.materials: if not m.use_nodes: continue if not len([o for o in m.node_tree.nodes if o == instance]): continue material = m break if material is None: return instance if not material.use_nodes: return material if instance == material: # Find the Surface Shader. for link in material.node_tree.links: if not isinstance(link, bpy.types.NodeLink): continue if not isinstance(link.to_node, bpy.types.ShaderNodeOutputMaterial): continue if not link.to_socket.name == 'Surface': continue result = _to_convertible_instance(instance=link.from_node, material=material) if result is not None: return result # No surface shader found - return instance return instance if isinstance(instance, bpy.types.ShaderNodeAddShader): for link in material.node_tree.links: if not isinstance(link, bpy.types.NodeLink): continue if not link.to_node == instance: continue # if not link.to_socket.name == 'Shader': # continue result = _to_convertible_instance(instance=link.from_node, material=material) if result is not None: return result # if isinstance(instance, bpy.types.ShaderNodeBsdfGlass): # return instance # if isinstance(instance, bpy.types.ShaderNodeBsdfGlossy): # return instance if isinstance(instance, bpy.types.ShaderNodeBsdfPrincipled): return instance # if isinstance(instance, bpy.types.ShaderNodeBsdfRefraction): # return instance # if isinstance(instance, bpy.types.ShaderNodeBsdfTranslucent): # return instance # if isinstance(instance, bpy.types.ShaderNodeBsdfTransparent): # return instance # if isinstance(instance, bpy.types.ShaderNodeEeveeSpecular): # return instance # if isinstance(instance, bpy.types.ShaderNodeEmission): # return instance # if isinstance(instance, bpy.types.ShaderNodeSubsurfaceScattering): # return instance return None class CoreConverter(ICoreConverter): def __init__(self): super(CoreConverter, self).__init__() def get_conversion_manifest(self) -> typing.List[typing.Tuple[str, str]]: """ Returns data indicating what source class can be converted to a render context. Example: [('lambert', 'MDL'), ('blinn', 'MDL'),] """ output = [] for conversion_map in _get_manifest().conversion_maps: if not conversion_map.render_context: continue if not conversion_map.conversion_graph: continue if not conversion_map.conversion_graph.source_node: continue output.append((conversion_map.conversion_graph.source_node.target.root_node.class_name, conversion_map.render_context)) return output class ObjectConverter(CoreConverter, IObjectConverter): """ """ MATERIAL_CLASS = 'bpy.types.Material' SHADER_NODES = [ 'bpy.types.ShaderNodeBsdfGlass', 'bpy.types.ShaderNodeBsdfGlossy', 'bpy.types.ShaderNodeBsdfPrincipled', 'bpy.types.ShaderNodeBsdfRefraction', 'bpy.types.ShaderNodeBsdfTranslucent', 'bpy.types.ShaderNodeBsdfTransparent', 'bpy.types.ShaderNodeEeveeSpecular', 'bpy.types.ShaderNodeEmission', 'bpy.types.ShaderNodeSubsurfaceScattering', ] def can_create_instance(self, class_name: str) -> bool: """ Returns true if worker can generate an object of the given class name. """ if class_name == ObjectConverter.MATERIAL_CLASS: return True return class_name in ObjectConverter.SHADER_NODES def create_instance(self, class_name: str, name: str = 'material') -> object: """ Creates an object of the given class name. """ material = bpy.data.materials.new(name=name) if class_name in ObjectConverter.SHADER_NODES: material.use_nodes = True return material def can_set_plug_value(self, instance: object, plug: Plug) -> bool: """ Returns true if worker can set the plug's value given the instance and its attributes. """ if plug.input: return False if isinstance(instance, bpy.types.Material): for o in CORE_MATERIAL_PROPERTIES: if o[0] == plug.name: return hasattr(instance, plug.name) return False if isinstance(instance, bpy_types.ShaderNode): return len([o for o in instance.inputs if o.name == plug.name]) == 1 return False def set_plug_value(self, instance: object, plug: Plug) -> typing.NoReturn: """ Sets the plug's value given the value of the instance's attribute named the same as the plug. """ if isinstance(instance, bpy.types.Material): plug.value = getattr(instance, plug.name) if developer_mode: print('set_plug_value') print('\tinstance', type(instance)) print('\tname', plug.name) print('\tvalue', plug.value) return inputs = [o for o in instance.inputs if o.name == plug.name] if not len(inputs) == 1: return plug.value = get_value(socket=inputs[0]) if developer_mode: # print('set_plug_value') # print('\tinstance', type(instance)) # print('\tname', plug.name) # print('\tvalue', plug.value) print('\tset_plug_value: {} = {}'.format(plug.name, plug.value)) def can_set_instance_attribute(self, instance: object, name: str): """ Resolves if worker can set an attribute by the given name on the instance. """ return False def set_instance_attribute(self, instance: object, name: str, value: typing.Any) -> typing.NoReturn: """ Sets the named attribute on the instance to the value. """ raise NotImplementedError() def can_convert_instance(self, instance: object, render_context: str) -> bool: """ Resolves if worker can convert the instance to another object given the render_context. """ return False def convert_instance_to_instance(self, instance: object, render_context: str) -> typing.Any: """ Converts the instance to another object given the render_context. """ raise NotImplementedError() def can_convert_instance_to_data(self, instance: object, render_context: str) -> bool: """ Resolves if worker can convert the instance to another object given the render_context. """ node = _to_convertible_instance(instance=instance) if node is not None and not node == instance: if developer_mode: print('Found graph node to use instead of bpy.types.Material: {0}'.format(type(node))) instance = node template, template_map, template_shader_name, material = get_template_data_by_shader_node(shader_node=instance) if template is None: class_name = '{0}.{1}'.format(instance.__class__.__module__, instance.__class__.__name__) conversion_graph = _get_conversion_graph_impl(source_class=class_name, render_context=render_context) if not conversion_graph: return False try: destination_target_instance = _instance_to_output_entity(graph=conversion_graph, instance=instance) except Exception as error: print('Warning: Unable to get destination assembly using document "{0}".\nDetails: {1}'.format(conversion_graph.filename, error)) return False return destination_target_instance is not None else: conversion_graph = _get_conversion_graph_impl(source_class=template_shader_name, render_context=render_context) return conversion_graph is not None def convert_instance_to_data(self, instance: object, render_context: str) -> typing.List[typing.Tuple[str, typing.Any]]: """ Returns a list of key value pairs in tuples. The first pair is ("umm_target_class", "the_class_name") indicating the conversion target class. """ node = _to_convertible_instance(instance=instance) if node is not None and not node == instance: if developer_mode: print('Found graph node to use instead of bpy.types.Material: {0}'.format(type(node))) instance = node template, template_map, template_shader_name, material = get_template_data_by_shader_node(shader_node=instance) if template is None: class_name = '{0}.{1}'.format(instance.__class__.__module__, instance.__class__.__name__) conversion_graph = _get_conversion_graph_impl(source_class=class_name, render_context=render_context) return _instance_to_data(instance=instance, graph=conversion_graph) else: conversion_graph = _get_conversion_graph_impl(source_class=template_shader_name, render_context=render_context) if developer_mode: print('conversion_graph', conversion_graph.filename) # set plug values on conversion_graph.source_node.outputs for output in conversion_graph.source_node.outputs: if output.name == 'node_id_output': continue if developer_mode: print('output', output.name) internal_node = None for a in conversion_graph.source_node.target.nodes: for b in a.outputs: if output.id == b.id: internal_node = a break if internal_node is not None: break if internal_node is None: raise NotImplementedError(f"No internal node found for {output.name}") map_definition = None for o in template_map['maps']: if o['blender_node'] == internal_node.id and o['blender_socket'] == output.name: map_definition = o break if map_definition is None: raise NotImplementedError(f"No map definition found for {output.name}") if developer_mode: print('map_definition', map_definition['blender_node']) if map_definition['blender_node'] == '': output.value = output.default_value if developer_mode: print('output.value', output.value) continue for shader_node in material.node_tree.nodes: if not shader_node.name == map_definition['blender_node']: continue if isinstance(shader_node, bpy.types.ShaderNodeTexImage): if map_definition['blender_socket'] == 'image': if shader_node.image and (shader_node.image.source == 'FILE' or shader_node.image.source == 'TILED'): print(f'UMM: image.filepath: "{shader_node.image.filepath}"') print(f'UMM: image.source: "{shader_node.image.source}"') print(f'UMM: image.file_format: "{shader_node.image.file_format}"') value = shader_node.image.filepath if (shader_node.image.source == 'TILED'): # Find all numbers in the path. numbers = re.findall('[0-9]+', value) if (len(numbers) > 0): # Get the string representation of the last number. num_str = str(numbers[-1]) # Replace the number substring with '<UDIM>'. split_items = value.rsplit(num_str, 1) if (len(split_items) == 2): value = split_items[0] + '<UDIM>' + split_items[1] try: if value is None or value == '': file_format = shader_node.image.file_format if file_format.lower() == 'open_exr': file_format = 'exr' value = f'{shader_node.image.name}.{file_format}' output.value = [value, shader_node.image.colorspace_settings.name] else: output.value = [os.path.abspath(bpy.path.abspath(value)), shader_node.image.colorspace_settings.name] except Exception as error: print('Warning: Universal Material Map: Unable to evaluate absolute file path of texture "{0}". Detail: {1}'.format(shader_node.image.filepath, error)) output.value = ['', 'raw'] print(f'UMM: output.value: "{output.value}"') else: if developer_mode: print('setting default value for output.value') if not shader_node.image: print('\tshader_node.image == None') else: print('\tshader_node.image.source == {}'.format(shader_node.image.source)) output.value = ['', 'raw'] if developer_mode: print('output.value', output.value) break raise NotImplementedError(f"No support for bpy.types.ShaderNodeTexImage {map_definition['blender_socket']}") if isinstance(shader_node, bpy.types.ShaderNodeBsdfPrincipled): socket: bpy.types.NodeSocketStandard = shader_node.inputs[map_definition['blender_socket']] output.value = socket.default_value if developer_mode: print('output.value', output.value) break if isinstance(shader_node, bpy.types.ShaderNodeGroup): if map_definition['blender_socket'] not in shader_node.inputs.keys(): if developer_mode: print(f'{map_definition["blender_socket"]} not in shader_node.inputs.keys()') break socket: bpy.types.NodeSocketStandard = shader_node.inputs[map_definition['blender_socket']] output.value = socket.default_value if developer_mode: print('output.value', output.value) break if isinstance(shader_node, bpy.types.ShaderNodeMapping): socket: bpy.types.NodeSocketStandard = shader_node.inputs[map_definition['blender_socket']] value = socket.default_value if output.name == 'Rotation': value = [ math.degrees(value[0]), math.degrees(value[1]), math.degrees(value[2]) ] output.value = value if developer_mode: print('output.value', output.value) break # compute to target_instance for output target_instance = conversion_graph.get_output_entity() if developer_mode: print('_instance_to_data') print('\ttarget_instance.target.store_id', target_instance.target.store_id) # Compute target attribute values attribute_data = [(util.TARGET_CLASS_IDENTIFIER, target_instance.target.root_node.class_name)] for plug in target_instance.inputs: if not plug.input: continue if developer_mode: print('\t{} is invalid: {}'.format(plug.name, plug.is_invalid)) if plug.is_invalid and isinstance(plug.parent, DagNode): plug.parent.compute() if developer_mode: print('\t{} computed value = {}'.format(plug.name, plug.computed_value)) value = plug.computed_value if plug.internal_value_type == 'bool': value = True if value else False attribute_data.append((plug.name, value)) return attribute_data def can_convert_attribute_values(self, instance: object, render_context: str, destination: object) -> bool: """ Resolves if the instance's attribute values can be converted and set on the destination object's attributes. """ raise NotImplementedError() def convert_attribute_values(self, instance: object, render_context: str, destination: object) -> typing.NoReturn: """ Attribute values are converted and set on the destination object's attributes. """ raise NotImplementedError() def can_apply_data_to_instance(self, source_class_name: str, render_context: str, source_data: typing.List[typing.Tuple[str, typing.Any]], instance: object) -> bool: """ Resolves if worker can convert the instance to another object given the render_context. """ if developer_mode: print('can_apply_data_to_instance()') if not isinstance(instance, bpy.types.Material): if developer_mode: print('can_apply_data_to_instance: FALSE - instance not bpy.types.Material') return False if not render_context == 'Blender': if developer_mode: print('can_apply_data_to_instance: FALSE - render_context not "Blender"') return False conversion_graph = _get_conversion_graph_impl(source_class=source_class_name, render_context=render_context) if not conversion_graph: if developer_mode: print('can_apply_data_to_instance: FALSE - conversion_graph is None') return False if developer_mode: print(f'conversion_graph {conversion_graph.filename}') try: destination_target_instance = _data_to_output_entity(graph=conversion_graph, data=source_data) except Exception as error: print('Warning: Unable to get destination assembly using document "{0}".\nDetails: {1}'.format(conversion_graph.filename, error)) return False if developer_mode: if destination_target_instance is None: print('destination_target_instance is None') elif destination_target_instance is None: print('destination_target_instance.target is None') else: print('destination_target_instance.target is not None') if destination_target_instance is None or destination_target_instance.target is None: return False if developer_mode: print(f'num destination_target_instance.target.nodes: {len(destination_target_instance.target.nodes)}') if len(destination_target_instance.target.nodes) < 2: return True template, template_map = get_template_data_by_class_name(class_name=destination_target_instance.target.root_node.class_name) if developer_mode: print(f'return {template is not None}') return template is not None def apply_data_to_instance(self, source_class_name: str, render_context: str, source_data: typing.List[typing.Tuple[str, typing.Any]], instance: object) -> None: """ Implementation requires that `instance` is type `bpy.types.Material`. """ if developer_mode: print('apply_data_to_instance()') if not isinstance(instance, bpy.types.Material): raise Exception('instance type not supported', type(instance)) if not render_context == 'Blender': raise Exception('render_context not supported', render_context) conversion_graph = _get_conversion_graph_impl(source_class=source_class_name, render_context=render_context) # This only works for Blender import of MDL/USDPreview. Blender export would need to use convert_instance_to_data(). destination_target_instance = _data_to_output_entity(graph=conversion_graph, data=source_data) material: bpy.types.Material = instance # Make sure we're using nodes material.use_nodes = True # Remove existing nodes - we're starting from scratch - assuming Blender import to_delete = [o for o in material.node_tree.nodes] while len(to_delete): material.node_tree.nodes.remove(to_delete.pop()) if len(destination_target_instance.target.nodes) < 2: # Create base graph output_node = material.node_tree.nodes.new('ShaderNodeOutputMaterial') output_node.location = [300.0, 300.0] bsdf_node = material.node_tree.nodes.new('ShaderNodeBsdfPrincipled') bsdf_node.location = [0.0, 300.0] material.node_tree.links.new(bsdf_node.outputs[0], output_node.inputs[0]) node_cache = dict() node_location = [-500, 300] # Create graph if texture value for plug in destination_target_instance.inputs: if not plug.input: continue if isinstance(plug.computed_value, list) or isinstance(plug.computed_value, tuple): if len(plug.computed_value) == 2 and isinstance(plug.computed_value[0], str) and isinstance(plug.computed_value[1], str): key = '{0}|{1}'.format(plug.computed_value[0], plug.computed_value[1]) if key in node_cache.keys(): node = node_cache[key] else: try: path = plug.computed_value[0] if not path == '': node = material.node_tree.nodes.new('ShaderNodeTexImage') path = plug.computed_value[0] if '<UDIM>' in path: pattern = path.replace('\\', '/') pattern = pattern.replace('<UDIM>', '[0-9][0-9][0-9][0-9]') directory = pattern[:pattern.rfind('/') + 1] pattern = pattern.replace(directory, '') image_set = False for item in os.listdir(directory): if re.match(pattern, item): tile_path = '{}{}'.format(directory, item) if not os.path.isfile(tile_path): continue if not image_set: node.image = bpy.data.images.load(tile_path) node.image.source = 'TILED' image_set = True continue tile_indexes = re.findall('[0-9][0-9][0-9][0-9]', item) node.image.tiles.new(int(tile_indexes[-1])) else: node.image = bpy.data.images.load(path) node.image.colorspace_settings.name = plug.computed_value[1] else: continue except Exception as error: print('Warning: UMM failed to properly setup a ShaderNodeTexImage. Details: {0}\n{1}'.format(error, traceback.format_exc())) continue node_cache[key] = node node.location = node_location node_location[1] -= 300 bsdf_input = [o for o in bsdf_node.inputs if o.name == plug.name][0] if plug.name == 'Metallic': separate_node = None for link in material.node_tree.links: if link.from_node == node and link.to_node.__class__.__name__ == 'ShaderNodeSeparateRGB': separate_node = link.to_node break if separate_node is None: separate_node = material.node_tree.nodes.new('ShaderNodeSeparateRGB') separate_node.location = [node.location[0] + 250, node.location[1]] material.node_tree.links.new(node.outputs[0], separate_node.inputs[0]) material.node_tree.links.new(separate_node.outputs[2], bsdf_input) elif plug.name == 'Roughness': separate_node = None for link in material.node_tree.links: if link.from_node == node and link.to_node.__class__.__name__ == 'ShaderNodeSeparateRGB': separate_node = link.to_node break if separate_node is None: separate_node = material.node_tree.nodes.new('ShaderNodeSeparateRGB') separate_node.location = [node.location[0] + 250, node.location[1]] material.node_tree.links.new(node.outputs[0], separate_node.inputs[0]) material.node_tree.links.new(separate_node.outputs[1], bsdf_input) elif plug.name == 'Normal': normal_node = None for link in material.node_tree.links: if link.from_node == node and link.to_node.__class__.__name__ == 'ShaderNodeNormalMap': normal_node = link.to_node break if normal_node is None: normal_node = material.node_tree.nodes.new('ShaderNodeNormalMap') normal_node.location = [node.location[0] + 250, node.location[1]] material.node_tree.links.new(node.outputs[0], normal_node.inputs[1]) material.node_tree.links.new(normal_node.outputs[0], bsdf_input) else: material.node_tree.links.new(node.outputs[0], bsdf_input) continue # Set Value blender_inputs = [o for o in bsdf_node.inputs if o.name == plug.name] if len(blender_inputs) == 0: for property_name, property_object in bsdf_node.rna_type.properties.items(): if not property_name == plug.name: continue if property_object.is_readonly: break try: setattr(bsdf_node, property_name, plug.computed_value) except Exception as error: print('Warning: Universal Material Map: Unexpected error when setting property "{0}" to value "{1}": "{2}"'.format(property_name, plug.computed_value, error)) else: if isinstance(blender_inputs[0], bpy.types.NodeSocketShader): continue try: blender_inputs[0].default_value = plug.computed_value except Exception as error: print('Warning: Universal Material Map: Unexpected error when setting input "{0}" to value "{1}": "{2}"'.format(plug.name, plug.computed_value, error)) return if developer_mode: print(f'TEMPLATE CREATION BASED ON {destination_target_instance.target.root_node.class_name}') # find template to use template, template_map = get_template_data_by_class_name(class_name=destination_target_instance.target.root_node.class_name) if developer_mode: print(f"TEMPLATE NAME {template['name']}") # create graph create_from_template(material=material, template=template) # set attributes use_albedo_map = False use_normal_map = False use_detail_normal_map = False use_emission_map = False for input_plug in destination_target_instance.inputs: # if developer_mode: # print('input_plug', input_plug.name) internal_node = None for a in destination_target_instance.target.nodes: for b in a.inputs: if input_plug.id == b.id: internal_node = a break if internal_node is not None: break if internal_node is None: raise NotImplementedError(f"No internal node found for {input_plug.name}") map_definition = None for o in template_map['maps']: if o['blender_node'] == internal_node.id and o['blender_socket'] == input_plug.name: map_definition = o break if map_definition is None: raise NotImplementedError(f"No map definition found for {internal_node.id} {input_plug.name}") for shader_node in material.node_tree.nodes: if not shader_node.name == map_definition['blender_node']: continue # if developer_mode: # print(f'node: {shader_node.name}') if isinstance(shader_node, bpy.types.ShaderNodeTexImage): if map_definition['blender_socket'] == 'image': # if developer_mode: # print(f'\tbpy.types.ShaderNodeTexImage: path: {input_plug.computed_value[0]}') # print(f'\tbpy.types.ShaderNodeTexImage: colorspace: {input_plug.computed_value[1]}') path = input_plug.computed_value[0] if not path == '': if '<UDIM>' in path: pattern = path.replace('\\', '/') pattern = pattern.replace('<UDIM>', '[0-9][0-9][0-9][0-9]') directory = pattern[:pattern.rfind('/') + 1] pattern = pattern.replace(directory, '') image_set = False for item in os.listdir(directory): if re.match(pattern, item): tile_path = '{}{}'.format(directory, item) if not os.path.isfile(tile_path): continue if not image_set: shader_node.image = bpy.data.images.load(tile_path) shader_node.image.source = 'TILED' image_set = True continue tile_indexes = re.findall('[0-9][0-9][0-9][0-9]', item) shader_node.image.tiles.new(int(tile_indexes[-1])) else: shader_node.image = bpy.data.images.load(path) if map_definition['blender_node'] == 'Albedo Map': use_albedo_map = True if map_definition['blender_node'] == 'Normal Map': use_normal_map = True if map_definition['blender_node'] == 'Detail Normal Map': use_detail_normal_map = True if map_definition['blender_node'] == 'Emissive Map': use_emission_map = True shader_node.image.colorspace_settings.name = input_plug.computed_value[1] continue raise NotImplementedError( f"No support for bpy.types.ShaderNodeTexImage {map_definition['blender_socket']}") if isinstance(shader_node, bpy.types.ShaderNodeBsdfPrincipled): blender_inputs = [o for o in shader_node.inputs if o.name == input_plug.name] if len(blender_inputs) == 0: for property_name, property_object in shader_node.rna_type.properties.items(): if not property_name == input_plug.name: continue if property_object.is_readonly: break try: setattr(shader_node, property_name, input_plug.computed_value) except Exception as error: print('Warning: Universal Material Map: Unexpected error when setting property "{0}" to value "{1}": "{2}"'.format(property_name, input_plug.computed_value, error)) else: if isinstance(blender_inputs[0], bpy.types.NodeSocketShader): continue try: blender_inputs[0].default_value = input_plug.computed_value except Exception as error: print('Warning: Universal Material Map: Unexpected error when setting input "{0}" to value "{1}": "{2}"'.format(input_plug.name, input_plug.computed_value, error)) continue if isinstance(shader_node, bpy.types.ShaderNodeGroup): blender_inputs = [o for o in shader_node.inputs if o.name == input_plug.name] if len(blender_inputs) == 0: for property_name, property_object in shader_node.rna_type.properties.items(): if not property_name == input_plug.name: continue if property_object.is_readonly: break try: setattr(shader_node, property_name, input_plug.computed_value) except Exception as error: print('Warning: Universal Material Map: Unexpected error when setting property "{0}" to value "{1}": "{2}"'.format(property_name, input_plug.computed_value, error)) else: if isinstance(blender_inputs[0], bpy.types.NodeSocketShader): continue try: blender_inputs[0].default_value = input_plug.computed_value except Exception as error: print('Warning: Universal Material Map: Unexpected error when setting input "{0}" to value "{1}": "{2}"'.format(input_plug.name, input_plug.computed_value, error)) continue if isinstance(shader_node, bpy.types.ShaderNodeMapping): blender_inputs = [o for o in shader_node.inputs if o.name == input_plug.name] value = input_plug.computed_value if input_plug.name == 'Rotation': value[0] = math.radians(value[0]) value[1] = math.radians(value[1]) value[2] = math.radians(value[2]) if len(blender_inputs) == 0: for property_name, property_object in shader_node.rna_type.properties.items(): if not property_name == input_plug.name: continue if property_object.is_readonly: break try: setattr(shader_node, property_name, value) except Exception as error: print('Warning: Universal Material Map: Unexpected error when setting property "{0}" to value "{1}": "{2}"'.format(property_name, input_plug.computed_value, error)) else: if isinstance(blender_inputs[0], bpy.types.NodeSocketShader): continue try: blender_inputs[0].default_value = value except Exception as error: print('Warning: Universal Material Map: Unexpected error when setting input "{0}" to value "{1}": "{2}"'.format(input_plug.name, input_plug.computed_value, error)) continue # UX assist with special attributes for shader_node in material.node_tree.nodes: if shader_node.name == 'OmniPBR Compute' and isinstance(shader_node, bpy.types.ShaderNodeGroup): shader_node.inputs['Use Albedo Map'].default_value = 1 if use_albedo_map else 0 shader_node.inputs['Use Normal Map'].default_value = 1 if use_normal_map else 0 shader_node.inputs['Use Detail Normal Map'].default_value = 1 if use_detail_normal_map else 0 shader_node.inputs['Use Emission Map'].default_value = 1 if use_emission_map else 0 break class DataConverter(CoreConverter, IDataConverter): """ """ def can_convert_data_to_data(self, class_name: str, render_context: str, source_data: typing.List[typing.Tuple[str, typing.Any]]) -> bool: """ Resolves if worker can convert the given class and source_data to another class and target data. """ conversion_graph = _get_conversion_graph_impl(source_class=class_name, render_context=render_context) if not conversion_graph: return False try: destination_target_instance = _data_to_output_entity(graph=conversion_graph, data=source_data) except Exception as error: print('Warning: Unable to get destination assembly using document "{0}".\nDetails: {1}'.format(conversion_graph.filename, error)) return False return destination_target_instance is not None def convert_data_to_data(self, class_name: str, render_context: str, source_data: typing.List[typing.Tuple[str, typing.Any]]) -> typing.List[typing.Tuple[str, typing.Any]]: """ Returns a list of key value pairs in tuples. The first pair is ("umm_target_class", "the_class_name") indicating the conversion target class. """ if developer_mode: print('UMM DEBUG: DataConverter.convert_data_to_data()') print('\tclass_name="{0}"'.format(class_name)) print('\trender_context="{0}"'.format(render_context)) print('\tsource_data=[') for o in source_data: if o[1] == '': print('\t\t("{0}", ""),'.format(o[0])) continue print('\t\t("{0}", {1}),'.format(o[0], o[1])) print('\t]') conversion_graph = _get_conversion_graph_impl(source_class=class_name, render_context=render_context) destination_target_instance = _data_to_output_entity(graph=conversion_graph, data=source_data) attribute_data = [(util.TARGET_CLASS_IDENTIFIER, destination_target_instance.target.root_node.class_name)] for plug in destination_target_instance.inputs: if not plug.input: continue if plug.is_invalid and isinstance(plug.parent, DagNode): plug.parent.compute() attribute_data.append((plug.name, plug.computed_value)) return attribute_data class OT_InstanceToDataConverter(bpy.types.Operator): bl_idname = 'universalmaterialmap.instance_to_data_converter' bl_label = 'Universal Material Map Converter Operator' bl_description = 'Universal Material Map Converter' def execute(self, context): print('Conversion Operator: execute') # Get object by name: bpy.data.objects['Cube'] # Get material by name: bpy.data.materials['MyMaterial'] # node = [o for o in bpy.context.active_object.active_material.node_tree.nodes if o.select][0] print('selected_node', bpy.context.active_object, type(bpy.context.active_object)) # print('\n'.join(dir(bpy.context.active_object))) material_slot: bpy.types.MaterialSlot # https://docs.blender.org/api/current/bpy.types.MaterialSlot.html?highlight=materialslot#bpy.types.MaterialSlot for material_slot in bpy.context.active_object.material_slots: material: bpy.types.Material = material_slot.material if material.node_tree: for node in material.node_tree.nodes: if isinstance(node, bpy.types.ShaderNodeOutputMaterial): for input in node.inputs: if not input.type == 'SHADER': continue if not input.is_linked: continue for link in input.links: if not isinstance(link, bpy.types.NodeLink): continue if not link.is_valid: continue instance = link.from_node for render_context in ['MDL', 'USDPreview']: if util.can_convert_instance_to_data(instance=instance, render_context=render_context): util.convert_instance_to_data(instance=instance, render_context=render_context) else: print('Information: Universal Material Map: Not able to convert instance "{0}" to data with render context "{1}"'.format(instance, render_context)) else: instance = material for render_context in ['MDL', 'USDPreview']: if util.can_convert_instance_to_data(instance=instance, render_context=render_context): util.convert_instance_to_data(instance=instance, render_context=render_context) else: print('Information: Universal Material Map: Not able to convert instance "{0}" to data with render context "{1}"'.format(instance, render_context)) return {'FINISHED'} class OT_DataToInstanceConverter(bpy.types.Operator): bl_idname = 'universalmaterialmap.data_to_instance_converter' bl_label = 'Universal Material Map Converter Operator' bl_description = 'Universal Material Map Converter' def execute(self, context): render_context = 'Blender' source_class = 'OmniPBR.mdl|OmniPBR' sample_data = [ ('diffuse_color_constant', (0.800000011920929, 0.800000011920929, 0.800000011920929)), ('diffuse_texture', ''), ('reflection_roughness_constant', 0.4000000059604645), ('reflectionroughness_texture', ''), ('metallic_constant', 0.0), ('metallic_texture', ''), ('specular_level', 0.5), ('enable_emission', True), ('emissive_color', (0.0, 0.0, 0.0)), ('emissive_color_texture', ''), ('emissive_intensity', 1.0), ('normalmap_texture', ''), ('enable_opacity', True), ('opacity_constant', 1.0), ] if util.can_convert_data_to_data(class_name=source_class, render_context=render_context, source_data=sample_data): converted_data = util.convert_data_to_data(class_name=source_class, render_context=render_context, source_data=sample_data) destination_class = converted_data[0][1] if util.can_create_instance(class_name=destination_class): instance = util.create_instance(class_name=destination_class) print('instance "{0}".'.format(instance)) temp = converted_data[:] while len(temp): item = temp.pop(0) property_name = item[0] property_value = item[1] if util.can_set_instance_attribute(instance=instance, name=property_name): util.set_instance_attribute(instance=instance, name=property_name, value=property_value) else: print('Cannot create instance from "{0}".'.format(source_class)) return {'FINISHED'} class OT_DataToDataConverter(bpy.types.Operator): bl_idname = 'universalmaterialmap.data_to_data_converter' bl_label = 'Universal Material Map Converter Operator' bl_description = 'Universal Material Map Converter' def execute(self, context): render_context = 'Blender' source_class = 'OmniPBR.mdl|OmniPBR' sample_data = [ ('diffuse_color_constant', (0.800000011920929, 0.800000011920929, 0.800000011920929)), ('diffuse_texture', ''), ('reflection_roughness_constant', 0.4000000059604645), ('reflectionroughness_texture', ''), ('metallic_constant', 0.0), ('metallic_texture', ''), ('specular_level', 0.5), ('enable_emission', True), ('emissive_color', (0.0, 0.0, 0.0)), ('emissive_color_texture', ''), ('emissive_intensity', 1.0), ('normalmap_texture', ''), ('enable_opacity', True), ('opacity_constant', 1.0), ] if util.can_convert_data_to_data(class_name=source_class, render_context=render_context, source_data=sample_data): converted_data = util.convert_data_to_data(class_name=source_class, render_context=render_context, source_data=sample_data) print('converted_data:', converted_data) else: print('UMM Failed to convert data. util.can_convert_data_to_data() returned False') return {'FINISHED'} class OT_ApplyDataToInstance(bpy.types.Operator): bl_idname = 'universalmaterialmap.apply_data_to_instance' bl_label = 'Universal Material Map Apply Data To Instance Operator' bl_description = 'Universal Material Map Converter' def execute(self, context): if not bpy.context: return {'FINISHED'} if not bpy.context.active_object: return {'FINISHED'} if not bpy.context.active_object.active_material: return {'FINISHED'} instance = bpy.context.active_object.active_material render_context = 'Blender' source_class = 'OmniPBR.mdl|OmniPBR' sample_data = [ ('albedo_add', 0.02), # Adds a constant value to the diffuse color ('albedo_desaturation', 0.19999999), # Desaturates the diffuse color ('ao_texture', ('', 'raw')), ('ao_to_diffuse', 1), # Controls the amount of ambient occlusion multiplied into the diffuse color channel ('bump_factor', 10), # Strength of normal map ('diffuse_color_constant', (0.800000011920929, 0.800000011920929, 0.800000011920929)), ('diffuse_texture', ('D:/Blender_GTC_2021/Marbles/assets/standalone/A_bumper/textures/play_bumper/blue/play_bumperw_albedo.png', 'sRGB')), ('diffuse_tint', (0.96202534, 0.8118357, 0.8118357)), # When enabled, this color value is multiplied over the final albedo color ('enable_emission', 0), ('enable_ORM_texture', 1), ('metallic_constant', 1), ('metallic_texture', ('', 'raw')), ('metallic_texture_influence', 1), ('normalmap_texture', ('D:/Blender_GTC_2021/Marbles/assets/standalone/A_bumper/textures/play_bumper/blue/play_bumperw_normal.png', 'raw')), ('ORM_texture', ('D:/Blender_GTC_2021/Marbles/assets/standalone/A_bumper/textures/play_bumper/blue/play_bumperw_orm.png', 'raw')), ('reflection_roughness_constant', 1), # Higher roughness values lead to more blurry reflections ('reflection_roughness_texture_influence', 1), # Blends between the constant value and the lookup of the roughness texture ('reflectionroughness_texture', ('', 'raw')), ('texture_rotate', 45), ('texture_scale', (2, 2)), ('texture_translate', (0.1, 0.9)), ] if util.can_apply_data_to_instance(source_class_name=source_class, render_context=render_context, source_data=sample_data, instance=instance): util.apply_data_to_instance(source_class_name=source_class, render_context=render_context, source_data=sample_data, instance=instance) else: print('UMM Failed to convert data. util.can_convert_data_to_data() returned False') return {'FINISHED'} class OT_CreateTemplateOmniPBR(bpy.types.Operator): bl_idname = 'universalmaterialmap.create_template_omnipbr' bl_label = 'Convert to OmniPBR Graph' bl_description = 'Universal Material Map Converter' def execute(self, context): if not bpy.context: return {'FINISHED'} if not bpy.context.active_object: return {'FINISHED'} if not bpy.context.active_object.active_material: return {'FINISHED'} create_template(source_class='OmniPBR', material=bpy.context.active_object.active_material) return {'FINISHED'} class OT_CreateTemplateOmniGlass(bpy.types.Operator): bl_idname = 'universalmaterialmap.create_template_omniglass' bl_label = 'Convert to OmniGlass Graph' bl_description = 'Universal Material Map Converter' def execute(self, context): if not bpy.context: return {'FINISHED'} if not bpy.context.active_object: return {'FINISHED'} if not bpy.context.active_object.active_material: return {'FINISHED'} create_template(source_class='OmniGlass', material=bpy.context.active_object.active_material) return {'FINISHED'} class OT_DescribeShaderGraph(bpy.types.Operator): bl_idname = 'universalmaterialmap.describe_shader_graph' bl_label = 'Universal Material Map Describe Shader Graph Operator' bl_description = 'Universal Material Map' @staticmethod def describe_node(node) -> dict: node_definition = dict() node_definition['name'] = node.name node_definition['label'] = node.label node_definition['location'] = [node.location[0], node.location[1]] node_definition['width'] = node.width node_definition['height'] = node.height node_definition['parent'] = node.parent.name if node.parent else None node_definition['class'] = type(node).__name__ node_definition['inputs'] = [] node_definition['outputs'] = [] node_definition['nodes'] = [] node_definition['links'] = [] node_definition['properties'] = [] node_definition['texts'] = [] if node_definition['class'] == 'NodeFrame': node_definition['properties'].append( { 'name': 'use_custom_color', 'value': node.use_custom_color, } ) node_definition['properties'].append( { 'name': 'color', 'value': [node.color[0], node.color[1], node.color[2]], } ) node_definition['properties'].append( { 'name': 'shrink', 'value': node.shrink, } ) if node.text is not None: text_definition = dict() text_definition['name'] = node.text.name text_definition['contents'] = node.text.as_string() node_definition['texts'].append(text_definition) elif node_definition['class'] == 'ShaderNodeRGB': for index, output in enumerate(node.outputs): definition = dict() definition['index'] = index definition['name'] = output.name definition['class'] = type(output).__name__ if definition['class'] == 'NodeSocketColor': default_value = output.default_value definition['default_value'] = [default_value[0], default_value[1], default_value[2], default_value[3]] else: raise NotImplementedError() node_definition['outputs'].append(definition) elif node_definition['class'] == 'ShaderNodeMixRGB': node_definition['properties'].append( { 'name': 'blend_type', 'value': node.blend_type, } ) node_definition['properties'].append( { 'name': 'use_clamp', 'value': node.use_clamp, } ) for index, input in enumerate(node.inputs): definition = dict() definition['index'] = index definition['name'] = input.name definition['class'] = type(input).__name__ if definition['class'] == 'NodeSocketFloatFactor': definition['default_value'] = node.inputs[input.name].default_value elif definition['class'] == 'NodeSocketColor': default_value = node.inputs[input.name].default_value definition['default_value'] = [default_value[0], default_value[1], default_value[2], default_value[3]] else: raise NotImplementedError() node_definition['inputs'].append(definition) elif node_definition['class'] == 'ShaderNodeGroup': for index, input in enumerate(node.inputs): definition = dict() definition['index'] = index definition['name'] = input.name definition['class'] = type(input).__name__ if definition['class'] == 'NodeSocketFloatFactor': definition['min_value'] = node.node_tree.inputs[input.name].min_value definition['max_value'] = node.node_tree.inputs[input.name].max_value definition['default_value'] = node.inputs[input.name].default_value elif definition['class'] == 'NodeSocketIntFactor': definition['min_value'] = node.node_tree.inputs[input.name].min_value definition['max_value'] = node.node_tree.inputs[input.name].max_value definition['default_value'] = node.inputs[input.name].default_value elif definition['class'] == 'NodeSocketColor': default_value = node.inputs[input.name].default_value definition['default_value'] = [default_value[0], default_value[1], default_value[2], default_value[3]] else: raise NotImplementedError() node_definition['inputs'].append(definition) for index, output in enumerate(node.outputs): definition = dict() definition['index'] = index definition['name'] = output.name definition['class'] = type(output).__name__ node_definition['outputs'].append(definition) for child in node.node_tree.nodes: node_definition['nodes'].append(OT_DescribeShaderGraph.describe_node(child)) for link in node.node_tree.links: if not isinstance(link, bpy.types.NodeLink): continue if not link.is_valid: continue link_definition = dict() link_definition['from_node'] = link.from_node.name link_definition['from_socket'] = link.from_socket.name link_definition['to_node'] = link.to_node.name link_definition['to_socket'] = link.to_socket.name node_definition['links'].append(link_definition) elif node_definition['class'] == 'ShaderNodeUVMap': pass elif node_definition['class'] == 'ShaderNodeTexImage': pass elif node_definition['class'] == 'ShaderNodeOutputMaterial': pass elif node_definition['class'] == 'ShaderNodeBsdfPrincipled': pass elif node_definition['class'] == 'ShaderNodeMapping': pass elif node_definition['class'] == 'ShaderNodeNormalMap': pass elif node_definition['class'] == 'ShaderNodeHueSaturation': pass elif node_definition['class'] == 'ShaderNodeSeparateRGB': pass elif node_definition['class'] == 'NodeGroupInput': pass elif node_definition['class'] == 'NodeGroupOutput': pass elif node_definition['class'] == 'ShaderNodeMath': node_definition['properties'].append( { 'name': 'operation', 'value': node.operation, } ) node_definition['properties'].append( { 'name': 'use_clamp', 'value': node.use_clamp, } ) elif node_definition['class'] == 'ShaderNodeVectorMath': node_definition['properties'].append( { 'name': 'operation', 'value': node.operation, } ) else: raise NotImplementedError(node_definition['class']) return node_definition def execute(self, context): material = bpy.context.active_object.active_material output = dict() output['name'] = 'Principled Omni Glass' output['nodes'] = [] output['links'] = [] for node in material.node_tree.nodes: output['nodes'].append(OT_DescribeShaderGraph.describe_node(node)) for link in material.node_tree.links: if not isinstance(link, bpy.types.NodeLink): continue if not link.is_valid: continue link_definition = dict() link_definition['from_node'] = link.from_node.name link_definition['from_socket'] = link.from_socket.name link_definition['to_node'] = link.to_node.name link_definition['to_socket'] = link.to_socket.name output['links'].append(link_definition) print(json.dumps(output, indent=4)) return {'FINISHED'} def initialize(): if getattr(sys.modules[__name__], '__initialized'): return setattr(sys.modules[__name__], '__initialized', True) util.register(converter=DataConverter()) util.register(converter=ObjectConverter()) print('Universal Material Map: Registered Converter classes.') initialize()
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/blender/material.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. import typing import traceback import bpy from ..core.converter import util def apply_data_to_instance(instance_name: str, source_class: str, render_context: str, source_data: typing.List[typing.Tuple[str, typing.Any]]) -> dict: try: for material in bpy.data.materials: if not isinstance(material, bpy.types.Material): continue if material.name == instance_name: if util.can_apply_data_to_instance(source_class_name=source_class, render_context=render_context, source_data=source_data, instance=material): return util.apply_data_to_instance(source_class_name=source_class, render_context=render_context, source_data=source_data, instance=material) print(f'Omniverse UMM: Unable to apply data at import for material "{instance_name}". This is not an error - just means that conversion data does not support the material.') result = dict() result['umm_notification'] = 'incomplete_process' result['message'] = 'Not able to convert type "{0}" for render context "{1}" because there is no Conversion Graph for that scenario. No changes were applied to "{2}".'.format(source_class, render_context, instance_name) return result except Exception as error: print('Warning: Universal Material Map: function "apply_data_to_instance": Unexpected error:') print('\targument "instance_name" = "{0}"'.format(instance_name)) print('\targument "source_class" = "{0}"'.format(source_class)) print('\targument "render_context" = "{0}"'.format(render_context)) print('\targument "source_data" = "{0}"'.format(source_data)) print('\terror: {0}'.format(error)) print('\tcallstack: {0}'.format(traceback.format_exc())) result = dict() result['umm_notification'] = 'unexpected_error' result['message'] = 'Not able to convert type "{0}" for render context "{1}" because there was an unexpected error. Some changes may have been applied to "{2}". Details: {3}'.format(source_class, render_context, instance_name, error) return result def convert_instance_to_data(instance_name: str, render_context: str) -> typing.List[typing.Tuple[str, typing.Any]]: try: for material in bpy.data.materials: if not isinstance(material, bpy.types.Material): continue if material.name == instance_name: if util.can_convert_instance_to_data(instance=material, render_context=render_context): return util.convert_instance_to_data(instance=material, render_context=render_context) result = dict() result['umm_notification'] = 'incomplete_process' result['message'] = 'Not able to convert material "{0}" for render context "{1}" because there is no Conversion Graph for that scenario.'.format(instance_name, render_context) return result except Exception as error: print('Warning: Universal Material Map: function "convert_instance_to_data": Unexpected error:') print('\targument "instance_name" = "{0}"'.format(instance_name)) print('\targument "render_context" = "{0}"'.format(render_context)) print('\terror: {0}'.format(error)) print('\tcallstack: {0}'.format(traceback.format_exc())) result = dict() result['umm_notification'] = 'unexpected_error' result['message'] = 'Not able to convert material "{0}" for render context "{1}" there was an unexpected error. Details: {2}'.format(instance_name, render_context, error) return result result = dict() result['umm_notification'] = 'incomplete_process' result['message'] = 'Not able to convert material "{0}" for render context "{1}" because there is no Conversion Graph for that scenario.'.format(instance_name, render_context) return result
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/blender/__init__.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. import typing import os import re import sys import json import bpy from ..core.data import Library from ..core.feature import POLLING from ..core.service import store from ..core.service import delegate LIBRARY_ID = '195c69e1-7765-4a16-bb3a-ecaa222876d9' __initialized = False developer_mode: bool = False CORE_MATERIAL_PROPERTIES = [ ('diffuse_color', 'RGBA'), ('metallic', 'VALUE'), ('specular_color', 'STRING'), ('roughness', 'VALUE'), ('use_backface_culling', 'BOOLEAN'), ('blend_method', 'STRING'), ('shadow_method', 'STRING'), ('alpha_threshold', 'VALUE'), ('use_screen_refraction', 'BOOLEAN'), ('refraction_depth', 'VALUE'), ('use_sss_translucency', 'BOOLEAN'), ('pass_index', 'INT'), ] def show_message(message: str = '', title: str = 'Message Box', icon: str = 'INFO'): try: def draw(self, context): self.layout.label(text=message) bpy.context.window_manager.popup_menu(draw, title=title, icon=icon) except: print('{0}\n{1}'.format(title, message)) def initialize(): if getattr(sys.modules[__name__], '__initialized'): return setattr(sys.modules[__name__], '__initialized', True) directory = os.path.expanduser('~').replace('\\', '/') if not directory.endswith('/Documents'): directory = '{0}/Documents'.format(directory) directory = '{0}/Omniverse/Blender/UMMLibrary'.format(directory) library = Library.Create( library_id=LIBRARY_ID, name='Blender', manifest=delegate.FilesystemManifest(root_directory='{0}'.format(directory)), conversion_graph=delegate.Filesystem(root_directory='{0}/ConversionGraph'.format(directory)), target=delegate.Filesystem(root_directory='{0}/Target'.format(directory)), ) store.register_library(library=library) from ..blender import converter converter.initialize() from ..blender import generator generator.initialize() if POLLING: # TODO: On application exit > un_initialize() pass def un_initialize(): if POLLING: store.on_shutdown() def get_library(): """ :return: omni.universalmaterialmap.core.data.Library """ initialize() return store.get_library(library_id=LIBRARY_ID) def __get_value_impl(socket: bpy.types.NodeSocketStandard, depth=0, max_depth=100) -> typing.Any: # Local utility function which returns a file extension # corresponding to the given image file format string. # This mimics similar logic used in the Blender USD IO # C++ implementation. def get_extension_from_image_file_format(format): format = format.lower() if format == 'open_exr': format = 'exr' elif format == 'jpeg': format = 'jpg' return format debug = False if debug: print('__get_value_impl: depth={0}'.format(depth)) if depth > max_depth: if debug: print('\t reached max_depth ({0}). terminating recursion'.format(max_depth)) return None if debug: print('\tsocket.is_linked'.format(socket.is_linked)) if socket.is_linked: for link in socket.links: if not isinstance(link, bpy.types.NodeLink): if debug: print('\t\tlink is not bpy.types.NodeLink: {0}'.format(type(link))) continue if not link.is_valid: if debug: print('\t\tlink is not valid') continue instance = link.from_node if debug: print('\t\tlink.from_node: {0}'.format(type(instance))) if isinstance(instance, bpy.types.ShaderNodeTexImage): print(f'UMM: image.filepath: "{instance.image.filepath}"') print(f'UMM: image.source: "{instance.image.source}"') print(f'UMM: image.file_format: "{instance.image.file_format}"') if debug: print('\t\tinstance.image: {0}'.format(instance.image)) if instance.image: print('\t\tinstance.image.source: {0}'.format(instance.image.source)) if instance.image and (instance.image.source == 'FILE' or instance.image.source == 'TILED'): value = instance.image.filepath if (instance.image.source == 'TILED'): # Find all numbers in the path. numbers = re.findall('[0-9]+', value) if (len(numbers) > 0): # Get the string representation of the last number. num_str = str(numbers[-1]) # Replace the number substring with '<UDIM>'. split_items = value.rsplit(num_str, 1) if (len(split_items)==2): value = split_items[0] + '<UDIM>' + split_items[1] if debug: print('\t\tinstance.image.filepath: {0}'.format(value)) try: if value and instance.image.packed_file: # The image is packed, so ignore the filepath, which is likely # invalid, and return just the base name. value = bpy.path.basename(value) # Make sure the file has a valid extension for # the expected format. file_format = instance.image.file_format file_format = get_extension_from_image_file_format(file_format) value = bpy.path.ensure_ext(value, '.' + file_format) print(f'UMM: packed image data: "{[value, instance.image.colorspace_settings.name]}"') return [value, instance.image.colorspace_settings.name] if value is None or value == '': file_format = instance.image.file_format file_format = get_extension_from_image_file_format(file_format) value = f'{instance.image.name}.{file_format}' if debug: print(f'\t\tvalue: {value}') print(f'UMM: image data: "{[value, instance.image.colorspace_settings.name]}"') return [value, instance.image.colorspace_settings.name] return [os.path.abspath(bpy.path.abspath(value)), instance.image.colorspace_settings.name] except Exception as error: print('Warning: Universal Material Map: Unable to evaluate absolute file path of texture "{0}". Detail: {1}'.format(instance.image.filepath, error)) return None if isinstance(instance, bpy.types.ShaderNodeNormalMap): for o in instance.inputs: if o.name == 'Color': value = __get_value_impl(socket=o, depth=depth + 1, max_depth=max_depth) if value: return value for o in instance.inputs: value = __get_value_impl(socket=o, depth=depth + 1, max_depth=max_depth) if debug: print('\t\tre-entrant: input="{0}", value="{1}"'.format(o.name, value)) if value: return value return None def get_value(socket: bpy.types.NodeSocketStandard) -> typing.Any: debug = False value = __get_value_impl(socket=socket) if debug: print('get_value', value, socket.default_value) return socket.default_value if not value else value def _create_node_from_template(node_tree: bpy.types.NodeTree, node_definition: dict, parent: object = None) -> object: node = node_tree.nodes.new(node_definition['class']) if parent: node.parent = parent node.name = node_definition['name'] node.label = node_definition['label'] node.location = node_definition['location'] if node_definition['class'] == 'NodeFrame': node.width = node_definition['width'] node.height = node_definition['height'] for o in node_definition['properties']: setattr(node, o['name'], o['value']) if node_definition['class'] == 'NodeFrame': for text_definition in node_definition['texts']: existing = None for o in bpy.data.texts: if o.name == text_definition['name']: existing = o break if existing is None: existing = bpy.data.texts.new(text_definition['name']) existing.write(text_definition['contents']) node.text = existing node.location = node_definition['location'] elif node_definition['class'] == 'ShaderNodeGroup': node.node_tree = bpy.data.node_groups.new('node tree', 'ShaderNodeTree') child_cache = dict() for child_definition in node_definition['nodes']: child_cache[child_definition['name']] = _create_node_from_template(node_tree=node.node_tree, node_definition=child_definition) for input_definition in node_definition['inputs']: node.inputs.new(input_definition['class'], input_definition['name']) if input_definition['class'] == 'NodeSocketFloatFactor': node.node_tree.inputs[input_definition['name']].min_value = input_definition['min_value'] node.node_tree.inputs[input_definition['name']].max_value = input_definition['max_value'] node.node_tree.inputs[input_definition['name']].default_value = input_definition['default_value'] node.inputs[input_definition['name']].default_value = input_definition['default_value'] if input_definition['class'] == 'NodeSocketIntFactor': node.node_tree.inputs[input_definition['name']].min_value = input_definition['min_value'] node.node_tree.inputs[input_definition['name']].max_value = input_definition['max_value'] node.node_tree.inputs[input_definition['name']].default_value = input_definition['default_value'] node.inputs[input_definition['name']].default_value = input_definition['default_value'] if input_definition['class'] == 'NodeSocketColor': node.node_tree.inputs[input_definition['name']].default_value = input_definition['default_value'] node.inputs[input_definition['name']].default_value = input_definition['default_value'] for output_definition in node_definition['outputs']: node.outputs.new(output_definition['class'], output_definition['name']) for link_definition in node_definition['links']: from_node = child_cache[link_definition['from_node']] from_socket = [o for o in from_node.outputs if o.name == link_definition['from_socket']][0] to_node = child_cache[link_definition['to_node']] to_socket = [o for o in to_node.inputs if o.name == link_definition['to_socket']][0] node.node_tree.links.new(from_socket, to_socket) node.width = node_definition['width'] node.height = node_definition['height'] node.location = node_definition['location'] elif node_definition['class'] == 'ShaderNodeMixRGB': for input_definition in node_definition['inputs']: if input_definition['class'] == 'NodeSocketFloatFactor': node.inputs[input_definition['name']].default_value = input_definition['default_value'] if input_definition['class'] == 'NodeSocketColor': node.inputs[input_definition['name']].default_value = input_definition['default_value'] elif node_definition['class'] == 'ShaderNodeRGB': for output_definition in node_definition['outputs']: if output_definition['class'] == 'NodeSocketColor': node.outputs[output_definition['name']].default_value = output_definition['default_value'] return node def create_template(source_class: str, material: bpy.types.Material) -> None: template_filepath = '{}'.format(__file__).replace('\\', '/') template_filepath = template_filepath[:template_filepath.rfind('/')] template_filepath = '{}/template/{}.json'.format(template_filepath, source_class.lower()) if not os.path.exists(template_filepath): return with open(template_filepath, 'r') as template_file: template = json.load(template_file) # Make sure we're using nodes. material.use_nodes = True # Remove existing nodes - we're starting from scratch. to_delete = [o for o in material.node_tree.nodes] while len(to_delete): material.node_tree.nodes.remove(to_delete.pop()) # Create nodes according to template. child_cache = dict() for node_definition in template['nodes']: if node_definition['parent'] is None: node = _create_node_from_template(node_tree=material.node_tree, node_definition=node_definition) child_cache[node_definition['name']] = node for node_definition in template['nodes']: if node_definition['parent'] is not None: parent = child_cache[node_definition['parent']] node = _create_node_from_template(node_tree=material.node_tree, node_definition=node_definition, parent=parent) child_cache[node_definition['name']] = node for link_definition in template['links']: from_node = child_cache[link_definition['from_node']] from_socket = [o for o in from_node.outputs if o.name == link_definition['from_socket']][0] to_node = child_cache[link_definition['to_node']] to_socket = [o for o in to_node.inputs if o.name == link_definition['to_socket']][0] material.node_tree.links.new(from_socket, to_socket) def create_from_template(material: bpy.types.Material, template: dict) -> None: # Make sure we're using nodes. material.use_nodes = True # Create nodes according to template. child_cache = dict() for node_definition in template['nodes']: if node_definition['parent'] is None: node = _create_node_from_template(node_tree=material.node_tree, node_definition=node_definition) child_cache[node_definition['name']] = node for node_definition in template['nodes']: if node_definition['parent'] is not None: parent = child_cache[node_definition['parent']] node = _create_node_from_template(node_tree=material.node_tree, node_definition=node_definition, parent=parent) child_cache[node_definition['name']] = node for link_definition in template['links']: from_node = child_cache[link_definition['from_node']] from_socket = [o for o in from_node.outputs if o.name == link_definition['from_socket']][0] to_node = child_cache[link_definition['to_node']] to_socket = [o for o in to_node.inputs if o.name == link_definition['to_socket']][0] material.node_tree.links.new(from_socket, to_socket) def get_parent_material(shader_node: object) -> bpy.types.Material: for material in bpy.data.materials: if shader_node == material: return material if not material.use_nodes: continue if not material.node_tree or not material.node_tree.nodes: continue for node in material.node_tree.nodes: if shader_node == node: return material return None def get_template_data_by_shader_node(shader_node: object) -> typing.Tuple[typing.Dict, typing.Dict, str, bpy.types.Material]: material: bpy.types.Material = get_parent_material(shader_node=shader_node) if material and material.use_nodes and material.node_tree and material.node_tree.nodes: template_directory = '{}'.format(__file__).replace('\\', '/') template_directory = template_directory[:template_directory.rfind('/')] template_directory = f'{template_directory}/template' for item in os.listdir(template_directory): if item.lower().endswith('_map.json'): continue if not item.lower().endswith('.json'): continue template_filepath = f'{template_directory}/{item}' with open(template_filepath, 'r') as template_file: template = json.load(template_file) material_has_all_template_nodes = True for node_definition in template['nodes']: found_node = False for node in material.node_tree.nodes: if node.name == node_definition['name']: found_node = True break if not found_node: material_has_all_template_nodes = False break if not material_has_all_template_nodes: continue template_has_all_material_nodes = True for node in material.node_tree.nodes: found_template = False for node_definition in template['nodes']: if node.name == node_definition['name']: found_template = True break if not found_template: template_has_all_material_nodes = False break if not template_has_all_material_nodes: continue template_shader_name = template['name'] map_filename = '{}_map.json'.format(item[:item.rfind('.')]) template_map_filepath = f'{template_directory}/{map_filename}' with open(template_map_filepath, 'r') as template_map_file: template_map = json.load(template_map_file) return template, template_map, template_shader_name, material return None, None, None, None def get_template_data_by_class_name(class_name: str) -> typing.Tuple[typing.Dict, typing.Dict]: template_directory = '{}'.format(__file__).replace('\\', '/') template_directory = template_directory[:template_directory.rfind('/')] template_directory = f'{template_directory}/template' for item in os.listdir(template_directory): if item.lower().endswith('_map.json'): continue if not item.lower().endswith('.json'): continue template_filepath = f'{template_directory}/{item}' with open(template_filepath, 'r') as template_file: template = json.load(template_file) if not template['name'] == class_name: continue map_filename = '{}_map.json'.format(item[:item.rfind('.')]) template_map_filepath = f'{template_directory}/{map_filename}' with open(template_map_filepath, 'r') as template_map_file: template_map = json.load(template_map_file) return template, template_map return None, None
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/blender/menu.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. import bpy from . import developer_mode class UniversalMaterialMapMenu(bpy.types.Menu): bl_label = "Omniverse" bl_idname = "OBJECT_MT_umm_node_menu" def draw(self, context): layout = self.layout layout.operator('universalmaterialmap.create_template_omnipbr', text='Replace with OmniPBR graph template') layout.operator('universalmaterialmap.create_template_omniglass', text='Replace with OmniGlass graph template') if developer_mode: layout.operator('universalmaterialmap.generator', text='DEV: Generate Targets') layout.operator('universalmaterialmap.instance_to_data_converter', text='DEV: Convert Instance to Data') layout.operator('universalmaterialmap.data_to_instance_converter', text='DEV: Convert Data to Instance') layout.operator('universalmaterialmap.data_to_data_converter', text='DEV: Convert Data to Data') layout.operator('universalmaterialmap.apply_data_to_instance', text='DEV: Apply Data to Instance') layout.operator('universalmaterialmap.describe_shader_graph', text='DEV: Describe Shader Graph')
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/blender/generator.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # ##### END GPL LICENSE BLOCK ##### # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. import typing import sys import json import os import bpy import bpy_types from ..core.generator.core import IGenerator from ..core.generator import util from ..core.service import store from ..core.data import Library, Target, AssemblyMetadata, Client, Node, Plug from . import get_library, show_message, CORE_MATERIAL_PROPERTIES, get_template_data_by_shader_node __initialized: bool = False def _create_target(display_name, class_name): target = Target() target.display_name = display_name target.store_id = '{0}.json'.format(display_name) target.metadata.category = AssemblyMetadata.CATEGORY_CONNECTOR target.metadata.supported_clients.append(Client.Blender()) target.metadata.keywords.extend( [ 'Blender', class_name, display_name ] ) return target def _do_plug( node: Node, name: str, attribute_display_name: str, value_type: str, internal_value_type: str, default_value: typing.Any ) -> typing.Tuple[Plug, Plug]: if internal_value_type == 'STRING': default_value = str(default_value) if internal_value_type == 'INT': default_value = int(default_value) if internal_value_type == 'VALUE': default_value = float(default_value) if internal_value_type == 'VECTOR': default_value = list(default_value) if internal_value_type == 'RGBA': default_value = list(default_value) try: json.dumps(default_value) except TypeError as error: print('Warning: Universal Material Map: Unable to parse for a default value for property "{0}". Using "None" as default value. Error: {1}'.format(name, error)) default_value = None input_plug = None for existing_plug in node.inputs: if existing_plug.name == name: input_plug = existing_plug input_plug.display_name = attribute_display_name input_plug.value_type = value_type input_plug.default_value = default_value input_plug.value = default_value break if not input_plug: input_plug = Plug.Create( parent=node, name=name, display_name=attribute_display_name, value_type=value_type ) input_plug.default_value = default_value input_plug.value = default_value node.inputs.append(input_plug) input_plug.internal_value_type = internal_value_type output_plug = None for existing_plug in node.outputs: if existing_plug.name == name: output_plug = existing_plug output_plug.display_name = attribute_display_name output_plug.value_type = value_type output_plug.default_value = default_value output_plug.value = default_value output_plug.is_editable = True break if not output_plug: output_plug = Plug.Create( parent=node, name=name, display_name=attribute_display_name, value_type=value_type ) output_plug.default_value = default_value output_plug.value = default_value output_plug.is_editable = True node.outputs.append(output_plug) output_plug.internal_value_type = internal_value_type output_plug.is_editable = True return input_plug, output_plug class Generator(IGenerator): def __init__(self): super(Generator, self).__init__() def _to_value_type(self, internal_value_type): if internal_value_type == 'BOOLEAN': return Plug.VALUE_TYPE_BOOLEAN if internal_value_type == 'STRING': return Plug.VALUE_TYPE_STRING if internal_value_type == 'INT': return Plug.VALUE_TYPE_INTEGER if internal_value_type == 'VECTOR': return Plug.VALUE_TYPE_VECTOR3 if internal_value_type == 'RGBA': return Plug.VALUE_TYPE_VECTOR4 if internal_value_type == 'VALUE': return Plug.VALUE_TYPE_FLOAT if internal_value_type == 'CUSTOM': return Plug.VALUE_TYPE_ANY if internal_value_type == 'SHADER': return Plug.VALUE_TYPE_ANY if internal_value_type == 'OBJECT': return Plug.VALUE_TYPE_ANY if internal_value_type == 'IMAGE': return Plug.VALUE_TYPE_ANY if internal_value_type == 'GEOMETRY': return Plug.VALUE_TYPE_ANY if internal_value_type == 'COLLECTION': return Plug.VALUE_TYPE_ANY return Plug.VALUE_TYPE_ANY def can_generate_target(self, class_name: str) -> bool: """ """ return False def generate_target(self, class_name: str) -> typing.Tuple[Library, Target]: """ """ raise NotImplementedError() def can_generate_targets(self) -> bool: """ """ return False def generate_targets(self) -> typing.List[typing.Tuple[Library, Target]]: """ """ raise NotImplementedError() def can_generate_target_from_instance(self, instance: object) -> bool: """ """ print('can_generate_target_from_instance', instance) print('can_generate_target_from_instance', instance.__class__.__bases__) try: if isinstance(instance, bpy.types.Material) and not instance.node_tree: return True return bpy_types.ShaderNode in instance.__class__.__bases__ except Exception as error: print('WARNING: Universal Material Mapper experienced an error checking an instance ({0}) for base classes. Detail: {1}'.format(instance, error)) return False def generate_target_from_instance(self, instance: object) -> typing.Tuple[Library, Target]: """ """ display_name = '{0}'.format(instance.__class__.__name__) class_name = '{0}.{1}'.format(instance.__class__.__module__, instance.__class__.__name__) library = get_library() template, template_map, template_shader_name, material = get_template_data_by_shader_node(shader_node=instance) if template is None: existing_targets = store.find_assembly(assembly_class=class_name, library=library) if len(existing_targets) > 1: raise NotImplementedError('Found many existing assemblies for class name "{0}"'.format(class_name)) if len(existing_targets) == 0: target = _create_target(display_name=display_name, class_name=class_name) else: target = existing_targets[0] node = None for existing_node in target.nodes: if existing_node.class_name == class_name: node = existing_node break if not node: node = Node.Create(class_name=class_name) target.nodes.append(node) target.root_node = node if isinstance(instance, bpy.types.Material) and not instance.node_tree: for o in CORE_MATERIAL_PROPERTIES: name = o[0] if not hasattr(instance, name): continue attribute_display_name = o[0] internal_value_type = o[1] value_type = self._to_value_type(internal_value_type=internal_value_type) default_value = getattr(instance, name) _do_plug( node=node, name=name, attribute_display_name=attribute_display_name, value_type=value_type, internal_value_type=internal_value_type, default_value=default_value ) elif isinstance(instance, bpy_types.ShaderNode): o: bpy.types.NodeSocketStandard for o in instance.inputs: name = o.name attribute_display_name = o.name internal_value_type = str(o.type) value_type = self._to_value_type(internal_value_type=internal_value_type) default_value = o.default_value _do_plug( node=node, name=name, attribute_display_name=attribute_display_name, value_type=value_type, internal_value_type=internal_value_type, default_value=default_value ) else: existing_targets = store.find_assembly(assembly_class=template_shader_name, library=library) if len(existing_targets) > 1: raise NotImplementedError('Found many existing assemblies for class name "{0}"'.format(template_shader_name)) if len(existing_targets) == 0: target = _create_target(display_name=template_shader_name, class_name=template_shader_name) else: target = existing_targets[0] # set target.root_node target_node: Node = None for o in target.nodes: if o.class_name == template['name']: target_node = o break if target_node is None: target_node = Node.Create(class_name=template['name']) target.nodes.append(target_node) target.root_node = target_node # process node_definitions - only adds and updates - does not delete nodes for node_definition in template['nodes']: shader_node = None for o in material.node_tree.nodes: if o.name == node_definition['name']: shader_node = o break target_node: Node = None for o in target.nodes: if o.id == node_definition['name']: target_node = o break if target_node is None: target_node = Node.Create(class_name=node_definition['class']) target_node._id = node_definition['name'] target.nodes.append(target_node) for map_definition in template_map['maps']: if not map_definition['blender_node'] == node_definition['name']: continue if isinstance(shader_node, bpy.types.ShaderNodeTexImage): if map_definition['blender_socket'] == 'image': _do_plug( node=target_node, name=map_definition['blender_socket'], attribute_display_name=map_definition['umm_display_name'], value_type=Plug.VALUE_TYPE_STRING, internal_value_type='STRING', default_value=['', 'raw'] ) continue raise NotImplementedError(f"{type(shader_node)} {map_definition['blender_socket']}") if isinstance(shader_node, bpy.types.ShaderNodeGroup): socket: bpy.types.NodeSocketStandard = shader_node.inputs[map_definition['blender_socket']] internal_value_type = str(socket.type) value_type = self._to_value_type(internal_value_type=internal_value_type) default_value = socket.default_value _do_plug( node=target_node, name=map_definition['blender_socket'], attribute_display_name=map_definition['umm_display_name'], value_type=value_type, internal_value_type=internal_value_type, default_value=default_value ) continue if isinstance(shader_node, bpy.types.ShaderNodeBsdfPrincipled): socket: bpy.types.NodeSocketStandard = shader_node.inputs[map_definition['blender_socket']] internal_value_type = str(socket.type) value_type = self._to_value_type(internal_value_type=internal_value_type) default_value = socket.default_value _do_plug( node=target_node, name=map_definition['blender_socket'], attribute_display_name=map_definition['umm_display_name'], value_type=value_type, internal_value_type=internal_value_type, default_value=default_value ) continue if isinstance(shader_node, bpy.types.ShaderNodeMapping): socket: bpy.types.NodeSocketStandard = shader_node.inputs[map_definition['blender_socket']] internal_value_type = str(socket.type) value_type = self._to_value_type(internal_value_type=internal_value_type) if value_type == Plug.VALUE_TYPE_VECTOR3: if 'scale' in map_definition['blender_socket'].lower(): value_type = Plug.VALUE_TYPE_LIST elif 'location' in map_definition['blender_socket'].lower(): value_type = Plug.VALUE_TYPE_LIST elif 'rotation' in map_definition['blender_socket'].lower(): value_type = Plug.VALUE_TYPE_LIST default_value = socket.default_value _do_plug( node=target_node, name=map_definition['blender_socket'], attribute_display_name=map_definition['umm_display_name'], value_type=value_type, internal_value_type=internal_value_type, default_value=default_value ) continue raise NotImplementedError(map_definition['blender_node']) return library, target class OT_Generator(bpy.types.Operator): bl_idname = 'universalmaterialmap.generator' bl_label = 'Universal Material Map Generator Operator' bl_description = 'Universal Material Map Generator' def execute(self, context): if not bpy.context or not bpy.context.active_object or not bpy.context.active_object.active_material: show_message( message='Please select one shader node and try again.', title='Universal Material Map', icon='ERROR' ) return {'FINISHED'} instance = bpy.context.active_object.active_material if bpy.context.active_object.active_material.node_tree: selected_nodes = [o for o in bpy.context.active_object.active_material.node_tree.nodes if o.select] if not len(selected_nodes) == 1: show_message( message='Please select one shader node and try again.', title='Universal Material Map', icon='ERROR' ) # TODO: Show warning: https://blender.stackexchange.com/questions/109711/how-to-popup-simple-message-box-from-python-console return {'FINISHED'} instance = selected_nodes[0] if util.can_generate_target_from_instance(instance=instance): library, target = util.generate_target_from_instance(instance=instance) target.revision += 1 print('Universal Material Map: Writing Target "{0}" to library "{1}".'.format(target.display_name, library.name)) print('Universal Material Map: Target ID = "{0}".'.format(target.id)) store.write( filename=target.display_name, instance=target, library=library, overwrite=True ) message = 'The node "{0}" has been written as Target "{1}" in the UMM "{2}" library.'.format( instance.name, target.display_name, library.name ) show_message( message=message, title='Universal Material Map', icon='INFO' ) else: show_message( message='Not able to generate data from "{0}".'.format(instance.name), title='Universal Material Map', icon='ERROR' ) return {'FINISHED'} def initialize(): if getattr(sys.modules[__name__], '__initialized'): return setattr(sys.modules[__name__], '__initialized', True) util.register(generator=Generator()) print('Universal Material Map: Registered Target Generator classes.') initialize() """ 'NONE', 'QUESTION', 'ERROR', 'CANCEL', 'TRIA_RIGHT', 'TRIA_DOWN', 'TRIA_LEFT', 'TRIA_UP', 'ARROW_LEFTRIGHT', 'PLUS', 'DISCLOSURE_TRI_RIGHT', 'DISCLOSURE_TRI_DOWN', 'RADIOBUT_OFF', 'RADIOBUT_ON', 'MENU_PANEL', 'BLENDER', 'GRIP', 'DOT', 'COLLAPSEMENU', 'X', 'DUPLICATE', 'TRASH', 'COLLECTION_NEW', 'OPTIONS', 'NODE', 'NODE_SEL', 'WINDOW', 'WORKSPACE', 'RIGHTARROW_THIN', 'BORDERMOVE', 'VIEWZOOM', 'ADD', 'REMOVE', 'PANEL_CLOSE', 'COPY_ID', 'EYEDROPPER', 'CHECKMARK', 'AUTO', 'CHECKBOX_DEHLT', 'CHECKBOX_HLT', 'UNLOCKED', 'LOCKED', 'UNPINNED', 'PINNED', 'SCREEN_BACK', 'RIGHTARROW', 'DOWNARROW_HLT', 'FCURVE_SNAPSHOT', 'OBJECT_HIDDEN', 'TOPBAR', 'STATUSBAR', 'PLUGIN', 'HELP', 'GHOST_ENABLED', 'COLOR', 'UNLINKED', 'LINKED', 'HAND', 'ZOOM_ALL', 'ZOOM_SELECTED', 'ZOOM_PREVIOUS', 'ZOOM_IN', 'ZOOM_OUT', 'DRIVER_DISTANCE', 'DRIVER_ROTATIONAL_DIFFERENCE', 'DRIVER_TRANSFORM', 'FREEZE', 'STYLUS_PRESSURE', 'GHOST_DISABLED', 'FILE_NEW', 'FILE_TICK', 'QUIT', 'URL', 'RECOVER_LAST', 'THREE_DOTS', 'FULLSCREEN_ENTER', 'FULLSCREEN_EXIT', 'BRUSHES_ALL', 'LIGHT', 'MATERIAL', 'TEXTURE', 'ANIM', 'WORLD', 'SCENE', 'OUTPUT', 'SCRIPT', 'PARTICLES', 'PHYSICS', 'SPEAKER', 'TOOL_SETTINGS', 'SHADERFX', 'MODIFIER', 'BLANK1', 'FAKE_USER_OFF', 'FAKE_USER_ON', 'VIEW3D', 'GRAPH', 'OUTLINER', 'PROPERTIES', 'FILEBROWSER', 'IMAGE', 'INFO', 'SEQUENCE', 'TEXT', 'SOUND', 'ACTION', 'NLA', 'PREFERENCES', 'TIME', 'NODETREE', 'CONSOLE', 'TRACKER', 'ASSET_MANAGER', 'NODE_COMPOSITING', 'NODE_TEXTURE', 'NODE_MATERIAL', 'UV', 'OBJECT_DATAMODE', 'EDITMODE_HLT', 'UV_DATA', 'VPAINT_HLT', 'TPAINT_HLT', 'WPAINT_HLT', 'SCULPTMODE_HLT', 'POSE_HLT', 'PARTICLEMODE', 'TRACKING', 'TRACKING_BACKWARDS', 'TRACKING_FORWARDS', 'TRACKING_BACKWARDS_SINGLE', 'TRACKING_FORWARDS_SINGLE', 'TRACKING_CLEAR_BACKWARDS', 'TRACKING_CLEAR_FORWARDS', 'TRACKING_REFINE_BACKWARDS', 'TRACKING_REFINE_FORWARDS', 'SCENE_DATA', 'RENDERLAYERS', 'WORLD_DATA', 'OBJECT_DATA', 'MESH_DATA', 'CURVE_DATA', 'META_DATA', 'LATTICE_DATA', 'LIGHT_DATA', 'MATERIAL_DATA', 'TEXTURE_DATA', 'ANIM_DATA', 'CAMERA_DATA', 'PARTICLE_DATA', 'LIBRARY_DATA_DIRECT', 'GROUP', 'ARMATURE_DATA', 'COMMUNITY', 'BONE_DATA', 'CONSTRAINT', 'SHAPEKEY_DATA', 'CONSTRAINT_BONE', 'CAMERA_STEREO', 'PACKAGE', 'UGLYPACKAGE', 'EXPERIMENTAL', 'BRUSH_DATA', 'IMAGE_DATA', 'FILE', 'FCURVE', 'FONT_DATA', 'RENDER_RESULT', 'SURFACE_DATA', 'EMPTY_DATA', 'PRESET', 'RENDER_ANIMATION', 'RENDER_STILL', 'LIBRARY_DATA_BROKEN', 'BOIDS', 'STRANDS', 'LIBRARY_DATA_INDIRECT', 'GREASEPENCIL', 'LINE_DATA', 'LIBRARY_DATA_OVERRIDE', 'GROUP_BONE', 'GROUP_VERTEX', 'GROUP_VCOL', 'GROUP_UVS', 'FACE_MAPS', 'RNA', 'RNA_ADD', 'MOUSE_LMB', 'MOUSE_MMB', 'MOUSE_RMB', 'MOUSE_MOVE', 'MOUSE_LMB_DRAG', 'MOUSE_MMB_DRAG', 'MOUSE_RMB_DRAG', 'MEMORY', 'PRESET_NEW', 'DECORATE', 'DECORATE_KEYFRAME', 'DECORATE_ANIMATE', 'DECORATE_DRIVER', 'DECORATE_LINKED', 'DECORATE_LIBRARY_OVERRIDE', 'DECORATE_UNLOCKED', 'DECORATE_LOCKED', 'DECORATE_OVERRIDE', 'FUND', 'TRACKER_DATA', 'HEART', 'ORPHAN_DATA', 'USER', 'SYSTEM', 'SETTINGS', 'OUTLINER_OB_EMPTY', 'OUTLINER_OB_MESH', 'OUTLINER_OB_CURVE', 'OUTLINER_OB_LATTICE', 'OUTLINER_OB_META', 'OUTLINER_OB_LIGHT', 'OUTLINER_OB_CAMERA', 'OUTLINER_OB_ARMATURE', 'OUTLINER_OB_FONT', 'OUTLINER_OB_SURFACE', 'OUTLINER_OB_SPEAKER', 'OUTLINER_OB_FORCE_FIELD', 'OUTLINER_OB_GROUP_INSTANCE', 'OUTLINER_OB_GREASEPENCIL', 'OUTLINER_OB_LIGHTPROBE', 'OUTLINER_OB_IMAGE', 'OUTLINER_COLLECTION', 'RESTRICT_COLOR_OFF', 'RESTRICT_COLOR_ON', 'HIDE_ON', 'HIDE_OFF', 'RESTRICT_SELECT_ON', 'RESTRICT_SELECT_OFF', 'RESTRICT_RENDER_ON', 'RESTRICT_RENDER_OFF', 'RESTRICT_INSTANCED_OFF', 'OUTLINER_DATA_EMPTY', 'OUTLINER_DATA_MESH', 'OUTLINER_DATA_CURVE', 'OUTLINER_DATA_LATTICE', 'OUTLINER_DATA_META', 'OUTLINER_DATA_LIGHT', 'OUTLINER_DATA_CAMERA', 'OUTLINER_DATA_ARMATURE', 'OUTLINER_DATA_FONT', 'OUTLINER_DATA_SURFACE', 'OUTLINER_DATA_SPEAKER', 'OUTLINER_DATA_LIGHTPROBE', 'OUTLINER_DATA_GP_LAYER', 'OUTLINER_DATA_GREASEPENCIL', 'GP_SELECT_POINTS', 'GP_SELECT_STROKES', 'GP_MULTIFRAME_EDITING', 'GP_ONLY_SELECTED', 'GP_SELECT_BETWEEN_STROKES', 'MODIFIER_OFF', 'MODIFIER_ON', 'ONIONSKIN_OFF', 'ONIONSKIN_ON', 'RESTRICT_VIEW_ON', 'RESTRICT_VIEW_OFF', 'RESTRICT_INSTANCED_ON', 'MESH_PLANE', 'MESH_CUBE', 'MESH_CIRCLE', 'MESH_UVSPHERE', 'MESH_ICOSPHERE', 'MESH_GRID', 'MESH_MONKEY', 'MESH_CYLINDER', 'MESH_TORUS', 'MESH_CONE', 'MESH_CAPSULE', 'EMPTY_SINGLE_ARROW', 'LIGHT_POINT', 'LIGHT_SUN', 'LIGHT_SPOT', 'LIGHT_HEMI', 'LIGHT_AREA', 'CUBE', 'SPHERE', 'CONE', 'META_PLANE', 'META_CUBE', 'META_BALL', 'META_ELLIPSOID', 'META_CAPSULE', 'SURFACE_NCURVE', 'SURFACE_NCIRCLE', 'SURFACE_NSURFACE', 'SURFACE_NCYLINDER', 'SURFACE_NSPHERE', 'SURFACE_NTORUS', 'EMPTY_AXIS', 'STROKE', 'EMPTY_ARROWS', 'CURVE_BEZCURVE', 'CURVE_BEZCIRCLE', 'CURVE_NCURVE', 'CURVE_NCIRCLE', 'CURVE_PATH', 'LIGHTPROBE_CUBEMAP', 'LIGHTPROBE_PLANAR', 'LIGHTPROBE_GRID', 'COLOR_RED', 'COLOR_GREEN', 'COLOR_BLUE', 'TRIA_RIGHT_BAR', 'TRIA_DOWN_BAR', 'TRIA_LEFT_BAR', 'TRIA_UP_BAR', 'FORCE_FORCE', 'FORCE_WIND', 'FORCE_VORTEX', 'FORCE_MAGNETIC', 'FORCE_HARMONIC', 'FORCE_CHARGE', 'FORCE_LENNARDJONES', 'FORCE_TEXTURE', 'FORCE_CURVE', 'FORCE_BOID', 'FORCE_TURBULENCE', 'FORCE_DRAG', 'FORCE_FLUIDFLOW', 'RIGID_BODY', 'RIGID_BODY_CONSTRAINT', 'IMAGE_PLANE', 'IMAGE_BACKGROUND', 'IMAGE_REFERENCE', 'NODE_INSERT_ON', 'NODE_INSERT_OFF', 'NODE_TOP', 'NODE_SIDE', 'NODE_CORNER', 'ANCHOR_TOP', 'ANCHOR_BOTTOM', 'ANCHOR_LEFT', 'ANCHOR_RIGHT', 'ANCHOR_CENTER', 'SELECT_SET', 'SELECT_EXTEND', 'SELECT_SUBTRACT', 'SELECT_INTERSECT', 'SELECT_DIFFERENCE', 'ALIGN_LEFT', 'ALIGN_CENTER', 'ALIGN_RIGHT', 'ALIGN_JUSTIFY', 'ALIGN_FLUSH', 'ALIGN_TOP', 'ALIGN_MIDDLE', 'ALIGN_BOTTOM', 'BOLD', 'ITALIC', 'UNDERLINE', 'SMALL_CAPS', 'CON_ACTION', 'HOLDOUT_OFF', 'HOLDOUT_ON', 'INDIRECT_ONLY_OFF', 'INDIRECT_ONLY_ON', 'CON_CAMERASOLVER', 'CON_FOLLOWTRACK', 'CON_OBJECTSOLVER', 'CON_LOCLIKE', 'CON_ROTLIKE', 'CON_SIZELIKE', 'CON_TRANSLIKE', 'CON_DISTLIMIT', 'CON_LOCLIMIT', 'CON_ROTLIMIT', 'CON_SIZELIMIT', 'CON_SAMEVOL', 'CON_TRANSFORM', 'CON_TRANSFORM_CACHE', 'CON_CLAMPTO', 'CON_KINEMATIC', 'CON_LOCKTRACK', 'CON_SPLINEIK', 'CON_STRETCHTO', 'CON_TRACKTO', 'CON_ARMATURE', 'CON_CHILDOF', 'CON_FLOOR', 'CON_FOLLOWPATH', 'CON_PIVOT', 'CON_SHRINKWRAP', 'MODIFIER_DATA', 'MOD_WAVE', 'MOD_BUILD', 'MOD_DECIM', 'MOD_MIRROR', 'MOD_SOFT', 'MOD_SUBSURF', 'HOOK', 'MOD_PHYSICS', 'MOD_PARTICLES', 'MOD_BOOLEAN', 'MOD_EDGESPLIT', 'MOD_ARRAY', 'MOD_UVPROJECT', 'MOD_DISPLACE', 'MOD_CURVE', 'MOD_LATTICE', 'MOD_TINT', 'MOD_ARMATURE', 'MOD_SHRINKWRAP', 'MOD_CAST', 'MOD_MESHDEFORM', 'MOD_BEVEL', 'MOD_SMOOTH', 'MOD_SIMPLEDEFORM', 'MOD_MASK', 'MOD_CLOTH', 'MOD_EXPLODE', 'MOD_FLUIDSIM', 'MOD_MULTIRES', 'MOD_FLUID', 'MOD_SOLIDIFY', 'MOD_SCREW', 'MOD_VERTEX_WEIGHT', 'MOD_DYNAMICPAINT', 'MOD_REMESH', 'MOD_OCEAN', 'MOD_WARP', 'MOD_SKIN', 'MOD_TRIANGULATE', 'MOD_WIREFRAME', 'MOD_DATA_TRANSFER', 'MOD_NORMALEDIT', 'MOD_PARTICLE_INSTANCE', 'MOD_HUE_SATURATION', 'MOD_NOISE', 'MOD_OFFSET', 'MOD_SIMPLIFY', 'MOD_THICKNESS', 'MOD_INSTANCE', 'MOD_TIME', 'MOD_OPACITY', 'REC', 'PLAY', 'FF', 'REW', 'PAUSE', 'PREV_KEYFRAME', 'NEXT_KEYFRAME', 'PLAY_SOUND', 'PLAY_REVERSE', 'PREVIEW_RANGE', 'ACTION_TWEAK', 'PMARKER_ACT', 'PMARKER_SEL', 'PMARKER', 'MARKER_HLT', 'MARKER', 'KEYFRAME_HLT', 'KEYFRAME', 'KEYINGSET', 'KEY_DEHLT', 'KEY_HLT', 'MUTE_IPO_OFF', 'MUTE_IPO_ON', 'DRIVER', 'SOLO_OFF', 'SOLO_ON', 'FRAME_PREV', 'FRAME_NEXT', 'NLA_PUSHDOWN', 'IPO_CONSTANT', 'IPO_LINEAR', 'IPO_BEZIER', 'IPO_SINE', 'IPO_QUAD', 'IPO_CUBIC', 'IPO_QUART', 'IPO_QUINT', 'IPO_EXPO', 'IPO_CIRC', 'IPO_BOUNCE', 'IPO_ELASTIC', 'IPO_BACK', 'IPO_EASE_IN', 'IPO_EASE_OUT', 'IPO_EASE_IN_OUT', 'NORMALIZE_FCURVES', 'VERTEXSEL', 'EDGESEL', 'FACESEL', 'CURSOR', 'PIVOT_BOUNDBOX', 'PIVOT_CURSOR', 'PIVOT_INDIVIDUAL', 'PIVOT_MEDIAN', 'PIVOT_ACTIVE', 'CENTER_ONLY', 'ROOTCURVE', 'SMOOTHCURVE', 'SPHERECURVE', 'INVERSESQUARECURVE', 'SHARPCURVE', 'LINCURVE', 'NOCURVE', 'RNDCURVE', 'PROP_OFF', 'PROP_ON', 'PROP_CON', 'PROP_PROJECTED', 'PARTICLE_POINT', 'PARTICLE_TIP', 'PARTICLE_PATH', 'SNAP_FACE_CENTER', 'SNAP_PERPENDICULAR', 'SNAP_MIDPOINT', 'SNAP_OFF', 'SNAP_ON', 'SNAP_NORMAL', 'SNAP_GRID', 'SNAP_VERTEX', 'SNAP_EDGE', 'SNAP_FACE', 'SNAP_VOLUME', 'SNAP_INCREMENT', 'STICKY_UVS_LOC', 'STICKY_UVS_DISABLE', 'STICKY_UVS_VERT', 'CLIPUV_DEHLT', 'CLIPUV_HLT', 'SNAP_PEEL_OBJECT', 'GRID', 'OBJECT_ORIGIN', 'ORIENTATION_GLOBAL', 'ORIENTATION_GIMBAL', 'ORIENTATION_LOCAL', 'ORIENTATION_NORMAL', 'ORIENTATION_VIEW', 'COPYDOWN', 'PASTEDOWN', 'PASTEFLIPUP', 'PASTEFLIPDOWN', 'VIS_SEL_11', 'VIS_SEL_10', 'VIS_SEL_01', 'VIS_SEL_00', 'AUTOMERGE_OFF', 'AUTOMERGE_ON', 'UV_VERTEXSEL', 'UV_EDGESEL', 'UV_FACESEL', 'UV_ISLANDSEL', 'UV_SYNC_SELECT', 'TRANSFORM_ORIGINS', 'GIZMO', 'ORIENTATION_CURSOR', 'NORMALS_VERTEX', 'NORMALS_FACE', 'NORMALS_VERTEX_FACE', 'SHADING_BBOX', 'SHADING_WIRE', 'SHADING_SOLID', 'SHADING_RENDERED', 'SHADING_TEXTURE', 'OVERLAY', 'XRAY', 'LOCKVIEW_OFF', 'LOCKVIEW_ON', 'AXIS_SIDE', 'AXIS_FRONT', 'AXIS_TOP', 'LAYER_USED', 'LAYER_ACTIVE', 'OUTLINER_OB_HAIR', 'OUTLINER_DATA_HAIR', 'HAIR_DATA', 'OUTLINER_OB_POINTCLOUD', 'OUTLINER_DATA_POINTCLOUD', 'POINTCLOUD_DATA', 'OUTLINER_OB_VOLUME', 'OUTLINER_DATA_VOLUME', 'VOLUME_DATA', 'HOME', 'DOCUMENTS', 'TEMP', 'SORTALPHA', 'SORTBYEXT', 'SORTTIME', 'SORTSIZE', 'SHORTDISPLAY', 'LONGDISPLAY', 'IMGDISPLAY', 'BOOKMARKS', 'FONTPREVIEW', 'FILTER', 'NEWFOLDER', 'FOLDER_REDIRECT', 'FILE_PARENT', 'FILE_REFRESH', 'FILE_FOLDER', 'FILE_BLANK', 'FILE_BLEND', 'FILE_IMAGE', 'FILE_MOVIE', 'FILE_SCRIPT', 'FILE_SOUND', 'FILE_FONT', 'FILE_TEXT', 'SORT_DESC', 'SORT_ASC', 'LINK_BLEND', 'APPEND_BLEND', 'IMPORT', 'EXPORT', 'LOOP_BACK', 'LOOP_FORWARDS', 'BACK', 'FORWARD', 'FILE_ARCHIVE', 'FILE_CACHE', 'FILE_VOLUME', 'FILE_3D', 'FILE_HIDDEN', 'FILE_BACKUP', 'DISK_DRIVE', 'MATPLANE', 'MATSPHERE', 'MATCUBE', 'MONKEY', 'HAIR', 'ALIASED', 'ANTIALIASED', 'MAT_SPHERE_SKY', 'MATSHADERBALL', 'MATCLOTH', 'MATFLUID', 'WORDWRAP_OFF', 'WORDWRAP_ON', 'SYNTAX_OFF', 'SYNTAX_ON', 'LINENUMBERS_OFF', 'LINENUMBERS_ON', 'SCRIPTPLUGINS', 'DISC', 'DESKTOP', 'EXTERNAL_DRIVE', 'NETWORK_DRIVE', 'SEQ_SEQUENCER', 'SEQ_PREVIEW', 'SEQ_LUMA_WAVEFORM', 'SEQ_CHROMA_SCOPE', 'SEQ_HISTOGRAM', 'SEQ_SPLITVIEW', 'SEQ_STRIP_META', 'SEQ_STRIP_DUPLICATE', 'IMAGE_RGB', 'IMAGE_RGB_ALPHA', 'IMAGE_ALPHA', 'IMAGE_ZDEPTH', 'HANDLE_AUTOCLAMPED', 'HANDLE_AUTO', 'HANDLE_ALIGNED', 'HANDLE_VECTOR', 'HANDLE_FREE', 'VIEW_PERSPECTIVE', 'VIEW_ORTHO', 'VIEW_CAMERA', 'VIEW_PAN', 'VIEW_ZOOM', 'BRUSH_BLOB', 'BRUSH_BLUR', 'BRUSH_CLAY', 'BRUSH_CLAY_STRIPS', 'BRUSH_CLONE', 'BRUSH_CREASE', 'BRUSH_FILL', 'BRUSH_FLATTEN', 'BRUSH_GRAB', 'BRUSH_INFLATE', 'BRUSH_LAYER', 'BRUSH_MASK', 'BRUSH_MIX', 'BRUSH_NUDGE', 'BRUSH_PINCH', 'BRUSH_SCRAPE', 'BRUSH_SCULPT_DRAW', 'BRUSH_SMEAR', 'BRUSH_SMOOTH', 'BRUSH_SNAKE_HOOK', 'BRUSH_SOFTEN', 'BRUSH_TEXDRAW', 'BRUSH_TEXFILL', 'BRUSH_TEXMASK', 'BRUSH_THUMB', 'BRUSH_ROTATE', 'GPBRUSH_SMOOTH', 'GPBRUSH_THICKNESS', 'GPBRUSH_STRENGTH', 'GPBRUSH_GRAB', 'GPBRUSH_PUSH', 'GPBRUSH_TWIST', 'GPBRUSH_PINCH', 'GPBRUSH_RANDOMIZE', 'GPBRUSH_CLONE', 'GPBRUSH_WEIGHT', 'GPBRUSH_PENCIL', 'GPBRUSH_PEN', 'GPBRUSH_INK', 'GPBRUSH_INKNOISE', 'GPBRUSH_BLOCK', 'GPBRUSH_MARKER', 'GPBRUSH_FILL', 'GPBRUSH_AIRBRUSH', 'GPBRUSH_CHISEL', 'GPBRUSH_ERASE_SOFT', 'GPBRUSH_ERASE_HARD', 'GPBRUSH_ERASE_STROKE', 'SMALL_TRI_RIGHT_VEC', 'KEYTYPE_KEYFRAME_VEC', 'KEYTYPE_BREAKDOWN_VEC', 'KEYTYPE_EXTREME_VEC', 'KEYTYPE_JITTER_VEC', 'KEYTYPE_MOVING_HOLD_VEC', 'HANDLETYPE_FREE_VEC', 'HANDLETYPE_ALIGNED_VEC', 'HANDLETYPE_VECTOR_VEC', 'HANDLETYPE_AUTO_VEC', 'HANDLETYPE_AUTO_CLAMP_VEC', 'COLORSET_01_VEC', 'COLORSET_02_VEC', 'COLORSET_03_VEC', 'COLORSET_04_VEC', 'COLORSET_05_VEC', 'COLORSET_06_VEC', 'COLORSET_07_VEC', 'COLORSET_08_VEC', 'COLORSET_09_VEC', 'COLORSET_10_VEC', 'COLORSET_11_VEC', 'COLORSET_12_VEC', 'COLORSET_13_VEC', 'COLORSET_14_VEC', 'COLORSET_15_VEC', 'COLORSET_16_VEC', 'COLORSET_17_VEC', 'COLORSET_18_VEC', 'COLORSET_19_VEC', 'COLORSET_20_VEC', 'COLLECTION_COLOR_01', 'COLLECTION_COLOR_02', 'COLLECTION_COLOR_03', 'COLLECTION_COLOR_04', 'COLLECTION_COLOR_05', 'COLLECTION_COLOR_06', 'COLLECTION_COLOR_07', 'COLLECTION_COLOR_08', 'EVENT_A', 'EVENT_B', 'EVENT_C', 'EVENT_D', 'EVENT_E', 'EVENT_F', 'EVENT_G', 'EVENT_H', 'EVENT_I', 'EVENT_J', 'EVENT_K', 'EVENT_L', 'EVENT_M', 'EVENT_N', 'EVENT_O', 'EVENT_P', 'EVENT_Q', 'EVENT_R', 'EVENT_S', 'EVENT_T', 'EVENT_U', 'EVENT_V', 'EVENT_W', 'EVENT_X', 'EVENT_Y', 'EVENT_Z', 'EVENT_SHIFT', 'EVENT_CTRL', 'EVENT_ALT', 'EVENT_OS', 'EVENT_F1', 'EVENT_F2', 'EVENT_F3', 'EVENT_F4', 'EVENT_F5', 'EVENT_F6', 'EVENT_F7', 'EVENT_F8', 'EVENT_F9', 'EVENT_F10', 'EVENT_F11', 'EVENT_F12', 'EVENT_ESC', 'EVENT_TAB', 'EVENT_PAGEUP', 'EVENT_PAGEDOWN', 'EVENT_RETURN', 'EVENT_SPACEKEY' """
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/blender/template/omnipbr.json
{ "name": "Principled Omni PBR", "nodes": [ { "name": "Frame.002", "label": "UV Set", "location": [ -1583.4996337890625, -247.95455932617188 ], "width": 210.0, "height": 164.06552124023438, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": true }, { "name": "color", "value": [ 0.6104959845542908, 0.06662588566541672, 0.0 ] }, { "name": "shrink", "value": true } ], "texts": [] }, { "name": "Frame.001", "label": "UVs", "location": [ -1286.206787109375, 62.31555938720703 ], "width": 200.2772216796875, "height": 784.1096801757812, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": true }, { "name": "color", "value": [ 0.05612799897789955, 0.6104958653450012, 0.0 ] }, { "name": "shrink", "value": true } ], "texts": [] }, { "name": "Frame", "label": "Texture Inputs", "location": [ -900.7086791992188, 88.20856475830078 ], "width": 871.4410400390625, "height": 1152.6026611328125, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": true }, { "name": "color", "value": [ 0.056128427386283875, 0.6104958653450012, 0.0 ] }, { "name": "shrink", "value": true } ], "texts": [] }, { "name": "Frame.004", "label": "Parameters", "location": [ 84.32209777832031, 272.77618408203125 ], "width": 395.990234375, "height": 1095.2596435546875, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": true }, { "name": "color", "value": [ 0.05612799897789955, 0.6104958653450012, 0.0 ] }, { "name": "shrink", "value": true } ], "texts": [] }, { "name": "Frame.003", "label": "Output", "location": [ 508.48785400390625, 259.3931884765625 ], "width": 524.638427734375, "height": 659.435791015625, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": true }, { "name": "color", "value": [ 0.6104959845542908, 0.06662588566541672, 0.0 ] }, { "name": "shrink", "value": true } ], "texts": [] }, { "name": "Frame.005", "label": "Information", "location": [ 1222.4765625, -21.232376098632812 ], "width": 587.3812255859375, "height": 660.048095703125, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": false }, { "name": "color", "value": [ 0.6079999804496765, 0.6079999804496765, 0.6079999804496765 ] }, { "name": "shrink", "value": true } ], "texts": [ { "name": "UMM_OmniPBR_Information", "contents": "This shader graph is designed for a lossless material pipeline with Omniverse.\n\nAdding nodes, removing nodes, and changing connections can cause the pipeline to no longer be lossless.\n\nYou can change properties on any node in the graph to get the desired look in Blender but only nodes in GREEN frames are evaluated for property values on export. For example, you can select a uv map in the UV Map node but the OmniPBR Compute node's \"UV Space Index\" is what will be exported to the USD file.\n\nAlso, some graph properties will not affect the rendering in Blender. Those properties are simply included to hold values for subsequent exports to Omniverse.\n\nExceptions:\n \n OmniPBR Compute.UseNormalMap - local to Blender.\n OmniPBR Compute.UseDetailNormalMap - local to Blender." } ] }, { "name": "UV Map", "label": "", "location": [ 4.2073974609375, -49.97991943359375 ], "width": 150.0, "height": 100.0, "parent": "Frame.002", "class": "ShaderNodeUVMap", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Base Mapping", "label": "Base Mapping", "location": [ 47.6136474609375, -48.20588684082031 ], "width": 140.0, "height": 100.0, "parent": "Frame.001", "class": "ShaderNodeMapping", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Detail Mapping", "label": "Detail Mapping", "location": [ 47.33642578125, -425.1611633300781 ], "width": 140.0, "height": 100.0, "parent": "Frame.001", "class": "ShaderNodeMapping", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Emissive Map", "label": "Emissive Map", "location": [ -4.09100341796875, -355.68511962890625 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Emissive Mask Map", "label": "Emissive Mask Map", "location": [ 270.14764404296875, -425.734375 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "AO Map", "label": "AO Map", "location": [ 4.47296142578125, -45.80598449707031 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Metallic Map", "label": "Metallic Map", "location": [ 290.48675537109375, -109.12104797363281 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Roughness Map", "label": "Roughness Map", "location": [ 567.3500366210938, -159.96913146972656 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "ORM Map", "label": "ORM Map", "location": [ 566.481201171875, 72.37274169921875 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Albedo Map", "label": "Albedo Map", "location": [ 286.06646728515625, 143.39410400390625 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Opacity Map", "label": "Opacity Map", "location": [ 274.18450927734375, -670.9015502929688 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Detail Normal Map", "label": "Detail Normal Map", "location": [ 534.9067993164062, -748.8092651367188 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Normal Map", "label": "Normal Map", "location": [ 530.9785766601562, -484.42449951171875 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Principled BSDF", "label": "", "location": [ -29.3876953125, -32.7137451171875 ], "width": 240.0, "height": 100.0, "parent": "Frame.003", "class": "ShaderNodeBsdfPrincipled", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Material Output", "label": "", "location": [ 295.250732421875, -30.9573974609375 ], "width": 140.0, "height": 100.0, "parent": "Frame.003", "class": "ShaderNodeOutputMaterial", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "OmniPBR Compute", "label": "OmniPBR Compute", "location": [ -46.68115234375, -43.5164794921875 ], "width": 335.990234375, "height": 100.0, "parent": "Frame.004", "class": "ShaderNodeGroup", "inputs": [ { "index": 0, "name": "Albedo Map", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 1, "name": "Use Albedo Map", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 1 }, { "index": 2, "name": "Albedo RGB", "class": "NodeSocketColor", "default_value": [ 0.20000000298023224, 0.20000000298023224, 0.20000000298023224, 1.0 ] }, { "index": 3, "name": "Albedo Add", "class": "NodeSocketFloatFactor", "min_value": -1.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 4, "name": "Albedo Desaturation", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 5, "name": "Albedo Brightness", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 1.0 }, { "index": 6, "name": "Albedo Tint", "class": "NodeSocketColor", "default_value": [ 1.0, 1.0, 1.0, 1.0 ] }, { "index": 7, "name": "Specular", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.5 }, { "index": 8, "name": "Use ORM Map", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 9, "name": "ORM Map", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 10, "name": "AO Map", "class": "NodeSocketColor", "default_value": [ 1.0, 1.0, 1.0, 1.0 ] }, { "index": 11, "name": "AO to Diffuse", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 12, "name": "Metallic Amount", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 13, "name": "Metallic Map", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 14, "name": "Metallic Map Influence", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 15, "name": "Roughness Amount", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.5 }, { "index": 16, "name": "Roughness Map", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 17, "name": "Roughness Map Influence", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 18, "name": "Enable Emission", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 19, "name": "Emissive Intensity", "class": "NodeSocketFloatFactor", "min_value": -3.4028234663852886e+38, "max_value": 3.4028234663852886e+38, "default_value": 40.0 }, { "index": 20, "name": "Emissive Color", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 21, "name": "Emissive Color Map", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 22, "name": "Use Emission Map", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 23, "name": "Emissive Mask Map", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 24, "name": "Normal Map", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 25, "name": "Normal Map Strength", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 10.0, "default_value": 1.0 }, { "index": 26, "name": "Use Normal Map", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 1 }, { "index": 27, "name": "Detail Normal Map", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 28, "name": "Use Detail Normal Map", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 29, "name": "Detail Normal Strength", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 10.0, "default_value": 1.0 }, { "index": 30, "name": "Enable Opacity", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 31, "name": "Enable Opacity Texture", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 32, "name": "Opacity Amount", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 33, "name": "Opacity Map", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 34, "name": "Opacity Threshold", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 35, "name": "Opacity Mono Source", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 3, "default_value": 1 }, { "index": 36, "name": "Enable Project UVW Coordinates", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 37, "name": "Enable World Space", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 38, "name": "UV Space Index", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 512, "default_value": 0 }, { "index": 39, "name": "Normal Map Flip U Tangent", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 40, "name": "Normal Map Flip V Tangent", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 1 } ], "outputs": [ { "index": 0, "name": "Albedo", "class": "NodeSocketColor" }, { "index": 1, "name": "Metallic", "class": "NodeSocketColor" }, { "index": 2, "name": "Specular", "class": "NodeSocketFloatFactor" }, { "index": 3, "name": "Roughness", "class": "NodeSocketColor" }, { "index": 4, "name": "Normal Map", "class": "NodeSocketColor" }, { "index": 5, "name": "Emission", "class": "NodeSocketColor" }, { "index": 6, "name": "Emissive Intensity", "class": "NodeSocketFloatFactor" } ], "nodes": [ { "name": "Mix.006", "label": "Roughness-Factor", "location": [ 363.3636779785156, -459.13153076171875 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Mix.001", "label": "Apply AO", "location": [ 341.076416015625, 337.81390380859375 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 1.0 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MULTIPLY" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Mix", "label": "Apply Tint", "location": [ 70.11546325683594, 525.7276000976562 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 1.0 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MULTIPLY" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Separate RGB", "label": "", "location": [ -311.6913146972656, -177.2138214111328 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeSeparateRGB", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "RGB", "label": "", "location": [ -1060.8045654296875, -681.1764526367188 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeRGB", "inputs": [], "outputs": [ { "index": 0, "name": "Color", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] } ], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Mix.002", "label": "AO to Diffuse", "location": [ 529.94384765625, 525.0449829101562 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Mix.013", "label": "Albedo Brightness", "location": [ -369.7886657714844, 507.16015625 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 1.0 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MULTIPLY" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Mix.012", "label": "Albedo Add", "location": [ -671.7221069335938, 551.872314453125 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 1.0, 1.0, 1.0, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "ADD" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Mix.014", "label": "Detail Normal Source Switch", "location": [ -720.9641723632812, -907.9030151367188 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Normal Map", "label": "", "location": [ -487.4425964355469, -584.4586181640625 ], "width": 150.0, "height": 100.0, "parent": null, "class": "ShaderNodeNormalMap", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Normal Map.001", "label": "", "location": [ -487.21112060546875, -883.1339721679688 ], "width": 150.0, "height": 100.0, "parent": null, "class": "ShaderNodeNormalMap", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Mix.008", "label": "Albedo Source Switch", "location": [ -1406.1441650390625, 447.41766357421875 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Hue Saturation Value", "label": "", "location": [ -1065.7901611328125, 607.2035522460938 ], "width": 150.0, "height": 100.0, "parent": null, "class": "ShaderNodeHueSaturation", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Mix.003", "label": "AO-ORM Map Toggle", "location": [ 95.51786804199219, 217.91529846191406 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "RGB.001", "label": "", "location": [ -1041.1123046875, -953.3507080078125 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeRGB", "inputs": [], "outputs": [ { "index": 0, "name": "Color", "class": "NodeSocketColor", "default_value": [ 0.5000009536743164, 0.5, 1.0, 1.0 ] } ], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Group Input", "label": "", "location": [ -1818.1448974609375, 98.1231689453125 ], "width": 140.0, "height": 100.0, "parent": null, "class": "NodeGroupInput", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Group Output", "label": "", "location": [ 981.2186889648438, 40.883602142333984 ], "width": 140.0, "height": 100.0, "parent": null, "class": "NodeGroupOutput", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Mix.010", "label": "Emissive Source Switch", "location": [ -794.0533447265625, -368.2444763183594 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Mix.007", "label": "Metallic Factor", "location": [ 303.339599609375, -33.23448944091797 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Mix.011", "label": "Normal Source Switch", "location": [ -719.1019287109375, -712.2954711914062 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Mix.009", "label": "Emissive Switch", "location": [ -1115.2685546875, -475.1673583984375 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Mix.004", "label": "Roughness-ORM Map Toggle", "location": [ 182.2133331298828, -635.487548828125 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Mix.005", "label": "Metallic-ORM Map Toggle", "location": [ -2.184864044189453, -227.71604919433594 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] } ], "links": [ { "from_node": "Group Input", "from_socket": "ORM Map", "to_node": "Separate RGB", "to_socket": "Image" }, { "from_node": "Group Input", "from_socket": "Use ORM Map", "to_node": "Mix.004", "to_socket": "Fac" }, { "from_node": "Group Input", "from_socket": "Roughness Map Influence", "to_node": "Mix.006", "to_socket": "Fac" }, { "from_node": "Mix.006", "from_socket": "Color", "to_node": "Group Output", "to_socket": "Roughness" }, { "from_node": "Group Input", "from_socket": "Metallic Map Influence", "to_node": "Mix.007", "to_socket": "Fac" }, { "from_node": "Mix.007", "from_socket": "Color", "to_node": "Group Output", "to_socket": "Metallic" }, { "from_node": "Group Input", "from_socket": "Albedo Tint", "to_node": "Mix", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "AO Map", "to_node": "Mix.003", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "AO to Diffuse", "to_node": "Mix.002", "to_socket": "Fac" }, { "from_node": "Mix.002", "from_socket": "Color", "to_node": "Group Output", "to_socket": "Albedo" }, { "from_node": "Mix.004", "from_socket": "Color", "to_node": "Mix.006", "to_socket": "Color2" }, { "from_node": "Mix.005", "from_socket": "Color", "to_node": "Mix.007", "to_socket": "Color2" }, { "from_node": "Mix", "from_socket": "Color", "to_node": "Mix.001", "to_socket": "Color1" }, { "from_node": "Mix", "from_socket": "Color", "to_node": "Mix.002", "to_socket": "Color1" }, { "from_node": "Mix.001", "from_socket": "Color", "to_node": "Mix.002", "to_socket": "Color2" }, { "from_node": "Mix.003", "from_socket": "Color", "to_node": "Mix.001", "to_socket": "Color2" }, { "from_node": "Group Input", "from_socket": "Use ORM Map", "to_node": "Mix.005", "to_socket": "Fac" }, { "from_node": "Group Input", "from_socket": "Use ORM Map", "to_node": "Mix.003", "to_socket": "Fac" }, { "from_node": "Group Input", "from_socket": "Metallic Amount", "to_node": "Mix.007", "to_socket": "Color1" }, { "from_node": "Separate RGB", "from_socket": "B", "to_node": "Mix.005", "to_socket": "Color2" }, { "from_node": "Separate RGB", "from_socket": "G", "to_node": "Mix.004", "to_socket": "Color2" }, { "from_node": "Separate RGB", "from_socket": "R", "to_node": "Mix.003", "to_socket": "Color2" }, { "from_node": "Group Input", "from_socket": "Roughness Amount", "to_node": "Mix.006", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "Use Albedo Map", "to_node": "Mix.008", "to_socket": "Fac" }, { "from_node": "Group Input", "from_socket": "Use Emission Map", "to_node": "Mix.009", "to_socket": "Fac" }, { "from_node": "Group Input", "from_socket": "Emissive Color", "to_node": "Mix.009", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "Enable Emission", "to_node": "Mix.010", "to_socket": "Fac" }, { "from_node": "Mix.009", "from_socket": "Color", "to_node": "Mix.010", "to_socket": "Color2" }, { "from_node": "Mix.010", "from_socket": "Color", "to_node": "Group Output", "to_socket": "Emission" }, { "from_node": "Normal Map", "from_socket": "Normal", "to_node": "Group Output", "to_socket": "Normal Map" }, { "from_node": "Group Input", "from_socket": "Normal Map Strength", "to_node": "Normal Map", "to_socket": "Strength" }, { "from_node": "RGB.001", "from_socket": "Color", "to_node": "Mix.011", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "Use Normal Map", "to_node": "Mix.011", "to_socket": "Fac" }, { "from_node": "Mix.011", "from_socket": "Color", "to_node": "Normal Map", "to_socket": "Color" }, { "from_node": "Group Input", "from_socket": "Albedo Brightness", "to_node": "Mix.013", "to_socket": "Color1" }, { "from_node": "Mix.012", "from_socket": "Color", "to_node": "Mix.013", "to_socket": "Color2" }, { "from_node": "Mix.013", "from_socket": "Color", "to_node": "Mix", "to_socket": "Color2" }, { "from_node": "Mix.008", "from_socket": "Color", "to_node": "Hue Saturation Value", "to_socket": "Color" }, { "from_node": "Group Input", "from_socket": "Specular", "to_node": "Group Output", "to_socket": "Specular" }, { "from_node": "Group Input", "from_socket": "Use Detail Normal Map", "to_node": "Mix.014", "to_socket": "Fac" }, { "from_node": "RGB.001", "from_socket": "Color", "to_node": "Mix.014", "to_socket": "Color1" }, { "from_node": "Mix.014", "from_socket": "Color", "to_node": "Normal Map.001", "to_socket": "Color" }, { "from_node": "Group Input", "from_socket": "Detail Normal Strength", "to_node": "Normal Map.001", "to_socket": "Strength" }, { "from_node": "Group Input", "from_socket": "Albedo Desaturation", "to_node": "Hue Saturation Value", "to_socket": "Fac" }, { "from_node": "Group Input", "from_socket": "Albedo RGB", "to_node": "Mix.008", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "Albedo Map", "to_node": "Mix.008", "to_socket": "Color2" }, { "from_node": "Hue Saturation Value", "from_socket": "Color", "to_node": "Mix.012", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "Albedo Add", "to_node": "Mix.012", "to_socket": "Fac" }, { "from_node": "Group Input", "from_socket": "Emissive Intensity", "to_node": "Group Output", "to_socket": "Emissive Intensity" }, { "from_node": "RGB", "from_socket": "Color", "to_node": "Mix.010", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "Detail Normal Map", "to_node": "Mix.014", "to_socket": "Color2" }, { "from_node": "Group Input", "from_socket": "Normal Map", "to_node": "Mix.011", "to_socket": "Color2" }, { "from_node": "Group Input", "from_socket": "Emissive Color Map", "to_node": "Mix.009", "to_socket": "Color2" }, { "from_node": "Group Input", "from_socket": "Roughness Map", "to_node": "Mix.004", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "Metallic Map", "to_node": "Mix.005", "to_socket": "Color1" } ], "properties": [], "texts": [] } ], "links": [ { "from_node": "Principled BSDF", "from_socket": "BSDF", "to_node": "Material Output", "to_socket": "Surface" }, { "from_node": "ORM Map", "from_socket": "Color", "to_node": "OmniPBR Compute", "to_socket": "ORM Map" }, { "from_node": "Metallic Map", "from_socket": "Color", "to_node": "OmniPBR Compute", "to_socket": "Metallic Map" }, { "from_node": "OmniPBR Compute", "from_socket": "Roughness", "to_node": "Principled BSDF", "to_socket": "Roughness" }, { "from_node": "OmniPBR Compute", "from_socket": "Metallic", "to_node": "Principled BSDF", "to_socket": "Metallic" }, { "from_node": "Albedo Map", "from_socket": "Color", "to_node": "OmniPBR Compute", "to_socket": "Albedo Map" }, { "from_node": "AO Map", "from_socket": "Color", "to_node": "OmniPBR Compute", "to_socket": "AO Map" }, { "from_node": "OmniPBR Compute", "from_socket": "Albedo", "to_node": "Principled BSDF", "to_socket": "Base Color" }, { "from_node": "OmniPBR Compute", "from_socket": "Emission", "to_node": "Principled BSDF", "to_socket": "Emission" }, { "from_node": "Roughness Map", "from_socket": "Color", "to_node": "OmniPBR Compute", "to_socket": "Roughness Map" }, { "from_node": "Emissive Map", "from_socket": "Color", "to_node": "OmniPBR Compute", "to_socket": "Emissive Color Map" }, { "from_node": "OmniPBR Compute", "from_socket": "Normal Map", "to_node": "Principled BSDF", "to_socket": "Normal" }, { "from_node": "OmniPBR Compute", "from_socket": "Specular", "to_node": "Principled BSDF", "to_socket": "Specular" }, { "from_node": "Normal Map", "from_socket": "Color", "to_node": "OmniPBR Compute", "to_socket": "Normal Map" }, { "from_node": "UV Map", "from_socket": "UV", "to_node": "Base Mapping", "to_socket": "Vector" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Albedo Map", "to_socket": "Vector" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "ORM Map", "to_socket": "Vector" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "AO Map", "to_socket": "Vector" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Metallic Map", "to_socket": "Vector" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Roughness Map", "to_socket": "Vector" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Emissive Map", "to_socket": "Vector" }, { "from_node": "UV Map", "from_socket": "UV", "to_node": "Detail Mapping", "to_socket": "Vector" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Normal Map", "to_socket": "Vector" }, { "from_node": "Detail Normal Map", "from_socket": "Color", "to_node": "OmniPBR Compute", "to_socket": "Detail Normal Map" }, { "from_node": "Detail Mapping", "from_socket": "Vector", "to_node": "Detail Normal Map", "to_socket": "Vector" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Emissive Mask Map", "to_socket": "Vector" }, { "from_node": "Emissive Mask Map", "from_socket": "Color", "to_node": "OmniPBR Compute", "to_socket": "Emissive Mask Map" }, { "from_node": "Opacity Map", "from_socket": "Color", "to_node": "OmniPBR Compute", "to_socket": "Opacity Map" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Opacity Map", "to_socket": "Vector" }, { "from_node": "OmniPBR Compute", "from_socket": "Emissive Intensity", "to_node": "Principled BSDF", "to_socket": "Emission Strength" } ] }
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/blender/template/omnipbr_map.json
{ "maps": [ { "blender_node": "OmniPBR Compute", "blender_socket": "Albedo Add", "mdl_name": "albedo_add", "umm_display_name": "Albedo Add" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Albedo Brightness", "mdl_name": "albedo_brightness", "umm_display_name": "Albedo Brightness" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Albedo Desaturation", "mdl_name": "albedo_desaturation", "umm_display_name": "Albedo Desaturation" }, { "blender_node": "OmniPBR Compute", "blender_socket": "AO to Diffuse", "mdl_name": "ao_to_diffuse", "umm_display_name": "AO to Diffuse" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Normal Map Strength", "mdl_name": "bump_factor", "umm_display_name": "Normal Map Strength" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Detail Normal Strength", "mdl_name": "detail_bump_factor", "umm_display_name": "Detail Normal Strength" }, { "blender_node": "Detail Normal Map", "blender_socket": "image", "mdl_name": "detail_normalmap_texture", "umm_display_name": "Detail Normal Map" }, { "blender_node": "AO Map", "blender_socket": "image", "mdl_name": "ao_texture", "umm_display_name": "AO Map" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Albedo RGB", "mdl_name": "diffuse_color_constant", "umm_display_name": "Albedo RGB" }, { "blender_node": "Albedo Map", "blender_socket": "image", "mdl_name": "diffuse_texture", "umm_display_name": "Albedo Map" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Albedo Tint", "mdl_name": "diffuse_tint", "umm_display_name": "Albedo Tint" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Emissive Color", "mdl_name": "emissive_color", "umm_display_name": "Emissive Color" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Emissive Intensity", "mdl_name": "emissive_intensity", "umm_display_name": "Emissive Intensity" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Enable Emission", "mdl_name": "enable_emission", "umm_display_name": "Enable Emission" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Use ORM Map", "mdl_name": "enable_ORM_texture", "umm_display_name": "Use ORM Map" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Metallic Amount", "mdl_name": "metallic_constant", "umm_display_name": "Metallic Amount" }, { "blender_node": "Metallic Map", "blender_socket": "image", "mdl_name": "metallic_texture", "umm_display_name": "Metallic Map" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Metallic Map Influence", "mdl_name": "metallic_texture_influence", "umm_display_name": "Metallic Map Influence" }, { "blender_node": "Normal Map", "blender_socket": "image", "mdl_name": "normalmap_texture", "umm_display_name": "Normal Map" }, { "blender_node": "ORM Map", "blender_socket": "image", "mdl_name": "ORM_texture", "umm_display_name": "ORM Map" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Roughness Amount", "mdl_name": "reflection_roughness_constant", "umm_display_name": "Roughness Amount" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Roughness Map Influence", "mdl_name": "reflection_roughness_texture_influence", "umm_display_name": "Roughness Map Influence" }, { "blender_node": "Roughness Map", "blender_socket": "image", "mdl_name": "reflectionroughness_texture", "umm_display_name": "Roughness Map" }, { "blender_node": "Emissive Map", "blender_socket": "image", "mdl_name": "emissive_color_texture", "umm_display_name": "Emissive Map" }, { "blender_node": "Emissive Mask Map", "blender_socket": "image", "mdl_name": "emissive_mask_texture", "umm_display_name": "Emissive Mask Map" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Specular", "mdl_name": "specular_level", "umm_display_name": "Specular" }, { "blender_node": "Principled BSDF", "blender_socket": "Transmission", "mdl_name": "", "umm_display_name": "Transmission" }, { "blender_node": "Principled BSDF", "blender_socket": "IOR", "mdl_name": "", "umm_display_name": "IOR" }, { "blender_node": "Base Mapping", "blender_socket": "Rotation", "mdl_name": "texture_rotate", "umm_display_name": "Texture Rotate" }, { "blender_node": "Base Mapping", "blender_socket": "Scale", "mdl_name": "texture_scale", "umm_display_name": "Texture Scale" }, { "blender_node": "Base Mapping", "blender_socket": "Location", "mdl_name": "texture_translate", "umm_display_name": "Texture Translate" }, { "blender_node": "Detail Mapping", "blender_socket": "Rotation", "mdl_name": "detail_texture_rotate", "umm_display_name": "Detail Texture Rotate" }, { "blender_node": "Detail Mapping", "blender_socket": "Scale", "mdl_name": "detail_texture_scale", "umm_display_name": "Detail Texture Scale" }, { "blender_node": "Detail Mapping", "blender_socket": "Location", "mdl_name": "detail_texture_translate", "umm_display_name": "Detail Texture Translate" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Enable Opacity", "mdl_name": "enable_opacity", "umm_display_name": "Enable Opacity" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Opacity Amount", "mdl_name": "opacity_constant", "umm_display_name": "Opacity Amount" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Enable Opacity Texture", "mdl_name": "enable_opacity_texture", "umm_display_name": "Enable Opacity Texture" }, { "blender_node": "Opacity Map", "blender_socket": "image", "mdl_name": "opacity_texture", "umm_display_name": "Opacity Map" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Opacity Threshold", "mdl_name": "opacity_threshold", "umm_display_name": "Opacity Threshold" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Opacity Mono Source", "mdl_name": "opacity_threshold", "umm_display_name": "Opacity Mono Source" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Enable Project UVW Coordinates", "mdl_name": "project_uvw", "umm_display_name": "Enable Project UVW Coordinates" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Enable World Space", "mdl_name": "world_or_object", "umm_display_name": "Enable World Space" }, { "blender_node": "OmniPBR Compute", "blender_socket": "UV Space Index", "mdl_name": "uv_space_index", "umm_display_name": "UV Space Index" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Normal Map Flip U Tangent", "mdl_name": "flip_tangent_u", "umm_display_name": "Normal Map Flip U Tangent" }, { "blender_node": "OmniPBR Compute", "blender_socket": "Normal Map Flip V Tangent", "mdl_name": "flip_tangent_v", "umm_display_name": "Normal Map Flip V Tangent" } ] }
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/blender/template/omniglass.json
{ "name": "Principled Omni Glass", "nodes": [ { "name": "Frame", "label": "Texture Inputs", "location": [ -1219.9990234375, 150.2413330078125 ], "width": 302.83935546875, "height": 1134.425048828125, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": true }, { "name": "color", "value": [ 0.056128427386283875, 0.6104958653450012, 0.0 ] }, { "name": "shrink", "value": true } ], "texts": [] }, { "name": "Frame.004", "label": "Parameters", "location": [ -367.7474670410156, 230.23788452148438 ], "width": 395.990234375, "height": 800.721435546875, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": true }, { "name": "color", "value": [ 0.05612799897789955, 0.6104958653450012, 0.0 ] }, { "name": "shrink", "value": true } ], "texts": [] }, { "name": "Frame.003", "label": "Output", "location": [ 74.83511352539062, 187.9180908203125 ], "width": 524.638427734375, "height": 655.960693359375, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": true }, { "name": "color", "value": [ 0.6104959845542908, 0.06662588566541672, 0.0 ] }, { "name": "shrink", "value": true } ], "texts": [] }, { "name": "Frame.001", "label": "UVs", "location": [ -1149.3697509765625, 62.31555938720703 ], "width": 200.0, "height": 407.10968017578125, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": true }, { "name": "color", "value": [ 0.05612799897789955, 0.6104958653450012, 0.0 ] }, { "name": "shrink", "value": true } ], "texts": [] }, { "name": "Frame.002", "label": "UV Set", "location": [ -1361.139404296875, 12.778472900390625 ], "width": 210.0, "height": 164.79855346679688, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": true }, { "name": "color", "value": [ 0.6104959845542908, 0.06662588566541672, 0.0 ] }, { "name": "shrink", "value": true } ], "texts": [] }, { "name": "Frame.005", "label": "Information", "location": [ 640.9189453125, 186.14610290527344 ], "width": 587.38134765625, "height": 660.048095703125, "parent": null, "class": "NodeFrame", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "use_custom_color", "value": false }, { "name": "color", "value": [ 0.6079999804496765, 0.6079999804496765, 0.6079999804496765 ] }, { "name": "shrink", "value": true } ], "texts": [ { "name": "UMM_OmniGlass_Information", "contents": "This shader graph is designed for a lossless material pipeline with Omniverse.\n\nAdding nodes, removing nodes, and changing connections can cause the pipeline to no longer be lossless.\n\nYou can change properties on any node in the graph to get the desired look in Blender but only nodes in GREEN frames are evaluated for property values on export. For example, you can select a uv map in the UV Map node but the OmniPBR Compute node's \"UV Space Index\" is what will be exported to the USD file.\n\nAlso, some graph properties will not affect the rendering in Blender. Those properties are simply included to hold values for subsequent exports to Omniverse.\n\nExceptions:\n \n OmniGlass Compute.UseNormalMap - local to Blender." } ] }, { "name": "Material Output", "label": "", "location": [ 295.250732421875, -30.9573974609375 ], "width": 140.0, "height": 100.0, "parent": "Frame.003", "class": "ShaderNodeOutputMaterial", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "UV Map", "label": "", "location": [ 4.2073974609375, -49.97991943359375 ], "width": 150.0, "height": 100.0, "parent": "Frame.002", "class": "ShaderNodeUVMap", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Base Mapping", "label": "Base Mapping", "location": [ 47.6136474609375, -48.20588684082031 ], "width": 140.0, "height": 100.0, "parent": "Frame.001", "class": "ShaderNodeMapping", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Glass Color Texture", "label": "Glass Color Texture", "location": [ 424.06561279296875, 150.18365478515625 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Reflection Color Texture", "label": "Reflection Color Texture", "location": [ 424.8988037109375, -64.53378295898438 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Roughness Texture", "label": "Roughness Texture", "location": [ 423.53704833984375, -286.2510986328125 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Normal Map", "label": "Normal Map", "location": [ 425.6619873046875, -507.0989990234375 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Opacity Map", "label": "Opacity Map", "location": [ 422.8226318359375, -723.33447265625 ], "width": 240.0, "height": 100.0, "parent": "Frame", "class": "ShaderNodeTexImage", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Principled BSDF", "label": "", "location": [ -29.3876953125, -32.7137451171875 ], "width": 240.0, "height": 100.0, "parent": "Frame.003", "class": "ShaderNodeBsdfPrincipled", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "OmniGlass Compute", "label": "OmniGlass Compute", "location": [ -46.68115234375, -43.5164794921875 ], "width": 335.990234375, "height": 100.0, "parent": "Frame.004", "class": "ShaderNodeGroup", "inputs": [ { "index": 0, "name": "Absorbtion Coeff", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 1, "name": "Glass Color", "class": "NodeSocketColor", "default_value": [ 1.0, 1.0, 1.0, 1.0 ] }, { "index": 2, "name": "Glass Color Texture", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 3, "name": "Use Glass Color Texture", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 1 }, { "index": 4, "name": "Volume Absorbtion Scale", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0010000000474974513 }, { "index": 5, "name": "Glass Roughness", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 6, "name": "Roughness Texture", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 7, "name": "Roughness Texture Influence", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 8, "name": "Glass IOR", "class": "NodeSocketFloatFactor", "min_value": 1.0, "max_value": 4.0, "default_value": 1.4910000562667847 }, { "index": 9, "name": "Thin Walled", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 10, "name": "Reflection Color", "class": "NodeSocketColor", "default_value": [ 1.0, 1.0, 1.0, 1.0 ] }, { "index": 11, "name": "Reflection Color Texture", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 12, "name": "Use Reflection Color Texture", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 13, "name": "Normal Map Texture", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 14, "name": "Normal Map Strength", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 10.0, "default_value": 1.0 }, { "index": 15, "name": "Use Normal Map", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 1 }, { "index": 16, "name": "Enable Opacity", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 17, "name": "Enable Opacity Texture", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 18, "name": "Opacity Amount", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 1.0 }, { "index": 19, "name": "Opacity Map RGB", "class": "NodeSocketColor", "default_value": [ 0.0, 0.0, 0.0, 1.0 ] }, { "index": 20, "name": "Opacity Map Alpha", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 21, "name": "Opacity Threshold", "class": "NodeSocketFloatFactor", "min_value": 0.0, "max_value": 1.0, "default_value": 0.0 }, { "index": 22, "name": "Opacity Mono Source", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 3, "default_value": 1 }, { "index": 23, "name": "Enable Project UVW Coordinates", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 24, "name": "Enable World Space", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 25, "name": "UV Space Index", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 512, "default_value": 0 }, { "index": 26, "name": "Normal Map Flip U Tangent", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 0 }, { "index": 27, "name": "Normal Map Flip V Tangent", "class": "NodeSocketIntFactor", "min_value": 0, "max_value": 1, "default_value": 1 } ], "outputs": [ { "index": 0, "name": "Transmission Color", "class": "NodeSocketColor" }, { "index": 1, "name": "Reflection Color", "class": "NodeSocketColor" }, { "index": 2, "name": "IOR", "class": "NodeSocketFloatFactor" }, { "index": 3, "name": "Alpha", "class": "NodeSocketFloatFactor" }, { "index": 4, "name": "Roughness", "class": "NodeSocketColor" }, { "index": 5, "name": "Normal Map", "class": "NodeSocketColor" } ], "nodes": [ { "name": "Group Output", "label": "", "location": [ -605.4928588867188, 495.60650634765625 ], "width": 140.0, "height": 100.0, "parent": null, "class": "NodeGroupOutput", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Albedo Source Switch", "label": "Albedo Source Switch", "location": [ -1369.1771240234375, 535.1587524414062 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Hue Saturation Value", "label": "Hue Saturation Value", "location": [ -1187.199462890625, 529.4342651367188 ], "width": 150.0, "height": 100.0, "parent": null, "class": "ShaderNodeHueSaturation", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Roughness-Factor", "label": "Roughness-Factor", "location": [ -1357.1849365234375, 330.9080810546875 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Reflection Source Switch", "label": "Reflection Source Switch", "location": [ -1098.20849609375, 329.2177429199219 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Normal Source Switch", "label": "Normal Source Switch", "location": [ -1359.841064453125, 120.04290771484375 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5028864145278931, 0.5028865337371826, 1.0, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Normal Map", "label": "Normal Map", "location": [ -1201.84912109375, 125.73359680175781 ], "width": 150.0, "height": 100.0, "parent": null, "class": "ShaderNodeNormalMap", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Opacity Source Switch", "label": "Opacity Source Switch", "location": [ -1683.62353515625, -356.88275146484375 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMixRGB", "inputs": [ { "index": 0, "name": "Fac", "class": "NodeSocketFloatFactor", "default_value": 0.5 }, { "index": 1, "name": "Color1", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] }, { "index": 2, "name": "Color2", "class": "NodeSocketColor", "default_value": [ 0.5, 0.5, 0.5, 1.0 ] } ], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "blend_type", "value": "MIX" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Separate RGB", "label": "", "location": [ -1364.6326904296875, -380.7425231933594 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeSeparateRGB", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] }, { "name": "Math.002", "label": "", "location": [ -1196.0693359375, -361.5117492675781 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMath", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "operation", "value": "MAXIMUM" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "mono_max", "label": "mono_max", "location": [ -1028.76025390625, -366.90924072265625 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMath", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "operation", "value": "MAXIMUM" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "mono_luminance", "label": "mono_luminance", "location": [ -1188.9249267578125, -525.6557006835938 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeVectorMath", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "operation", "value": "DOT_PRODUCT" } ], "texts": [] }, { "name": "mono_average", "label": "mono_average", "location": [ -1186.8319091796875, -723.5472412109375 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeVectorMath", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "operation", "value": "DOT_PRODUCT" } ], "texts": [] }, { "name": "Math.001", "label": "", "location": [ -738.2794799804688, -472.03607177734375 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMath", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "operation", "value": "GREATER_THAN" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Math", "label": "", "location": [ -743.1312255859375, -651.5718383789062 ], "width": 140.0, "height": 100.0, "parent": null, "class": "ShaderNodeMath", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [ { "name": "operation", "value": "COMPARE" }, { "name": "use_clamp", "value": false } ], "texts": [] }, { "name": "Group Input", "label": "", "location": [ -1995.7642822265625, 450.45562744140625 ], "width": 255.241943359375, "height": 100.0, "parent": null, "class": "NodeGroupInput", "inputs": [], "outputs": [], "nodes": [], "links": [], "properties": [], "texts": [] } ], "links": [ { "from_node": "Group Input", "from_socket": "Roughness Texture Influence", "to_node": "Roughness-Factor", "to_socket": "Fac" }, { "from_node": "Roughness-Factor", "from_socket": "Color", "to_node": "Group Output", "to_socket": "Roughness" }, { "from_node": "Group Input", "from_socket": "Glass Roughness", "to_node": "Roughness-Factor", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "Use Glass Color Texture", "to_node": "Albedo Source Switch", "to_socket": "Fac" }, { "from_node": "Normal Map", "from_socket": "Normal", "to_node": "Group Output", "to_socket": "Normal Map" }, { "from_node": "Group Input", "from_socket": "Normal Map Strength", "to_node": "Normal Map", "to_socket": "Strength" }, { "from_node": "Group Input", "from_socket": "Use Normal Map", "to_node": "Normal Source Switch", "to_socket": "Fac" }, { "from_node": "Normal Source Switch", "from_socket": "Color", "to_node": "Normal Map", "to_socket": "Color" }, { "from_node": "Albedo Source Switch", "from_socket": "Color", "to_node": "Hue Saturation Value", "to_socket": "Color" }, { "from_node": "Group Input", "from_socket": "Glass Color Texture", "to_node": "Albedo Source Switch", "to_socket": "Color2" }, { "from_node": "Group Input", "from_socket": "Normal Map Texture", "to_node": "Normal Source Switch", "to_socket": "Color2" }, { "from_node": "Hue Saturation Value", "from_socket": "Color", "to_node": "Group Output", "to_socket": "Transmission Color" }, { "from_node": "Group Input", "from_socket": "Roughness Texture", "to_node": "Roughness-Factor", "to_socket": "Color2" }, { "from_node": "Group Input", "from_socket": "Glass IOR", "to_node": "Group Output", "to_socket": "IOR" }, { "from_node": "Group Input", "from_socket": "Glass Color", "to_node": "Albedo Source Switch", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "Reflection Color", "to_node": "Reflection Source Switch", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "Reflection Color Texture", "to_node": "Reflection Source Switch", "to_socket": "Color2" }, { "from_node": "Group Input", "from_socket": "Use Reflection Color Texture", "to_node": "Reflection Source Switch", "to_socket": "Fac" }, { "from_node": "Reflection Source Switch", "from_socket": "Color", "to_node": "Group Output", "to_socket": "Reflection Color" }, { "from_node": "Group Input", "from_socket": "Opacity Amount", "to_node": "Opacity Source Switch", "to_socket": "Color1" }, { "from_node": "Group Input", "from_socket": "Opacity Map RGB", "to_node": "Opacity Source Switch", "to_socket": "Color2" }, { "from_node": "Group Input", "from_socket": "Enable Opacity Texture", "to_node": "Opacity Source Switch", "to_socket": "Fac" }, { "from_node": "Opacity Source Switch", "from_socket": "Color", "to_node": "mono_luminance", "to_socket": "Vector" }, { "from_node": "Opacity Source Switch", "from_socket": "Color", "to_node": "Separate RGB", "to_socket": "Image" }, { "from_node": "Separate RGB", "from_socket": "R", "to_node": "Math.002", "to_socket": "Value" }, { "from_node": "Separate RGB", "from_socket": "G", "to_node": "Math.002", "to_socket": "Value" }, { "from_node": "Separate RGB", "from_socket": "B", "to_node": "mono_max", "to_socket": "Value" }, { "from_node": "Math.002", "from_socket": "Value", "to_node": "mono_max", "to_socket": "Value" }, { "from_node": "Opacity Source Switch", "from_socket": "Color", "to_node": "mono_average", "to_socket": "Vector" }, { "from_node": "Group Input", "from_socket": "Opacity Threshold", "to_node": "Math", "to_socket": "Value" }, { "from_node": "Group Input", "from_socket": "Opacity Threshold", "to_node": "Math.001", "to_socket": "Value" }, { "from_node": "mono_average", "from_socket": "Value", "to_node": "Math.001", "to_socket": "Value" }, { "from_node": "Group Input", "from_socket": "Opacity Amount", "to_node": "Group Output", "to_socket": "Alpha" } ], "properties": [], "texts": [] } ], "links": [ { "from_node": "Principled BSDF", "from_socket": "BSDF", "to_node": "Material Output", "to_socket": "Surface" }, { "from_node": "OmniGlass Compute", "from_socket": "Roughness", "to_node": "Principled BSDF", "to_socket": "Roughness" }, { "from_node": "Glass Color Texture", "from_socket": "Color", "to_node": "OmniGlass Compute", "to_socket": "Glass Color Texture" }, { "from_node": "OmniGlass Compute", "from_socket": "Transmission Color", "to_node": "Principled BSDF", "to_socket": "Base Color" }, { "from_node": "Roughness Texture", "from_socket": "Color", "to_node": "OmniGlass Compute", "to_socket": "Roughness Texture" }, { "from_node": "OmniGlass Compute", "from_socket": "Normal Map", "to_node": "Principled BSDF", "to_socket": "Normal" }, { "from_node": "Normal Map", "from_socket": "Color", "to_node": "OmniGlass Compute", "to_socket": "Normal Map Texture" }, { "from_node": "UV Map", "from_socket": "UV", "to_node": "Base Mapping", "to_socket": "Vector" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Glass Color Texture", "to_socket": "Vector" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Roughness Texture", "to_socket": "Vector" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Normal Map", "to_socket": "Vector" }, { "from_node": "Opacity Map", "from_socket": "Color", "to_node": "OmniGlass Compute", "to_socket": "Opacity Map RGB" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Opacity Map", "to_socket": "Vector" }, { "from_node": "OmniGlass Compute", "from_socket": "IOR", "to_node": "Principled BSDF", "to_socket": "IOR" }, { "from_node": "OmniGlass Compute", "from_socket": "Alpha", "to_node": "Principled BSDF", "to_socket": "Alpha" }, { "from_node": "Opacity Map", "from_socket": "Alpha", "to_node": "OmniGlass Compute", "to_socket": "Opacity Map Alpha" }, { "from_node": "Base Mapping", "from_socket": "Vector", "to_node": "Reflection Color Texture", "to_socket": "Vector" }, { "from_node": "Reflection Color Texture", "from_socket": "Color", "to_node": "OmniGlass Compute", "to_socket": "Reflection Color Texture" } ] }
NVIDIA-Omniverse/Blender-Addon-UMM/omni/universalmaterialmap/blender/template/omniglass_map.json
{ "maps": [ { "blender_node": "OmniGlass Compute", "blender_socket": "Absorbtion Coeff", "mdl_name": "", "umm_display_name": "Absorbtion Coeff" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Glass Color", "mdl_name": "", "umm_display_name": "Glass Color" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Use Glass Color Texture", "mdl_name": "", "umm_display_name": "Use Glass Color Texture" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Volume Absorbtion Scale", "mdl_name": "", "umm_display_name": "Volume Absorbtion Scale" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Glass Roughness", "mdl_name": "", "umm_display_name": "Glass Roughness" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Roughness Texture Influence", "mdl_name": "", "umm_display_name": "Roughness Texture Influence" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Glass IOR", "mdl_name": "", "umm_display_name": "Glass IOR" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Thin Walled", "mdl_name": "", "umm_display_name": "Thin Walled" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Reflection Color", "mdl_name": "", "umm_display_name": "Reflection Color" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Normal Map Strength", "mdl_name": "", "umm_display_name": "Normal Map Strength" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Enable Opacity", "mdl_name": "", "umm_display_name": "Enable Opacity" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Opacity Amount", "mdl_name": "", "umm_display_name": "Opacity Amount" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Opacity Threshold", "mdl_name": "", "umm_display_name": "Opacity Threshold" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Opacity Mono Source", "mdl_name": "", "umm_display_name": "Opacity Mono Source" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Enable Project UVW Coordinates", "mdl_name": "", "umm_display_name": "Enable Project UVW Coordinates" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Enable World Space", "mdl_name": "", "umm_display_name": "Enable World Space" }, { "blender_node": "OmniGlass Compute", "blender_socket": "UV Space Index", "mdl_name": "", "umm_display_name": "UV Space Index" }, { "blender_node": "Base Mapping", "blender_socket": "Rotation", "mdl_name": "texture_rotate", "umm_display_name": "Texture Rotate" }, { "blender_node": "Base Mapping", "blender_socket": "Scale", "mdl_name": "texture_scale", "umm_display_name": "Texture Scale" }, { "blender_node": "Base Mapping", "blender_socket": "Location", "mdl_name": "texture_translate", "umm_display_name": "Texture Translate" }, { "blender_node": "Glass Color Texture", "blender_socket": "image", "mdl_name": "", "umm_display_name": "Glass Color Texture" }, { "blender_node": "Reflection Color Texture", "blender_socket": "image", "mdl_name": "", "umm_display_name": "Reflection Color Texture" }, { "blender_node": "Roughness Color Texture", "blender_socket": "image", "mdl_name": "", "umm_display_name": "Roughness Color Texture" }, { "blender_node": "Normal Map", "blender_socket": "image", "mdl_name": "", "umm_display_name": "Normal Map" }, { "blender_node": "Opacity Map", "blender_socket": "image", "mdl_name": "", "umm_display_name": "Opacity Map" }, { "blender_node": "Roughness Texture", "blender_socket": "image", "mdl_name": "", "umm_display_name": "Roughness Texture" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Normal Map Flip U Tangent", "mdl_name": "flip_tangent_u", "umm_display_name": "Normal Map Flip U Tangent" }, { "blender_node": "OmniGlass Compute", "blender_socket": "Normal Map Flip V Tangent", "mdl_name": "flip_tangent_v", "umm_display_name": "Normal Map Flip V Tangent" } ] }
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/link_app.sh
#!/bin/bash set -e SCRIPT_DIR=$(dirname ${BASH_SOURCE}) cd "$SCRIPT_DIR" exec "tools/packman/python.sh" tools/scripts/link_app.py $@
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/link_app.bat
@echo off call "%~dp0tools\packman\python.bat" %~dp0tools\scripts\link_app.py %* if %errorlevel% neq 0 ( goto Error ) :Success exit /b 0 :Error exit /b %errorlevel%
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/README.md
# AI Room Generator Extension Sample ![Extension Preview](exts/omni.example.airoomgenerator/data/preview.png) ### About This extension allows user's to generate 3D content using Generative AI, ChatGPT. Providing an area in the stage and a prompt the user can generate a room configuration designed by ChatGPT. This in turn can help end users automatically generate and place objects within their scene, saving hours of time that would typically be required to create a complex scene. ### [README](exts/omni.example.airoomgenerator) See the [README for this extension](exts/omni.example.airoomgenerator) to learn more about it including how to use it. > This sample is for educational purposes. For production please consider best security practices and scalability. ## Adding This Extension This folder is ready to be pushed to any git repository. Once pushed direct link to a git repository can be added to *Omniverse Kit* extension search paths. Link might look like this: `git://github.com/NVIDIA-Omniverse/kit-extension-sample-airoomgenerator?branch=main&dir=exts` Notice `exts` is repo subfolder with extensions. More information can be found in "Git URL as Extension Search Paths" section of developers manual. To add a link to your *Omniverse Kit* based app go into: Extension Manager -> Gear Icon -> Extension Search Path ## Linking with an Omniverse app If `app` folder link doesn't exist or broken it can be created again. For better developer experience it is recommended to create a folder link named `app` to the *Omniverse Kit* app installed from *Omniverse Launcher*. Convenience script to use is included. Run: ``` > link_app.bat ``` If successful you should see `app` folder link in the root of this repo. If multiple Omniverse apps is installed script will select recommended one. Or you can explicitly pass an app: ``` > link_app.bat --app create ``` You can also just pass a path to create link to: ``` > link_app.bat --path "C:/Users/bob/AppData/Local/ov/pkg/create-2021.3.4" ``` # Contributing The source code for this repository is provided as-is and we are not accepting outside contributions.
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/tools/scripts/link_app.py
import os import argparse import sys import json import packmanapi import urllib3 def find_omniverse_apps(): http = urllib3.PoolManager() try: r = http.request("GET", "http://127.0.0.1:33480/components") except Exception as e: print(f"Failed retrieving apps from an Omniverse Launcher, maybe it is not installed?\nError: {e}") sys.exit(1) apps = {} for x in json.loads(r.data.decode("utf-8")): latest = x.get("installedVersions", {}).get("latest", "") if latest: for s in x.get("settings", []): if s.get("version", "") == latest: root = s.get("launch", {}).get("root", "") apps[x["slug"]] = (x["name"], root) break return apps def create_link(src, dst): print(f"Creating a link '{src}' -> '{dst}'") packmanapi.link(src, dst) APP_PRIORITIES = ["code", "create", "view"] if __name__ == "__main__": parser = argparse.ArgumentParser(description="Create folder link to Kit App installed from Omniverse Launcher") parser.add_argument( "--path", help="Path to Kit App installed from Omniverse Launcher, e.g.: 'C:/Users/bob/AppData/Local/ov/pkg/create-2021.3.4'", required=False, ) parser.add_argument( "--app", help="Name of Kit App installed from Omniverse Launcher, e.g.: 'code', 'create'", required=False ) args = parser.parse_args() path = args.path if not path: print("Path is not specified, looking for Omniverse Apps...") apps = find_omniverse_apps() if len(apps) == 0: print( "Can't find any Omniverse Apps. Use Omniverse Launcher to install one. 'Code' is the recommended app for developers." ) sys.exit(0) print("\nFound following Omniverse Apps:") for i, slug in enumerate(apps): name, root = apps[slug] print(f"{i}: {name} ({slug}) at: '{root}'") if args.app: selected_app = args.app.lower() if selected_app not in apps: choices = ", ".join(apps.keys()) print(f"Passed app: '{selected_app}' is not found. Specify one of the following found Apps: {choices}") sys.exit(0) else: selected_app = next((x for x in APP_PRIORITIES if x in apps), None) if not selected_app: selected_app = next(iter(apps)) print(f"\nSelected app: {selected_app}") _, path = apps[selected_app] if not os.path.exists(path): print(f"Provided path doesn't exist: {path}") else: SCRIPT_ROOT = os.path.dirname(os.path.realpath(__file__)) create_link(f"{SCRIPT_ROOT}/../../app", path) print("Success!")
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/tools/packman/python.sh
#!/bin/bash # Copyright 2019-2020 NVIDIA CORPORATION # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -e PACKMAN_CMD="$(dirname "${BASH_SOURCE}")/packman" if [ ! -f "$PACKMAN_CMD" ]; then PACKMAN_CMD="${PACKMAN_CMD}.sh" fi source "$PACKMAN_CMD" init export PYTHONPATH="${PM_MODULE_DIR}:${PYTHONPATH}" export PYTHONNOUSERSITE=1 # workaround for our python not shipping with certs if [[ -z ${SSL_CERT_DIR:-} ]]; then export SSL_CERT_DIR=/etc/ssl/certs/ fi "${PM_PYTHON}" -u "$@"
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/tools/packman/python.bat
:: Copyright 2019-2020 NVIDIA CORPORATION :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. :: You may obtain a copy of the License at :: :: http://www.apache.org/licenses/LICENSE-2.0 :: :: Unless required by applicable law or agreed to in writing, software :: distributed under the License is distributed on an "AS IS" BASIS, :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. :: See the License for the specific language governing permissions and :: limitations under the License. @echo off setlocal call "%~dp0\packman" init set "PYTHONPATH=%PM_MODULE_DIR%;%PYTHONPATH%" set PYTHONNOUSERSITE=1 "%PM_PYTHON%" -u %*
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/tools/packman/packman.cmd
:: Reset errorlevel status (don't inherit from caller) [xxxxxxxxxxx] @call :ECHO_AND_RESET_ERROR :: You can remove the call below if you do your own manual configuration of the dev machines call "%~dp0\bootstrap\configure.bat" if %errorlevel% neq 0 ( exit /b %errorlevel% ) :: Everything below is mandatory if not defined PM_PYTHON goto :PYTHON_ENV_ERROR if not defined PM_MODULE goto :MODULE_ENV_ERROR :: Generate temporary path for variable file for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile ^ -File "%~dp0bootstrap\generate_temp_file_name.ps1"') do set PM_VAR_PATH=%%a if %1.==. ( set PM_VAR_PATH_ARG= ) else ( set PM_VAR_PATH_ARG=--var-path="%PM_VAR_PATH%" ) "%PM_PYTHON%" -S -s -u -E "%PM_MODULE%" %* %PM_VAR_PATH_ARG% if %errorlevel% neq 0 ( exit /b %errorlevel% ) :: Marshall environment variables into the current environment if they have been generated and remove temporary file if exist "%PM_VAR_PATH%" ( for /F "usebackq tokens=*" %%A in ("%PM_VAR_PATH%") do set "%%A" ) if %errorlevel% neq 0 ( goto :VAR_ERROR ) if exist "%PM_VAR_PATH%" ( del /F "%PM_VAR_PATH%" ) if %errorlevel% neq 0 ( goto :VAR_ERROR ) set PM_VAR_PATH= goto :eof :: Subroutines below :PYTHON_ENV_ERROR @echo User environment variable PM_PYTHON is not set! Please configure machine for packman or call configure.bat. exit /b 1 :MODULE_ENV_ERROR @echo User environment variable PM_MODULE is not set! Please configure machine for packman or call configure.bat. exit /b 1 :VAR_ERROR @echo Error while processing and setting environment variables! exit /b 1 :ECHO_AND_RESET_ERROR @echo off if /I "%PM_VERBOSITY%"=="debug" ( @echo on ) exit /b 0
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/tools/packman/config.packman.xml
<config remotes="cloudfront"> <remote2 name="cloudfront"> <transport actions="download" protocol="https" packageLocation="d4i3qtqj3r0z5.cloudfront.net/${name}@${version}" /> </remote2> </config>
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/tools/packman/bootstrap/generate_temp_file_name.ps1
<# Copyright 2019 NVIDIA CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. #> $out = [System.IO.Path]::GetTempFileName() Write-Host $out # SIG # Begin signature block # MIIaVwYJKoZIhvcNAQcCoIIaSDCCGkQCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAK+Ewup1N0/mdf # 1l4R58rxyumHgZvTmEhrYTb2Zf0zd6CCCiIwggTTMIIDu6ADAgECAhBi50XpIWUh # PJcfXEkK6hKlMA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0 # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg # U2lnbmluZyBDQSAtIEcyMB4XDTE4MDcwOTAwMDAwMFoXDTIxMDcwOTIzNTk1OVow # gYMxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRQwEgYDVQQHDAtT # YW50YSBDbGFyYTEbMBkGA1UECgwSTlZJRElBIENvcnBvcmF0aW9uMQ8wDQYDVQQL # DAZJVC1NSVMxGzAZBgNVBAMMEk5WSURJQSBDb3Jwb3JhdGlvbjCCASIwDQYJKoZI # hvcNAQEBBQADggEPADCCAQoCggEBALEZN63dA47T4i90jZ84CJ/aWUwVtLff8AyP # YspFfIZGdZYiMgdb8A5tBh7653y0G/LZL6CVUkgejcpvBU/Dl/52a+gSWy2qJ2bH # jMFMKCyQDhdpCAKMOUKSC9rfzm4cFeA9ct91LQCAait4LhLlZt/HF7aG+r0FgCZa # HJjJvE7KNY9G4AZXxjSt8CXS8/8NQMANqjLX1r+F+Hl8PzQ1fVx0mMsbdtaIV4Pj # 5flAeTUnz6+dCTx3vTUo8MYtkS2UBaQv7t7H2B7iwJDakEQKk1XHswJdeqG0osDU # z6+NVks7uWE1N8UIhvzbw0FEX/U2kpfyWaB/J3gMl8rVR8idPj8CAwEAAaOCAT4w # ggE6MAkGA1UdEwQCMAAwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUF # BwMDMGEGA1UdIARaMFgwVgYGZ4EMAQQBMEwwIwYIKwYBBQUHAgEWF2h0dHBzOi8v # ZC5zeW1jYi5jb20vY3BzMCUGCCsGAQUFBwICMBkMF2h0dHBzOi8vZC5zeW1jYi5j # b20vcnBhMB8GA1UdIwQYMBaAFNTABiJJ6zlL3ZPiXKG4R3YJcgNYMCsGA1UdHwQk # MCIwIKAeoByGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIuY3JsMFcGCCsGAQUFBwEB # BEswSTAfBggrBgEFBQcwAYYTaHR0cDovL3JiLnN5bWNkLmNvbTAmBggrBgEFBQcw # AoYaaHR0cDovL3JiLnN5bWNiLmNvbS9yYi5jcnQwDQYJKoZIhvcNAQELBQADggEB # AIJKh5vKJdhHJtMzATmc1BmXIQ3RaJONOZ5jMHn7HOkYU1JP0OIzb4pXXkH8Xwfr # K6bnd72IhcteyksvKsGpSvK0PBBwzodERTAu1Os2N+EaakxQwV/xtqDm1E3IhjHk # fRshyKKzmFk2Ci323J4lHtpWUj5Hz61b8gd72jH7xnihGi+LORJ2uRNZ3YuqMNC3 # SBC8tAyoJqEoTJirULUCXW6wX4XUm5P2sx+htPw7szGblVKbQ+PFinNGnsSEZeKz # D8jUb++1cvgTKH59Y6lm43nsJjkZU77tNqyq4ABwgQRk6lt8cS2PPwjZvTmvdnla # ZhR0K4of+pQaUQHXVIBdji8wggVHMIIEL6ADAgECAhB8GzU1SufbdOdBXxFpymuo # MA0GCSqGSIb3DQEBCwUAMIG9MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNp # Z24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNV # BAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl # IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmlj # YXRpb24gQXV0aG9yaXR5MB4XDTE0MDcyMjAwMDAwMFoXDTI0MDcyMTIzNTk1OVow # gYQxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEf # MB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazE1MDMGA1UEAxMsU3ltYW50 # ZWMgQ2xhc3MgMyBTSEEyNTYgQ29kZSBTaWduaW5nIENBIC0gRzIwggEiMA0GCSqG # SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDXlUPU3N9nrjn7UqS2JjEEcOm3jlsqujdp # NZWPu8Aw54bYc7vf69F2P4pWjustS/BXGE6xjaUz0wt1I9VqeSfdo9P3Dodltd6t # HPH1NbQiUa8iocFdS5B/wFlOq515qQLXHkmxO02H/sJ4q7/vUq6crwjZOeWaUT5p # XzAQTnFjbFjh8CAzGw90vlvLEuHbjMSAlHK79kWansElC/ujHJ7YpglwcezAR0yP # fcPeGc4+7gRyjhfT//CyBTIZTNOwHJ/+pXggQnBBsCaMbwDIOgARQXpBsKeKkQSg # mXj0d7TzYCrmbFAEtxRg/w1R9KiLhP4h2lxeffUpeU+wRHRvbXL/AgMBAAGjggF4 # MIIBdDAuBggrBgEFBQcBAQQiMCAwHgYIKwYBBQUHMAGGEmh0dHA6Ly9zLnN5bWNk # LmNvbTASBgNVHRMBAf8ECDAGAQH/AgEAMGYGA1UdIARfMF0wWwYLYIZIAYb4RQEH # FwMwTDAjBggrBgEFBQcCARYXaHR0cHM6Ly9kLnN5bWNiLmNvbS9jcHMwJQYIKwYB # BQUHAgIwGRoXaHR0cHM6Ly9kLnN5bWNiLmNvbS9ycGEwNgYDVR0fBC8wLTAroCmg # J4YlaHR0cDovL3Muc3ltY2IuY29tL3VuaXZlcnNhbC1yb290LmNybDATBgNVHSUE # DDAKBggrBgEFBQcDAzAOBgNVHQ8BAf8EBAMCAQYwKQYDVR0RBCIwIKQeMBwxGjAY # BgNVBAMTEVN5bWFudGVjUEtJLTEtNzI0MB0GA1UdDgQWBBTUwAYiSes5S92T4lyh # uEd2CXIDWDAfBgNVHSMEGDAWgBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG # 9w0BAQsFAAOCAQEAf+vKp+qLdkLrPo4gVDDjt7nc+kg+FscPRZUQzSeGo2bzAu1x # +KrCVZeRcIP5Un5SaTzJ8eCURoAYu6HUpFam8x0AkdWG80iH4MvENGggXrTL+QXt # nK9wUye56D5+UaBpcYvcUe2AOiUyn0SvbkMo0yF1u5fYi4uM/qkERgSF9xWcSxGN # xCwX/tVuf5riVpLxlrOtLfn039qJmc6yOETA90d7yiW5+ipoM5tQct6on9TNLAs0 # vYsweEDgjY4nG5BvGr4IFYFd6y/iUedRHsl4KeceZb847wFKAQkkDhbEFHnBQTc0 # 0D2RUpSd4WjvCPDiaZxnbpALGpNx1CYCw8BaIzGCD4swgg+HAgEBMIGZMIGEMQsw # CQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNV # BAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENs # YXNzIDMgU0hBMjU2IENvZGUgU2lnbmluZyBDQSAtIEcyAhBi50XpIWUhPJcfXEkK # 6hKlMA0GCWCGSAFlAwQCAQUAoHwwEAYKKwYBBAGCNwIBDDECMAAwGQYJKoZIhvcN # AQkDMQwGCisGAQQBgjcCAQQwHAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUw # LwYJKoZIhvcNAQkEMSIEIPW+EpFrZSdzrjFFo0UT+PzFeYn/GcWNyWFaU/JMrMfR # MA0GCSqGSIb3DQEBAQUABIIBAA8fmU/RJcF9t60DZZAjf8FB3EZddOaHgI9z40nV # CnfTGi0OEYU48Pe9jkQQV2fABpACfW74xmNv3QNgP2qP++mkpKBVv28EIAuINsFt # YAITEljLN/VOVul8lvjxar5GSFFgpE5F6j4xcvI69LuCWbN8cteTVsBGg+eGmjfx # QZxP252z3FqPN+mihtFegF2wx6Mg6/8jZjkO0xjBOwSdpTL4uyQfHvaPBKXuWxRx # ioXw4ezGAwkuBoxWK8UG7Qu+7CSfQ3wMOjvyH2+qn30lWEsvRMdbGAp7kvfr3EGZ # a3WN7zXZ+6KyZeLeEH7yCDzukAjptaY/+iLVjJsuzC6tCSqhgg1EMIINQAYKKwYB # BAGCNwMDATGCDTAwgg0sBgkqhkiG9w0BBwKggg0dMIINGQIBAzEPMA0GCWCGSAFl # AwQCAQUAMHcGCyqGSIb3DQEJEAEEoGgEZjBkAgEBBglghkgBhv1sBwEwMTANBglg # hkgBZQMEAgEFAAQg14BnPazQkW9whhZu1d0bC3lqqScvxb3SSb1QT8e3Xg0CEFhw # aMBZ2hExXhr79A9+bXEYDzIwMjEwNDA4MDkxMTA5WqCCCjcwggT+MIID5qADAgEC # AhANQkrgvjqI/2BAIc4UAPDdMA0GCSqGSIb3DQEBCwUAMHIxCzAJBgNVBAYTAlVT # MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j # b20xMTAvBgNVBAMTKERpZ2lDZXJ0IFNIQTIgQXNzdXJlZCBJRCBUaW1lc3RhbXBp # bmcgQ0EwHhcNMjEwMTAxMDAwMDAwWhcNMzEwMTA2MDAwMDAwWjBIMQswCQYDVQQG # EwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xIDAeBgNVBAMTF0RpZ2lDZXJ0 # IFRpbWVzdGFtcCAyMDIxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA # wuZhhGfFivUNCKRFymNrUdc6EUK9CnV1TZS0DFC1JhD+HchvkWsMlucaXEjvROW/ # m2HNFZFiWrj/ZwucY/02aoH6KfjdK3CF3gIY83htvH35x20JPb5qdofpir34hF0e # dsnkxnZ2OlPR0dNaNo/Go+EvGzq3YdZz7E5tM4p8XUUtS7FQ5kE6N1aG3JMjjfdQ # Jehk5t3Tjy9XtYcg6w6OLNUj2vRNeEbjA4MxKUpcDDGKSoyIxfcwWvkUrxVfbENJ # Cf0mI1P2jWPoGqtbsR0wwptpgrTb/FZUvB+hh6u+elsKIC9LCcmVp42y+tZji06l # chzun3oBc/gZ1v4NSYS9AQIDAQABo4IBuDCCAbQwDgYDVR0PAQH/BAQDAgeAMAwG # A1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwgwQQYDVR0gBDowODA2 # BglghkgBhv1sBwEwKTAnBggrBgEFBQcCARYbaHR0cDovL3d3dy5kaWdpY2VydC5j # b20vQ1BTMB8GA1UdIwQYMBaAFPS24SAd/imu0uRhpbKiJbLIFzVuMB0GA1UdDgQW # BBQ2RIaOpLqwZr68KC0dRDbd42p6vDBxBgNVHR8EajBoMDKgMKAuhixodHRwOi8v # Y3JsMy5kaWdpY2VydC5jb20vc2hhMi1hc3N1cmVkLXRzLmNybDAyoDCgLoYsaHR0 # cDovL2NybDQuZGlnaWNlcnQuY29tL3NoYTItYXNzdXJlZC10cy5jcmwwgYUGCCsG # AQUFBwEBBHkwdzAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29t # ME8GCCsGAQUFBzAChkNodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNl # cnRTSEEyQXNzdXJlZElEVGltZXN0YW1waW5nQ0EuY3J0MA0GCSqGSIb3DQEBCwUA # A4IBAQBIHNy16ZojvOca5yAOjmdG/UJyUXQKI0ejq5LSJcRwWb4UoOUngaVNFBUZ # B3nw0QTDhtk7vf5EAmZN7WmkD/a4cM9i6PVRSnh5Nnont/PnUp+Tp+1DnnvntN1B # Ion7h6JGA0789P63ZHdjXyNSaYOC+hpT7ZDMjaEXcw3082U5cEvznNZ6e9oMvD0y # 0BvL9WH8dQgAdryBDvjA4VzPxBFy5xtkSdgimnUVQvUtMjiB2vRgorq0Uvtc4GEk # JU+y38kpqHNDUdq9Y9YfW5v3LhtPEx33Sg1xfpe39D+E68Hjo0mh+s6nv1bPull2 # YYlffqe0jmd4+TaY4cso2luHpoovMIIFMTCCBBmgAwIBAgIQCqEl1tYyG35B5AXa # NpfCFTANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGln # aUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtE # aWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMTYwMTA3MTIwMDAwWhcNMzEw # MTA3MTIwMDAwWjByMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5j # MRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMTEwLwYDVQQDEyhEaWdpQ2VydCBT # SEEyIEFzc3VyZWQgSUQgVGltZXN0YW1waW5nIENBMIIBIjANBgkqhkiG9w0BAQEF # AAOCAQ8AMIIBCgKCAQEAvdAy7kvNj3/dqbqCmcU5VChXtiNKxA4HRTNREH3Q+X1N # aH7ntqD0jbOI5Je/YyGQmL8TvFfTw+F+CNZqFAA49y4eO+7MpvYyWf5fZT/gm+vj # RkcGGlV+Cyd+wKL1oODeIj8O/36V+/OjuiI+GKwR5PCZA207hXwJ0+5dyJoLVOOo # CXFr4M8iEA91z3FyTgqt30A6XLdR4aF5FMZNJCMwXbzsPGBqrC8HzP3w6kfZiFBe # /WZuVmEnKYmEUeaC50ZQ/ZQqLKfkdT66mA+Ef58xFNat1fJky3seBdCEGXIX8RcG # 7z3N1k3vBkL9olMqT4UdxB08r8/arBD13ays6Vb/kwIDAQABo4IBzjCCAcowHQYD # VR0OBBYEFPS24SAd/imu0uRhpbKiJbLIFzVuMB8GA1UdIwQYMBaAFEXroq/0ksuC # MS1Ri6enIZ3zbcgPMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgGG # MBMGA1UdJQQMMAoGCCsGAQUFBwMIMHkGCCsGAQUFBwEBBG0wazAkBggrBgEFBQcw # AYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tMEMGCCsGAQUFBzAChjdodHRwOi8v # Y2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNlcnRBc3N1cmVkSURSb290Q0EuY3J0 # MIGBBgNVHR8EejB4MDqgOKA2hjRodHRwOi8vY3JsNC5kaWdpY2VydC5jb20vRGln # aUNlcnRBc3N1cmVkSURSb290Q0EuY3JsMDqgOKA2hjRodHRwOi8vY3JsMy5kaWdp # Y2VydC5jb20vRGlnaUNlcnRBc3N1cmVkSURSb290Q0EuY3JsMFAGA1UdIARJMEcw # OAYKYIZIAYb9bAACBDAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2Vy # dC5jb20vQ1BTMAsGCWCGSAGG/WwHATANBgkqhkiG9w0BAQsFAAOCAQEAcZUS6VGH # VmnN793afKpjerN4zwY3QITvS4S/ys8DAv3Fp8MOIEIsr3fzKx8MIVoqtwU0HWqu # mfgnoma/Capg33akOpMP+LLR2HwZYuhegiUexLoceywh4tZbLBQ1QwRostt1AuBy # x5jWPGTlH0gQGF+JOGFNYkYkh2OMkVIsrymJ5Xgf1gsUpYDXEkdws3XVk4WTfraS # Z/tTYYmo9WuWwPRYaQ18yAGxuSh1t5ljhSKMYcp5lH5Z/IwP42+1ASa2bKXuh1Eh # 5Fhgm7oMLSttosR+u8QlK0cCCHxJrhO24XxCQijGGFbPQTS2Zl22dHv1VjMiLyI2 # skuiSpXY9aaOUjGCAk0wggJJAgEBMIGGMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK # EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNV # BAMTKERpZ2lDZXJ0IFNIQTIgQXNzdXJlZCBJRCBUaW1lc3RhbXBpbmcgQ0ECEA1C # SuC+Ooj/YEAhzhQA8N0wDQYJYIZIAWUDBAIBBQCggZgwGgYJKoZIhvcNAQkDMQ0G # CyqGSIb3DQEJEAEEMBwGCSqGSIb3DQEJBTEPFw0yMTA0MDgwOTExMDlaMCsGCyqG # SIb3DQEJEAIMMRwwGjAYMBYEFOHXgqjhkb7va8oWkbWqtJSmJJvzMC8GCSqGSIb3 # DQEJBDEiBCCHEAmNNj2zWjWYRfEi4FgzZvrI16kv/U2b9b3oHw6UVDANBgkqhkiG # 9w0BAQEFAASCAQCdefEKh6Qmwx7xGCkrYi/A+/Cla6LdnYJp38eMs3fqTTvjhyDw # HffXrwdqWy5/fgW3o3qJXqa5o7hLxYIoWSULOCpJRGdt+w7XKPAbZqHrN9elAhWJ # vpBTCEaj7dVxr1Ka4NsoPSYe0eidDBmmvGvp02J4Z1j8+ImQPKN6Hv/L8Ixaxe7V # mH4VtXIiBK8xXdi4wzO+A+qLtHEJXz3Gw8Bp3BNtlDGIUkIhVTM3Q1xcSEqhOLqo # PGdwCw9acxdXNWWPjOJkNH656Bvmkml+0p6MTGIeG4JCeRh1Wpqm1ZGSoEcXNaof # wOgj48YzI+dNqBD9i7RSWCqJr2ygYKRTxnuU # SIG # End signature block
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/tools/packman/bootstrap/configure.bat
:: Copyright 2019 NVIDIA CORPORATION :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. :: You may obtain a copy of the License at :: :: http://www.apache.org/licenses/LICENSE-2.0 :: :: Unless required by applicable law or agreed to in writing, software :: distributed under the License is distributed on an "AS IS" BASIS, :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. :: See the License for the specific language governing permissions and :: limitations under the License. set PM_PACKMAN_VERSION=6.33.2 :: Specify where packman command is rooted set PM_INSTALL_PATH=%~dp0.. :: The external root may already be configured and we should do minimal work in that case if defined PM_PACKAGES_ROOT goto ENSURE_DIR :: If the folder isn't set we assume that the best place for it is on the drive that we are currently :: running from set PM_DRIVE=%CD:~0,2% set PM_PACKAGES_ROOT=%PM_DRIVE%\packman-repo :: We use *setx* here so that the variable is persisted in the user environment echo Setting user environment variable PM_PACKAGES_ROOT to %PM_PACKAGES_ROOT% setx PM_PACKAGES_ROOT %PM_PACKAGES_ROOT% if %errorlevel% neq 0 ( goto ERROR ) :: The above doesn't work properly from a build step in VisualStudio because a separate process is :: spawned for it so it will be lost for subsequent compilation steps - VisualStudio must :: be launched from a new process. We catch this odd-ball case here: if defined PM_DISABLE_VS_WARNING goto ENSURE_DIR if not defined VSLANG goto ENSURE_DIR echo The above is a once-per-computer operation. Unfortunately VisualStudio cannot pick up environment change echo unless *VisualStudio is RELAUNCHED*. echo If you are launching VisualStudio from command line or command line utility make sure echo you have a fresh launch environment (relaunch the command line or utility). echo If you are using 'linkPath' and referring to packages via local folder links you can safely ignore this warning. echo You can disable this warning by setting the environment variable PM_DISABLE_VS_WARNING. echo. :: Check for the directory that we need. Note that mkdir will create any directories :: that may be needed in the path :ENSURE_DIR if not exist "%PM_PACKAGES_ROOT%" ( echo Creating directory %PM_PACKAGES_ROOT% mkdir "%PM_PACKAGES_ROOT%" ) if %errorlevel% neq 0 ( goto ERROR_MKDIR_PACKAGES_ROOT ) :: The Python interpreter may already be externally configured if defined PM_PYTHON_EXT ( set PM_PYTHON=%PM_PYTHON_EXT% goto PACKMAN ) set PM_PYTHON_VERSION=3.7.9-windows-x86_64 set PM_PYTHON_BASE_DIR=%PM_PACKAGES_ROOT%\python set PM_PYTHON_DIR=%PM_PYTHON_BASE_DIR%\%PM_PYTHON_VERSION% set PM_PYTHON=%PM_PYTHON_DIR%\python.exe if exist "%PM_PYTHON%" goto PACKMAN if not exist "%PM_PYTHON_BASE_DIR%" call :CREATE_PYTHON_BASE_DIR set PM_PYTHON_PACKAGE=python@%PM_PYTHON_VERSION%.cab for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_file_name.ps1"') do set TEMP_FILE_NAME=%%a set TARGET=%TEMP_FILE_NAME%.zip call "%~dp0fetch_file_from_packman_bootstrap.cmd" %PM_PYTHON_PACKAGE% "%TARGET%" if %errorlevel% neq 0 ( echo !!! Error fetching python from CDN !!! goto ERROR ) for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_folder.ps1" -parentPath "%PM_PYTHON_BASE_DIR%"') do set TEMP_FOLDER_NAME=%%a echo Unpacking Python interpreter ... "%SystemRoot%\system32\expand.exe" -F:* "%TARGET%" "%TEMP_FOLDER_NAME%" 1> nul del "%TARGET%" :: Failure during extraction to temp folder name, need to clean up and abort if %errorlevel% neq 0 ( echo !!! Error unpacking python !!! call :CLEAN_UP_TEMP_FOLDER goto ERROR ) :: If python has now been installed by a concurrent process we need to clean up and then continue if exist "%PM_PYTHON%" ( call :CLEAN_UP_TEMP_FOLDER goto PACKMAN ) else ( if exist "%PM_PYTHON_DIR%" ( rd /s /q "%PM_PYTHON_DIR%" > nul ) ) :: Perform atomic rename rename "%TEMP_FOLDER_NAME%" "%PM_PYTHON_VERSION%" 1> nul :: Failure during move, need to clean up and abort if %errorlevel% neq 0 ( echo !!! Error renaming python !!! call :CLEAN_UP_TEMP_FOLDER goto ERROR ) :PACKMAN :: The packman module may already be externally configured if defined PM_MODULE_DIR_EXT ( set PM_MODULE_DIR=%PM_MODULE_DIR_EXT% ) else ( set PM_MODULE_DIR=%PM_PACKAGES_ROOT%\packman-common\%PM_PACKMAN_VERSION% ) set PM_MODULE=%PM_MODULE_DIR%\packman.py if exist "%PM_MODULE%" goto ENSURE_7ZA set PM_MODULE_PACKAGE=packman-common@%PM_PACKMAN_VERSION%.zip for /f "delims=" %%a in ('powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0\generate_temp_file_name.ps1"') do set TEMP_FILE_NAME=%%a set TARGET=%TEMP_FILE_NAME% call "%~dp0fetch_file_from_packman_bootstrap.cmd" %PM_MODULE_PACKAGE% "%TARGET%" if %errorlevel% neq 0 ( echo !!! Error fetching packman from CDN !!! goto ERROR ) echo Unpacking ... "%PM_PYTHON%" -S -s -u -E "%~dp0\install_package.py" "%TARGET%" "%PM_MODULE_DIR%" if %errorlevel% neq 0 ( echo !!! Error unpacking packman !!! goto ERROR ) del "%TARGET%" :ENSURE_7ZA set PM_7Za_VERSION=16.02.4 set PM_7Za_PATH=%PM_PACKAGES_ROOT%\7za\%PM_7ZA_VERSION% if exist "%PM_7Za_PATH%" goto END set PM_7Za_PATH=%PM_PACKAGES_ROOT%\chk\7za\%PM_7ZA_VERSION% if exist "%PM_7Za_PATH%" goto END "%PM_PYTHON%" -S -s -u -E "%PM_MODULE%" pull "%PM_MODULE_DIR%\deps.packman.xml" if %errorlevel% neq 0 ( echo !!! Error fetching packman dependencies !!! goto ERROR ) goto END :ERROR_MKDIR_PACKAGES_ROOT echo Failed to automatically create packman packages repo at %PM_PACKAGES_ROOT%. echo Please set a location explicitly that packman has permission to write to, by issuing: echo. echo setx PM_PACKAGES_ROOT {path-you-choose-for-storing-packman-packages-locally} echo. echo Then launch a new command console for the changes to take effect and run packman command again. exit /B %errorlevel% :ERROR echo !!! Failure while configuring local machine :( !!! exit /B %errorlevel% :CLEAN_UP_TEMP_FOLDER rd /S /Q "%TEMP_FOLDER_NAME%" exit /B :CREATE_PYTHON_BASE_DIR :: We ignore errors and clean error state - if two processes create the directory one will fail which is fine md "%PM_PYTHON_BASE_DIR%" > nul 2>&1 exit /B 0 :END
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/tools/packman/bootstrap/fetch_file_from_packman_bootstrap.cmd
:: Copyright 2019 NVIDIA CORPORATION :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. :: You may obtain a copy of the License at :: :: http://www.apache.org/licenses/LICENSE-2.0 :: :: Unless required by applicable law or agreed to in writing, software :: distributed under the License is distributed on an "AS IS" BASIS, :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. :: See the License for the specific language governing permissions and :: limitations under the License. :: You need to specify <package-name> <target-path> as input to this command @setlocal @set PACKAGE_NAME=%1 @set TARGET_PATH=%2 @echo Fetching %PACKAGE_NAME% ... @powershell -ExecutionPolicy ByPass -NoLogo -NoProfile -File "%~dp0download_file_from_url.ps1" ^ -source "http://bootstrap.packman.nvidia.com/%PACKAGE_NAME%" -output %TARGET_PATH% :: A bug in powershell prevents the errorlevel code from being set when using the -File execution option :: We must therefore do our own failure analysis, basically make sure the file exists and is larger than 0 bytes: @if not exist %TARGET_PATH% goto ERROR_DOWNLOAD_FAILED @if %~z2==0 goto ERROR_DOWNLOAD_FAILED @endlocal @exit /b 0 :ERROR_DOWNLOAD_FAILED @echo Failed to download file from S3 @echo Most likely because endpoint cannot be reached or file %PACKAGE_NAME% doesn't exist @endlocal @exit /b 1
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/tools/packman/bootstrap/download_file_from_url.ps1
<# Copyright 2019 NVIDIA CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. #> param( [Parameter(Mandatory=$true)][string]$source=$null, [string]$output="out.exe" ) $filename = $output $triesLeft = 3 do { $triesLeft -= 1 try { Write-Host "Downloading from bootstrap.packman.nvidia.com ..." $wc = New-Object net.webclient $wc.Downloadfile($source, $fileName) $triesLeft = 0 } catch { Write-Host "Error downloading $source!" Write-Host $_.Exception|format-list -force } } while ($triesLeft -gt 0)
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/tools/packman/bootstrap/generate_temp_folder.ps1
<# Copyright 2019 NVIDIA CORPORATION Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. #> param( [Parameter(Mandatory=$true)][string]$parentPath=$null ) [string] $name = [System.Guid]::NewGuid() $out = Join-Path $parentPath $name New-Item -ItemType Directory -Path ($out) | Out-Null Write-Host $out # SIG # Begin signature block # MIIaVwYJKoZIhvcNAQcCoIIaSDCCGkQCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB29nsqMEu+VmSF # 7ckeVTPrEZ6hsXjOgPFlJm9ilgHUB6CCCiIwggTTMIIDu6ADAgECAhBi50XpIWUh # PJcfXEkK6hKlMA0GCSqGSIb3DQEBCwUAMIGEMQswCQYDVQQGEwJVUzEdMBsGA1UE # ChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNVBAsTFlN5bWFudGVjIFRydXN0 # IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENsYXNzIDMgU0hBMjU2IENvZGUg # U2lnbmluZyBDQSAtIEcyMB4XDTE4MDcwOTAwMDAwMFoXDTIxMDcwOTIzNTk1OVow # gYMxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRQwEgYDVQQHDAtT # YW50YSBDbGFyYTEbMBkGA1UECgwSTlZJRElBIENvcnBvcmF0aW9uMQ8wDQYDVQQL # DAZJVC1NSVMxGzAZBgNVBAMMEk5WSURJQSBDb3Jwb3JhdGlvbjCCASIwDQYJKoZI # hvcNAQEBBQADggEPADCCAQoCggEBALEZN63dA47T4i90jZ84CJ/aWUwVtLff8AyP # YspFfIZGdZYiMgdb8A5tBh7653y0G/LZL6CVUkgejcpvBU/Dl/52a+gSWy2qJ2bH # jMFMKCyQDhdpCAKMOUKSC9rfzm4cFeA9ct91LQCAait4LhLlZt/HF7aG+r0FgCZa # HJjJvE7KNY9G4AZXxjSt8CXS8/8NQMANqjLX1r+F+Hl8PzQ1fVx0mMsbdtaIV4Pj # 5flAeTUnz6+dCTx3vTUo8MYtkS2UBaQv7t7H2B7iwJDakEQKk1XHswJdeqG0osDU # z6+NVks7uWE1N8UIhvzbw0FEX/U2kpfyWaB/J3gMl8rVR8idPj8CAwEAAaOCAT4w # ggE6MAkGA1UdEwQCMAAwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUF # BwMDMGEGA1UdIARaMFgwVgYGZ4EMAQQBMEwwIwYIKwYBBQUHAgEWF2h0dHBzOi8v # ZC5zeW1jYi5jb20vY3BzMCUGCCsGAQUFBwICMBkMF2h0dHBzOi8vZC5zeW1jYi5j # b20vcnBhMB8GA1UdIwQYMBaAFNTABiJJ6zlL3ZPiXKG4R3YJcgNYMCsGA1UdHwQk # MCIwIKAeoByGGmh0dHA6Ly9yYi5zeW1jYi5jb20vcmIuY3JsMFcGCCsGAQUFBwEB # BEswSTAfBggrBgEFBQcwAYYTaHR0cDovL3JiLnN5bWNkLmNvbTAmBggrBgEFBQcw # AoYaaHR0cDovL3JiLnN5bWNiLmNvbS9yYi5jcnQwDQYJKoZIhvcNAQELBQADggEB # AIJKh5vKJdhHJtMzATmc1BmXIQ3RaJONOZ5jMHn7HOkYU1JP0OIzb4pXXkH8Xwfr # K6bnd72IhcteyksvKsGpSvK0PBBwzodERTAu1Os2N+EaakxQwV/xtqDm1E3IhjHk # fRshyKKzmFk2Ci323J4lHtpWUj5Hz61b8gd72jH7xnihGi+LORJ2uRNZ3YuqMNC3 # SBC8tAyoJqEoTJirULUCXW6wX4XUm5P2sx+htPw7szGblVKbQ+PFinNGnsSEZeKz # D8jUb++1cvgTKH59Y6lm43nsJjkZU77tNqyq4ABwgQRk6lt8cS2PPwjZvTmvdnla # ZhR0K4of+pQaUQHXVIBdji8wggVHMIIEL6ADAgECAhB8GzU1SufbdOdBXxFpymuo # MA0GCSqGSIb3DQEBCwUAMIG9MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNp # Z24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNV # BAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl # IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmlj # YXRpb24gQXV0aG9yaXR5MB4XDTE0MDcyMjAwMDAwMFoXDTI0MDcyMTIzNTk1OVow # gYQxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRTeW1hbnRlYyBDb3Jwb3JhdGlvbjEf # MB0GA1UECxMWU3ltYW50ZWMgVHJ1c3QgTmV0d29yazE1MDMGA1UEAxMsU3ltYW50 # ZWMgQ2xhc3MgMyBTSEEyNTYgQ29kZSBTaWduaW5nIENBIC0gRzIwggEiMA0GCSqG # SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDXlUPU3N9nrjn7UqS2JjEEcOm3jlsqujdp # NZWPu8Aw54bYc7vf69F2P4pWjustS/BXGE6xjaUz0wt1I9VqeSfdo9P3Dodltd6t # HPH1NbQiUa8iocFdS5B/wFlOq515qQLXHkmxO02H/sJ4q7/vUq6crwjZOeWaUT5p # XzAQTnFjbFjh8CAzGw90vlvLEuHbjMSAlHK79kWansElC/ujHJ7YpglwcezAR0yP # fcPeGc4+7gRyjhfT//CyBTIZTNOwHJ/+pXggQnBBsCaMbwDIOgARQXpBsKeKkQSg # mXj0d7TzYCrmbFAEtxRg/w1R9KiLhP4h2lxeffUpeU+wRHRvbXL/AgMBAAGjggF4 # MIIBdDAuBggrBgEFBQcBAQQiMCAwHgYIKwYBBQUHMAGGEmh0dHA6Ly9zLnN5bWNk # LmNvbTASBgNVHRMBAf8ECDAGAQH/AgEAMGYGA1UdIARfMF0wWwYLYIZIAYb4RQEH # FwMwTDAjBggrBgEFBQcCARYXaHR0cHM6Ly9kLnN5bWNiLmNvbS9jcHMwJQYIKwYB # BQUHAgIwGRoXaHR0cHM6Ly9kLnN5bWNiLmNvbS9ycGEwNgYDVR0fBC8wLTAroCmg # J4YlaHR0cDovL3Muc3ltY2IuY29tL3VuaXZlcnNhbC1yb290LmNybDATBgNVHSUE # DDAKBggrBgEFBQcDAzAOBgNVHQ8BAf8EBAMCAQYwKQYDVR0RBCIwIKQeMBwxGjAY # BgNVBAMTEVN5bWFudGVjUEtJLTEtNzI0MB0GA1UdDgQWBBTUwAYiSes5S92T4lyh # uEd2CXIDWDAfBgNVHSMEGDAWgBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG # 9w0BAQsFAAOCAQEAf+vKp+qLdkLrPo4gVDDjt7nc+kg+FscPRZUQzSeGo2bzAu1x # +KrCVZeRcIP5Un5SaTzJ8eCURoAYu6HUpFam8x0AkdWG80iH4MvENGggXrTL+QXt # nK9wUye56D5+UaBpcYvcUe2AOiUyn0SvbkMo0yF1u5fYi4uM/qkERgSF9xWcSxGN # xCwX/tVuf5riVpLxlrOtLfn039qJmc6yOETA90d7yiW5+ipoM5tQct6on9TNLAs0 # vYsweEDgjY4nG5BvGr4IFYFd6y/iUedRHsl4KeceZb847wFKAQkkDhbEFHnBQTc0 # 0D2RUpSd4WjvCPDiaZxnbpALGpNx1CYCw8BaIzGCD4swgg+HAgEBMIGZMIGEMQsw # CQYDVQQGEwJVUzEdMBsGA1UEChMUU3ltYW50ZWMgQ29ycG9yYXRpb24xHzAdBgNV # BAsTFlN5bWFudGVjIFRydXN0IE5ldHdvcmsxNTAzBgNVBAMTLFN5bWFudGVjIENs # YXNzIDMgU0hBMjU2IENvZGUgU2lnbmluZyBDQSAtIEcyAhBi50XpIWUhPJcfXEkK # 6hKlMA0GCWCGSAFlAwQCAQUAoHwwEAYKKwYBBAGCNwIBDDECMAAwGQYJKoZIhvcN # AQkDMQwGCisGAQQBgjcCAQQwHAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcCARUw # LwYJKoZIhvcNAQkEMSIEIG5YDmcpqLxn4SB0H6OnuVkZRPh6OJ77eGW/6Su/uuJg # MA0GCSqGSIb3DQEBAQUABIIBAA3N2vqfA6WDgqz/7EoAKVIE5Hn7xpYDGhPvFAMV # BslVpeqE3apTcYFCEcwLtzIEc/zmpULxsX8B0SUT2VXbJN3zzQ80b+gbgpq62Zk+ # dQLOtLSiPhGW7MXLahgES6Oc2dUFaQ+wDfcelkrQaOVZkM4wwAzSapxuf/13oSIk # ZX2ewQEwTZrVYXELO02KQIKUR30s/oslGVg77ALnfK9qSS96Iwjd4MyT7PzCkHUi # ilwyGJi5a4ofiULiPSwUQNynSBqxa+JQALkHP682b5xhjoDfyG8laR234FTPtYgs # P/FaeviwENU5Pl+812NbbtRD+gKlWBZz+7FKykOT/CG8sZahgg1EMIINQAYKKwYB # BAGCNwMDATGCDTAwgg0sBgkqhkiG9w0BBwKggg0dMIINGQIBAzEPMA0GCWCGSAFl # AwQCAQUAMHcGCyqGSIb3DQEJEAEEoGgEZjBkAgEBBglghkgBhv1sBwEwMTANBglg # hkgBZQMEAgEFAAQgJhABfkDIPbI+nWYnA30FLTyaPK+W3QieT21B/vK+CMICEDF0 # worcGsdd7OxpXLP60xgYDzIwMjEwNDA4MDkxMTA5WqCCCjcwggT+MIID5qADAgEC # AhANQkrgvjqI/2BAIc4UAPDdMA0GCSqGSIb3DQEBCwUAMHIxCzAJBgNVBAYTAlVT # MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j # b20xMTAvBgNVBAMTKERpZ2lDZXJ0IFNIQTIgQXNzdXJlZCBJRCBUaW1lc3RhbXBp # bmcgQ0EwHhcNMjEwMTAxMDAwMDAwWhcNMzEwMTA2MDAwMDAwWjBIMQswCQYDVQQG # EwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xIDAeBgNVBAMTF0RpZ2lDZXJ0 # IFRpbWVzdGFtcCAyMDIxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA # wuZhhGfFivUNCKRFymNrUdc6EUK9CnV1TZS0DFC1JhD+HchvkWsMlucaXEjvROW/ # m2HNFZFiWrj/ZwucY/02aoH6KfjdK3CF3gIY83htvH35x20JPb5qdofpir34hF0e # dsnkxnZ2OlPR0dNaNo/Go+EvGzq3YdZz7E5tM4p8XUUtS7FQ5kE6N1aG3JMjjfdQ # Jehk5t3Tjy9XtYcg6w6OLNUj2vRNeEbjA4MxKUpcDDGKSoyIxfcwWvkUrxVfbENJ # Cf0mI1P2jWPoGqtbsR0wwptpgrTb/FZUvB+hh6u+elsKIC9LCcmVp42y+tZji06l # chzun3oBc/gZ1v4NSYS9AQIDAQABo4IBuDCCAbQwDgYDVR0PAQH/BAQDAgeAMAwG # A1UdEwEB/wQCMAAwFgYDVR0lAQH/BAwwCgYIKwYBBQUHAwgwQQYDVR0gBDowODA2 # BglghkgBhv1sBwEwKTAnBggrBgEFBQcCARYbaHR0cDovL3d3dy5kaWdpY2VydC5j # b20vQ1BTMB8GA1UdIwQYMBaAFPS24SAd/imu0uRhpbKiJbLIFzVuMB0GA1UdDgQW # BBQ2RIaOpLqwZr68KC0dRDbd42p6vDBxBgNVHR8EajBoMDKgMKAuhixodHRwOi8v # Y3JsMy5kaWdpY2VydC5jb20vc2hhMi1hc3N1cmVkLXRzLmNybDAyoDCgLoYsaHR0 # cDovL2NybDQuZGlnaWNlcnQuY29tL3NoYTItYXNzdXJlZC10cy5jcmwwgYUGCCsG # AQUFBwEBBHkwdzAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29t # ME8GCCsGAQUFBzAChkNodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNl # cnRTSEEyQXNzdXJlZElEVGltZXN0YW1waW5nQ0EuY3J0MA0GCSqGSIb3DQEBCwUA # A4IBAQBIHNy16ZojvOca5yAOjmdG/UJyUXQKI0ejq5LSJcRwWb4UoOUngaVNFBUZ # B3nw0QTDhtk7vf5EAmZN7WmkD/a4cM9i6PVRSnh5Nnont/PnUp+Tp+1DnnvntN1B # Ion7h6JGA0789P63ZHdjXyNSaYOC+hpT7ZDMjaEXcw3082U5cEvznNZ6e9oMvD0y # 0BvL9WH8dQgAdryBDvjA4VzPxBFy5xtkSdgimnUVQvUtMjiB2vRgorq0Uvtc4GEk # JU+y38kpqHNDUdq9Y9YfW5v3LhtPEx33Sg1xfpe39D+E68Hjo0mh+s6nv1bPull2 # YYlffqe0jmd4+TaY4cso2luHpoovMIIFMTCCBBmgAwIBAgIQCqEl1tYyG35B5AXa # NpfCFTANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGln # aUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtE # aWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMTYwMTA3MTIwMDAwWhcNMzEw # MTA3MTIwMDAwWjByMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5j # MRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMTEwLwYDVQQDEyhEaWdpQ2VydCBT # SEEyIEFzc3VyZWQgSUQgVGltZXN0YW1waW5nIENBMIIBIjANBgkqhkiG9w0BAQEF # AAOCAQ8AMIIBCgKCAQEAvdAy7kvNj3/dqbqCmcU5VChXtiNKxA4HRTNREH3Q+X1N # aH7ntqD0jbOI5Je/YyGQmL8TvFfTw+F+CNZqFAA49y4eO+7MpvYyWf5fZT/gm+vj # RkcGGlV+Cyd+wKL1oODeIj8O/36V+/OjuiI+GKwR5PCZA207hXwJ0+5dyJoLVOOo # CXFr4M8iEA91z3FyTgqt30A6XLdR4aF5FMZNJCMwXbzsPGBqrC8HzP3w6kfZiFBe # /WZuVmEnKYmEUeaC50ZQ/ZQqLKfkdT66mA+Ef58xFNat1fJky3seBdCEGXIX8RcG # 7z3N1k3vBkL9olMqT4UdxB08r8/arBD13ays6Vb/kwIDAQABo4IBzjCCAcowHQYD # VR0OBBYEFPS24SAd/imu0uRhpbKiJbLIFzVuMB8GA1UdIwQYMBaAFEXroq/0ksuC # MS1Ri6enIZ3zbcgPMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgGG # MBMGA1UdJQQMMAoGCCsGAQUFBwMIMHkGCCsGAQUFBwEBBG0wazAkBggrBgEFBQcw # AYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tMEMGCCsGAQUFBzAChjdodHRwOi8v # Y2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNlcnRBc3N1cmVkSURSb290Q0EuY3J0 # MIGBBgNVHR8EejB4MDqgOKA2hjRodHRwOi8vY3JsNC5kaWdpY2VydC5jb20vRGln # aUNlcnRBc3N1cmVkSURSb290Q0EuY3JsMDqgOKA2hjRodHRwOi8vY3JsMy5kaWdp # Y2VydC5jb20vRGlnaUNlcnRBc3N1cmVkSURSb290Q0EuY3JsMFAGA1UdIARJMEcw # OAYKYIZIAYb9bAACBDAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2Vy # dC5jb20vQ1BTMAsGCWCGSAGG/WwHATANBgkqhkiG9w0BAQsFAAOCAQEAcZUS6VGH # VmnN793afKpjerN4zwY3QITvS4S/ys8DAv3Fp8MOIEIsr3fzKx8MIVoqtwU0HWqu # mfgnoma/Capg33akOpMP+LLR2HwZYuhegiUexLoceywh4tZbLBQ1QwRostt1AuBy # x5jWPGTlH0gQGF+JOGFNYkYkh2OMkVIsrymJ5Xgf1gsUpYDXEkdws3XVk4WTfraS # Z/tTYYmo9WuWwPRYaQ18yAGxuSh1t5ljhSKMYcp5lH5Z/IwP42+1ASa2bKXuh1Eh # 5Fhgm7oMLSttosR+u8QlK0cCCHxJrhO24XxCQijGGFbPQTS2Zl22dHv1VjMiLyI2 # skuiSpXY9aaOUjGCAk0wggJJAgEBMIGGMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK # EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNV # BAMTKERpZ2lDZXJ0IFNIQTIgQXNzdXJlZCBJRCBUaW1lc3RhbXBpbmcgQ0ECEA1C # SuC+Ooj/YEAhzhQA8N0wDQYJYIZIAWUDBAIBBQCggZgwGgYJKoZIhvcNAQkDMQ0G # CyqGSIb3DQEJEAEEMBwGCSqGSIb3DQEJBTEPFw0yMTA0MDgwOTExMDlaMCsGCyqG # SIb3DQEJEAIMMRwwGjAYMBYEFOHXgqjhkb7va8oWkbWqtJSmJJvzMC8GCSqGSIb3 # DQEJBDEiBCDvFxQ6lYLr8vB+9czUl19rjCw1pWhhUXw/SqOmvIa/VDANBgkqhkiG # 9w0BAQEFAASCAQB9ox2UrcUXQsBI4Uycnhl4AMpvhVXJME62tygFMppW1l7QftDy # LvfPKRYm2YUioak/APxAS6geRKpeMkLvXuQS/Jlv0kY3BjxkeG0eVjvyjF4SvXbZ # 3JCk9m7wLNE+xqOo0ICjYlIJJgRLudjWkC5Skpb1NpPS8DOaIYwRV+AWaSOUPd9P # O5yVcnbl7OpK3EAEtwDrybCVBMPn2MGhAXybIHnth3+MFp1b6Blhz3WlReQyarjq # 1f+zaFB79rg6JswXoOTJhwICBP3hO2Ua3dMAswbfl+QNXF+igKLJPYnaeSVhBbm6 # VCu2io27t4ixqvoD0RuPObNX/P3oVA38afiM # SIG # End signature block
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/tools/packman/bootstrap/install_package.py
# Copyright 2019 NVIDIA CORPORATION # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import logging import zipfile import tempfile import sys import shutil __author__ = "hfannar" logging.basicConfig(level=logging.WARNING, format="%(message)s") logger = logging.getLogger("install_package") class TemporaryDirectory: def __init__(self): self.path = None def __enter__(self): self.path = tempfile.mkdtemp() return self.path def __exit__(self, type, value, traceback): # Remove temporary data created shutil.rmtree(self.path) def install_package(package_src_path, package_dst_path): with zipfile.ZipFile( package_src_path, allowZip64=True ) as zip_file, TemporaryDirectory() as temp_dir: zip_file.extractall(temp_dir) # Recursively copy (temp_dir will be automatically cleaned up on exit) try: # Recursive copy is needed because both package name and version folder could be missing in # target directory: shutil.copytree(temp_dir, package_dst_path) except OSError as exc: logger.warning( "Directory %s already present, packaged installation aborted" % package_dst_path ) else: logger.info("Package successfully installed to %s" % package_dst_path) install_package(sys.argv[1], sys.argv[2])
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.sample.deepsearchpicker/config/extension.toml
[package] # Semantic Versioning is used: https://semver.org/ version = "1.0.0" # The title and description fields are primarily for displaying extension info in UI title = "DeepSearch Swap" description="The simplest python extension example. Use it as a starting point for your extensions." # Path (relative to the root) or content of readme markdown file for UI. readme = "docs/README.md" # URL of the extension source repository. repository = "" # One of categories for UI. category = "Example" # Keywords for the extension keywords = ["kit", "example"] # Icon to show in the extension manager icon = "data/icon.png" # Preview to show in the extension manager preview_image = "data/preview.png" # Use omni.ui to build simple UI [dependencies] "omni.kit.uiapp" = {} "omni.kit.ngsearch" = {} # Main python module this extension provides, it will be publicly available as "import company.hello.world". [[python.module]] name = "omni.sample.deepsearchpicker" [[test]] # Extra dependencies only to be used during test run dependencies = [ "omni.kit.ui_test" # UI testing extension ]
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.sample.deepsearchpicker/omni/sample/deepsearchpicker/style.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import omni.ui as ui from pathlib import Path icons_path = Path(__file__).parent.parent.parent.parent / "icons" gen_ai_style = { "HStack": { "margin": 3 }, "Button.Image::create": {"image_url": f"{icons_path}/plus.svg", "color": 0xFF00B976} }
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.sample.deepsearchpicker/omni/sample/deepsearchpicker/extension.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import omni.ext from .window import DeepSearchPickerWindow # Any class derived from `omni.ext.IExt` in top level module (defined in `python.modules` of `extension.toml`) will be # instantiated when extension gets enabled and `on_startup(ext_id)` will be called. Later when extension gets disabled # on_shutdown() is called. class MyExtension(omni.ext.IExt): # ext_id is current extension id. It can be used with extension manager to query additional information, like where # this extension is located on filesystem. def on_startup(self, ext_id): self._window = DeepSearchPickerWindow("DeepSearch Swap", width=300, height=300) def on_shutdown(self): self._window.destroy() self._window = None
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.sample.deepsearchpicker/omni/sample/deepsearchpicker/__init__.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from .extension import *
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.sample.deepsearchpicker/omni/sample/deepsearchpicker/deep_search.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from omni.kit.ngsearch.client import NGSearchClient import carb import asyncio class deep_search(): async def query_items(queries, url: str, paths): result = list(tuple()) for query in queries: query_result = await deep_search._query_first(query, url, paths) if query_result is not None: result.append(query_result) return result async def _query_first(query: str, url: str, paths): filtered_query = "ext:usd,usdz,usda path:" for path in paths: filtered_query = filtered_query + "\"" + str(path) + "\"," filtered_query = filtered_query[:-1] filtered_query = filtered_query + " " filtered_query = filtered_query + query SearchResult = await NGSearchClient.get_instance().find2( query=filtered_query, url=url) if len(SearchResult.paths) > 0: return (query, SearchResult.paths[0].uri) else: return None async def query_all(query: str, url: str, paths): filtered_query = "ext:usd,usdz,usda path:" for path in paths: filtered_query = filtered_query + "\"" + str(path) + "\"," filtered_query = filtered_query[:-1] filtered_query = filtered_query + " " filtered_query = filtered_query + query return await NGSearchClient.get_instance().find2(query=filtered_query, url=url)
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.sample.deepsearchpicker/omni/sample/deepsearchpicker/window.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import omni.ui as ui import omni.usd import carb from .style import gen_ai_style from .deep_search import deep_search import asyncio from pxr import UsdGeom, Usd, Sdf, Gf class DeepSearchPickerWindow(ui.Window): def __init__(self, title: str, **kwargs) -> None: super().__init__(title, **kwargs) # Models self.frame.set_build_fn(self._build_fn) self._index = 0 self._query_results = None self._selected_prim = None self._prim_path_model = ui.SimpleStringModel() def _build_fn(self): async def replace_prim(): self._index = 0 ctx = omni.usd.get_context() prim_paths = ctx.get_selection().get_selected_prim_paths() if len(prim_paths) != 1: carb.log_warn("You must select one and only one prim") return prim_path = prim_paths[0] stage = ctx.get_stage() self._selected_prim = stage.GetPrimAtPath(prim_path) query = self._selected_prim.GetAttribute("DeepSearch:Query").Get() prop_paths = ["/Projects/simready_content/common_assets/props/", "/NVIDIA/Assets/Isaac/2022.2.1/Isaac/Robots/", "/NVIDIA/Assets/Isaac/2022.1/NVIDIA/Assets/ArchVis/Residential/Furniture/"] self._query_results = await deep_search.query_all(query, "omniverse://ov-simready/", paths=prop_paths) self._prim_path_model.set_value(prim_path) def increment_prim_index(): if self._query_results is None: return self._index = self._index + 1 if self._index >= len(self._query_results.paths): self._index = 0 self.replace_reference() def decrement_prim_index(): if self._query_results is None: return self._index = self._index - 1 if self._index <= 0: self._index = len(self._query_results.paths) - 1 self.replace_reference() with self.frame: with ui.VStack(style=gen_ai_style): with ui.HStack(height=0): ui.Spacer() ui.StringField(model=self._prim_path_model, width=365, height=30) ui.Button(name="create", width=30, height=30, clicked_fn=lambda: asyncio.ensure_future(replace_prim())) ui.Spacer() with ui.HStack(height=0): ui.Spacer() ui.Button("<", width=200, clicked_fn=lambda: decrement_prim_index()) ui.Button(">", width=200, clicked_fn=lambda: increment_prim_index()) ui.Spacer() def replace_reference(self): references: Usd.references = self._selected_prim.GetReferences() references.ClearReferences() references.AddReference( assetPath="omniverse://ov-simready" + self._query_results.paths[self._index].uri) carb.log_info("Got it?") def destroy(self): super().destroy()
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.sample.deepsearchpicker/omni/sample/deepsearchpicker/tests/__init__.py
from .test_hello_world import *
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.sample.deepsearchpicker/omni/sample/deepsearchpicker/tests/test_hello_world.py
# NOTE: # omni.kit.test - std python's unittest module with additional wrapping to add suport for async/await tests # For most things refer to unittest docs: https://docs.python.org/3/library/unittest.html import omni.kit.test # Extnsion for writing UI tests (simulate UI interaction) import omni.kit.ui_test as ui_test # Import extension python module we are testing with absolute import path, as if we are external user (other extension) import company.hello.world # Having a test class dervived from omni.kit.test.AsyncTestCase declared on the root of module will make it auto-discoverable by omni.kit.test class Test(omni.kit.test.AsyncTestCase): # Before running each test async def setUp(self): pass # After running each test async def tearDown(self): pass # Actual test, notice it is "async" function, so "await" can be used if needed async def test_hello_public_function(self): result = company.hello.world.some_public_function(4) self.assertEqual(result, 256) async def test_window_button(self): # Find a label in our window label = ui_test.find("My Window//Frame/**/Label[*]") # Find buttons in our window add_button = ui_test.find("My Window//Frame/**/Button[*].text=='Add'") reset_button = ui_test.find("My Window//Frame/**/Button[*].text=='Reset'") # Click reset button await reset_button.click() self.assertEqual(label.widget.text, "empty") await add_button.click() self.assertEqual(label.widget.text, "count: 1") await add_button.click() self.assertEqual(label.widget.text, "count: 2")
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.sample.deepsearchpicker/docs/CHANGELOG.md
# Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [1.0.0] - 2021-04-26 - Initial version of extension UI template with a window
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.sample.deepsearchpicker/docs/README.md
# Simple UI Extension Template The simplest python extension example. Use it as a starting point for your extensions.
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/config/extension.toml
[package] # Semantic Versioning is used: https://semver.org/ version = "1.0.0" # The title and description fields are primarily for displaying extension info in UI title = "AI Room Generator Sample" description="Generates Rooms using ChatGPT" # Path (relative to the root) or content of readme markdown file for UI. readme = "docs/README.md" # URL of the extension source repository. repository = "" # One of categories for UI. category = "Example" # Keywords for the extension keywords = ["kit", "example"] # Icon to show in the extension manager icon = "data/preview_icon.png" # Preview to show in the extension manager preview_image = "data/preview.png" # Use omni.ui to build simple UI [dependencies] "omni.kit.uiapp" = {} "omni.kit.ngsearch" = {} "omni.kit.window.popup_dialog" = {} # Main python module this extension provides, it will be publicly available as "import company.hello.world". [[python.module]] name = "omni.example.airoomgenerator" [[test]] # Extra dependencies only to be used during test run dependencies = [ "omni.kit.ui_test" # UI testing extension ]
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/priminfo.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from pxr import Usd, Gf class PrimInfo: # Class that stores the prim info def __init__(self, prim: Usd.Prim, name: str = "") -> None: self.prim = prim self.child = prim.GetAllChildren()[0] self.length = self.GetLengthOfPrim() self.width = self.GetWidthOfPrim() self.origin = self.GetPrimOrigin() self.area_name = name def GetLengthOfPrim(self) -> str: # Returns the X value attr = self.child.GetAttribute('xformOp:scale') x_scale = attr.Get()[0] return str(x_scale) def GetWidthOfPrim(self) -> str: # Returns the Z value attr = self.child.GetAttribute('xformOp:scale') z_scale = attr.Get()[2] return str(z_scale) def GetPrimOrigin(self) -> str: attr = self.prim.GetAttribute('xformOp:translate') origin = Gf.Vec3d(0,0,0) if attr: origin = attr.Get() phrase = str(origin[0]) + ", " + str(origin[1]) + ", " + str(origin[2]) return phrase
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/widgets.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import omni.ui as ui from omni.ui import color as cl import asyncio import omni import carb class ProgressBar: def __init__(self): self.progress_bar_window = None self.left = None self.right = None self._build_fn() async def play_anim_forever(self): fraction = 0.0 while True: fraction = (fraction + 0.01) % 1.0 self.left.width = ui.Fraction(fraction) self.right.width = ui.Fraction(1.0-fraction) await omni.kit.app.get_app().next_update_async() def _build_fn(self): with ui.VStack(): self.progress_bar_window = ui.HStack(height=0, visible=False) with self.progress_bar_window: ui.Label("Processing", width=0, style={"margin_width": 3}) self.left = ui.Spacer(width=ui.Fraction(0.0)) ui.Rectangle(width=50, style={"background_color": cl("#76b900")}) self.right = ui.Spacer(width=ui.Fraction(1.0)) def show_bar(self, to_show): self.progress_bar_window.visible = to_show
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/chatgpt_apiconnect.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import json import carb import aiohttp import asyncio from .prompts import system_input, user_input, assistant_input from .deep_search import query_items from .item_generator import place_greyboxes, place_deepsearch_results async def chatGPT_call(prompt: str): # Load your API key from an environment variable or secret management service settings = carb.settings.get_settings() apikey = settings.get_as_string("/persistent/exts/omni.example.airoomgenerator/APIKey") my_prompt = prompt.replace("\n", " ") # Send a request API try: parameters = { "model": "gpt-3.5-turbo", "messages": [ {"role": "system", "content": system_input}, {"role": "user", "content": user_input}, {"role": "assistant", "content": assistant_input}, {"role": "user", "content": my_prompt} ] } chatgpt_url = "https://api.openai.com/v1/chat/completions" headers = {"Authorization": "Bearer %s" % apikey} # Create a completion using the chatGPT model async with aiohttp.ClientSession() as session: async with session.post(chatgpt_url, headers=headers, json=parameters) as r: response = await r.json() text = response["choices"][0]["message"]['content'] except Exception as e: carb.log_error("An error as occurred") return None, str(e) # Parse data that was given from API try: #convert string to object data = json.loads(text) except ValueError as e: carb.log_error(f"Exception occurred: {e}") return None, text else: # Get area_objects_list object_list = data['area_objects_list'] return object_list, text async def call_Generate(prim_info, prompt, use_chatgpt, use_deepsearch, response_label, progress_widget): run_loop = asyncio.get_event_loop() progress_widget.show_bar(True) task = run_loop.create_task(progress_widget.play_anim_forever()) response = "" #chain the prompt area_name = prim_info.area_name.split("/World/Layout/") concat_prompt = area_name[-1].replace("_", " ") + ", " + prim_info.length + "x" + prim_info.width + ", origin at (0.0, 0.0, 0.0), generate a list of appropriate items in the correct places. " + prompt root_prim_path = "/World/Layout/GPT/" if prim_info.area_name != "": root_prim_path= prim_info.area_name + "/items/" if use_chatgpt: #when calling the API objects, response = await chatGPT_call(concat_prompt) else: #when testing and you want to skip the API call data = json.loads(assistant_input) objects = data['area_objects_list'] if objects is None: response_label.text = response return if use_deepsearch: settings = carb.settings.get_settings() nucleus_path = settings.get_as_string("/persistent/exts/omni.example.airoomgenerator/deepsearch_nucleus_path") filter_path = settings.get_as_string("/persistent/exts/omni.example.airoomgenerator/filter_path") filter_paths = filter_path.split(',') queries = list() for item in objects: queries.append(item['object_name']) query_result = await query_items(queries=queries, url=nucleus_path, paths=filter_paths) if query_result is not None: place_deepsearch_results( gpt_results=objects, query_result=query_result, root_prim_path=root_prim_path) else: place_greyboxes( gpt_results=objects, root_prim_path=root_prim_path) else: place_greyboxes( gpt_results=objects, root_prim_path=root_prim_path) task.cancel() await asyncio.sleep(1) response_label.text = response progress_widget.show_bar(False)
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/style.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import omni.ui as ui from pathlib import Path icons_path = Path(__file__).parent.parent.parent.parent / "icons" gen_ai_style = { "HStack": { "margin": 3 }, "Button.Image::create": {"image_url": f"{icons_path}/plus.svg", "color": 0xFF00B976}, "Button.Image::properties": {"image_url": f"{icons_path}/cog.svg", "color": 0xFF989898}, "Line": { "margin": 3 }, "Label": { "margin_width": 5 } } guide = """ Step 1: Create a Floor - You can draw a floor outline using the pencil tool. Right click in the viewport then `Create>BasicCurves>From Pencil` - OR Create a prim and scale it to the size you want. i.e. Right click in the viewport then `Create>Mesh>Cube`. - Next, with the floor selected type in a name into "Area Name". Make sure the area name is relative to the room you want to generate. For example, if you inputted the name as "bedroom" ChatGPT will be prompted that the room is a bedroom. - Then click the '+' button. This will generate the floor and add the option to our combo box. Step 2: Prompt - Type in a prompt that you want to send along to ChatGPT. This can be information about what is inside of the room. For example, "generate a comfortable reception area that contains a front desk and an area for guest to sit down". Step 3: Generate - Select 'use ChatGPT' if you want to recieve a response from ChatGPT otherwise it will use a premade response. - Select 'use Deepsearch' if you want to use the deepsearch functionality. (ENTERPRISE USERS ONLY) When deepsearch is false it will spawn in cubes that greybox the scene. - Hit Generate, after hitting generate it will start making the appropriate calls. Loading bar will be shown as api-calls are being made. Step 4: More Rooms - To add another room you can repeat Steps 1-3. To regenerate a previous room just select it from the 'Current Room' in the dropdown menu. - The dropdown menu will remember the last prompt you used to generate the items. - If you do not like the items it generated, you can hit the generate button until you are satisfied with the items. """
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/prompts.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. system_input='''You are an area generator expert. Given an area of a certain size, you can generate a list of items that are appropriate to that area, in the right place, and with a representative material. You operate in a 3D Space. You work in a X,Y,Z coordinate system. X denotes width, Y denotes height, Z denotes depth. 0.0,0.0,0.0 is the default space origin. You receive from the user the name of the area, the size of the area on X and Z axis in centimetres, the origin point of the area (which is at the center of the area). You answer by only generating JSON files that contain the following information: - area_name: name of the area - X: coordinate of the area on X axis - Y: coordinate of the area on Y axis - Z: coordinate of the area on Z axis - area_size_X: dimension in cm of the area on X axis - area_size_Z: dimension in cm of the area on Z axis - area_objects_list: list of all the objects in the area For each object you need to store: - object_name: name of the object - X: coordinate of the object on X axis - Y: coordinate of the object on Y axis - Z: coordinate of the object on Z axis - Length: dimension in cm of the object on X axis - Width: dimension in cm of the object on Y axis - Height: dimension in cm of the object on Z axis - Material: a reasonable material of the object using an exact name from the following list: Plywood, Leather_Brown, Leather_Pumpkin, Leather_Black, Aluminum_Cast, Birch, Beadboard, Cardboard, Cloth_Black, Cloth_Gray, Concrete_Polished, Glazed_Glass, CorrugatedMetal, Cork, Linen_Beige, Linen_Blue, Linen_White, Mahogany, MDF, Oak, Plastic_ABS, Steel_Carbon, Steel_Stainless, Veneer_OU_Walnut, Veneer_UX_Walnut_Cherry, Veneer_Z5_Maple. Each object name should include an appropriate adjective. Keep in mind, objects should be disposed in the area to create the most meaningful layout possible, and they shouldn't overlap. All objects must be within the bounds of the area size; Never place objects further than 1/2 the length or 1/2 the depth of the area from the origin. Also keep in mind that the objects should be disposed all over the area in respect to the origin point of the area, and you can use negative values as well to display items correctly, since origin of the area is always at the center of the area. Remember, you only generate JSON code, nothing else. It's very important. ''' user_input="Warehouse, 1000x1000, origin at (0.0,0.0,0.0), generate a list of appropriate items in the correct places. Generate warehouse objects" assistant_input='''{ "area_name": "Warehouse_Area", "X": 0.0, "Y": 0.0, "Z": 0.0, "area_size_X": 1000, "area_size_Z": 1000, "area_objects_list": [ { "object_name": "Parts_Pallet_1", "X": -150, "Y": 0.0, "Z": 250, "Length": 100, "Width": 100, "Height": 10, "Material": "Plywood" }, { "object_name": "Boxes_Pallet_2", "X": -150, "Y": 0.0, "Z": 150, "Length": 100, "Width": 100, "Height": 10, "Material": "Plywood" }, { "object_name": "Industrial_Storage_Rack_1", "X": -150, "Y": 0.0, "Z": 50, "Length": 200, "Width": 50, "Height": 300, "Material": "Steel_Carbon" }, { "object_name": "Empty_Pallet_3", "X": -150, "Y": 0.0, "Z": -50, "Length": 100, "Width": 100, "Height": 10, "Material": "Plywood" }, { "object_name": "Yellow_Forklift_1", "X": 50, "Y": 0.0, "Z": -50, "Length": 200, "Width": 100, "Height": 250, "Material": "Plastic_ABS" }, { "object_name": "Heavy_Duty_Forklift_2", "X": 150, "Y": 0.0, "Z": -50, "Length": 200, "Width": 100, "Height": 250, "Material": "Steel_Stainless" } ] }'''
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/extension.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import omni.ext from .window import GenAIWindow # Any class derived from `omni.ext.IExt` in top level module (defined in `python.modules` of `extension.toml`) will be # instantiated when extension gets enabled and `on_startup(ext_id)` will be called. Later when extension gets disabled # on_shutdown() is called. class MyExtension(omni.ext.IExt): # ext_id is current extension id. It can be used with extension manager to query additional information, like where # this extension is located on filesystem. def on_startup(self, ext_id): self._window = GenAIWindow("Generate Room", width=400, height=525) def on_shutdown(self): self._window.destroy() self._window = None
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/__init__.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from .extension import *
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/materials.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. MaterialPresets = { "Leather_Brown": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Textiles/Leather_Brown.mdl', "Leather_Pumpkin_01": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Textiles/Leather_Pumpkin.mdl', "Leather_Brown_02": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Textiles/Leather_Brown.mdl', "Leather_Black_01": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Textiles/Leather_Black.mdl', "Aluminum_cast": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Metals/Aluminum_Cast.mdl', "Birch": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Wood/Birch.mdl', "Beadboard": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Wood/Beadboard.mdl', "Cardboard": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Wall_Board/Cardboard.mdl', "Cloth_Black": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Textiles/Cloth_Black.mdl', "Cloth_Gray": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Textiles/Cloth_Gray.mdl', "Concrete_Polished": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Masonry/Concrete_Polished.mdl', "Glazed_Glass": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Glass/Glazed_Glass.mdl', "CorrugatedMetal": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Metals/CorrugatedMetal.mdl', "Cork": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Wood/Cork.mdl', "Linen_Beige": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Textiles/Linen_Beige.mdl', "Linen_Blue": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Textiles/Linen_Blue.mdl', "Linen_White": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Textiles/Linen_White.mdl', "Mahogany": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Wood/Mahogany.mdl', "MDF": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Wall_Board/MDF.mdl', "Oak": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Wood/Oak.mdl', "Plastic_ABS": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Plastics/Plastic_ABS.mdl', "Steel_Carbon": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Metals/Steel_Carbon.mdl', "Steel_Stainless": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Metals/Steel_Stainless.mdl', "Veneer_OU_Walnut": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Plastics/Veneer_OU_Walnut.mdl', "Veneer_UX_Walnut_Cherry": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Plastics/Veneer_UX_Walnut_Cherry.mdl', "Veneer_Z5_Maple": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Plastics/Veneer_Z5_Maple.mdl', "Plywood": 'http://omniverse-content-production.s3-us-west-2.amazonaws.com/Materials/Base/Wood/Plywood.mdl', "Concrete_Rough_Dirty": 'http://omniverse-content-production.s3.us-west-2.amazonaws.com/Materials/vMaterials_2/Concrete/Concrete_Rough.mdl' }
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/utils.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import omni.kit.commands from pxr import Gf, Sdf, UsdGeom from .materials import * import carb def CreateCubeFromCurve(curve_path: str, area_name: str = ""): ctx = omni.usd.get_context() stage = ctx.get_stage() min_coords, max_coords = get_coords_from_bbox(curve_path) x,y,z = get_bounding_box_dimensions(curve_path) xForm_scale = Gf.Vec3d(x, 1, z) cube_scale = Gf.Vec3d(0.01, 0.01, 0.01) prim = stage.GetPrimAtPath(curve_path) origin = prim.GetAttribute('xformOp:translate').Get() if prim.GetTypeName() == "BasisCurves": origin = Gf.Vec3d(min_coords[0]+x/2, 0, min_coords[2]+z/2) area_path = '/World/Layout/Area' if len(area_name) != 0: area_path = '/World/Layout/' + area_name.replace(" ", "_") new_area_path = omni.usd.get_stage_next_free_path(stage, area_path, False) new_cube_xForm_path = new_area_path + "/" + "Floor" new_cube_path = new_cube_xForm_path + "/" + "Cube" # Create xForm to hold all items item_container = create_prim(new_area_path) set_transformTRS_attrs(item_container, translate=origin) # Create Scale Xform for floor xform = create_prim(new_cube_xForm_path) set_transformTRS_attrs(xform, scale=xForm_scale) # Create Floor Cube omni.kit.commands.execute('CreateMeshPrimWithDefaultXform', prim_type='Cube', prim_path=new_cube_path, select_new_prim=True ) cube = stage.GetPrimAtPath(new_cube_path) set_transformTRS_attrs(cube, scale=cube_scale) cube.CreateAttribute("primvar:area_name", Sdf.ValueTypeNames.String, custom=True).Set(area_name) omni.kit.commands.execute('DeletePrims', paths=[curve_path], destructive=False) apply_material_to_prim('Concrete_Rough_Dirty', new_area_path) return new_area_path def apply_material_to_prim(material_name: str, prim_path: str): ctx = omni.usd.get_context() stage = ctx.get_stage() looks_path = '/World/Looks/' mat_path = looks_path + material_name mat_prim = stage.GetPrimAtPath(mat_path) if MaterialPresets.get(material_name, None) is not None: if not mat_prim.IsValid(): omni.kit.commands.execute('CreateMdlMaterialPrimCommand', mtl_url=MaterialPresets[material_name], mtl_name=material_name, mtl_path=mat_path) omni.kit.commands.execute('BindMaterialCommand', prim_path=prim_path, material_path=mat_path) def create_prim(prim_path, prim_type='Xform'): ctx = omni.usd.get_context() stage = ctx.get_stage() prim = stage.DefinePrim(prim_path) if prim_type == 'Xform': xform = UsdGeom.Xform.Define(stage, prim_path) else: xform = UsdGeom.Cube.Define(stage, prim_path) create_transformOps_for_xform(xform) return prim def create_transformOps_for_xform(xform): xform.AddTranslateOp() xform.AddRotateXYZOp() xform.AddScaleOp() def set_transformTRS_attrs(prim, translate: Gf.Vec3d = Gf.Vec3d(0,0,0), rotate: Gf.Vec3d=Gf.Vec3d(0,0,0), scale: Gf.Vec3d=Gf.Vec3d(1,1,1)): prim.GetAttribute('xformOp:translate').Set(translate) prim.GetAttribute('xformOp:rotateXYZ').Set(rotate) prim.GetAttribute('xformOp:scale').Set(scale) def get_bounding_box_dimensions(prim_path: str): min_coords, max_coords = get_coords_from_bbox(prim_path) length = max_coords[0] - min_coords[0] width = max_coords[1] - min_coords[1] height = max_coords[2] - min_coords[2] return length, width, height def get_coords_from_bbox(prim_path: str): ctx = omni.usd.get_context() bbox = ctx.compute_path_world_bounding_box(prim_path) min_coords, max_coords = bbox return min_coords, max_coords def scale_object_if_needed(prim_path): stage = omni.usd.get_context().get_stage() length, width, height = get_bounding_box_dimensions(prim_path) largest_dimension = max(length, width, height) if largest_dimension < 10: prim = stage.GetPrimAtPath(prim_path) # HACK: All Get Attribute Calls need to check if the attribute exists and add it if it doesn't if prim.IsValid(): scale_attr = prim.GetAttribute('xformOp:scale') if scale_attr.IsValid(): current_scale = scale_attr.Get() new_scale = (current_scale[0] * 100, current_scale[1] * 100, current_scale[2] * 100) scale_attr.Set(new_scale) carb.log_info(f"Scaled object by 100 times: {prim_path}") else: carb.log_info(f"Scale attribute not found for prim at path: {prim_path}") else: carb.log_info(f"Invalid prim at path: {prim_path}") else: carb.log_info(f"No scaling needed for object: {prim_path}")
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/deep_search.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from omni.kit.ngsearch.client import NGSearchClient import asyncio import carb async def query_items(queries, url: str, paths): result = list(tuple()) for query in queries: query_result = await _query_first(query, url, paths) if query_result is not None: result.append(query_result) return result async def _query_first(query: str, url: str, paths): filtered_query = "ext:usd,usdz,usda " if len(paths) > 0: filtered_query = filtered_query + " path: " for path in paths: filtered_query = filtered_query + "\"" + str(path) + "\"," filtered_query = filtered_query[:-1] filtered_query = filtered_query + " " filtered_query = filtered_query + query search_result = await NGSearchClient.get_instance().find2( query=filtered_query, url=url) if search_result is not None: if len(search_result.paths) > 0: return (query, search_result.paths[0].uri) else: carb.log_warn(f"Search Results came up with nothing for {query}. Make sure you've configured your nucleus path") return None async def query_all(query: str, url: str, paths): filtered_query = "ext:usd,usdz,usda " + query return await NGSearchClient.get_instance().find2(query=filtered_query, url=url)
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/item_generator.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #hotkey # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from pxr import Usd, Sdf, Gf from .utils import scale_object_if_needed, apply_material_to_prim, create_prim, set_transformTRS_attrs def place_deepsearch_results(gpt_results, query_result, root_prim_path): index = 0 for item in query_result: item_name = item[0] item_path = item[1] # Define Prim prim_parent_path = root_prim_path + item_name.replace(" ", "_") prim_path = prim_parent_path + "/" + item_name.replace(" ", "_") parent_prim = create_prim(prim_parent_path) next_prim = create_prim(prim_path) # Add reference to USD Asset references: Usd.references = next_prim.GetReferences() # TODO: The query results should returnt he full path of the prim references.AddReference( assetPath="omniverse://ov-simready" + item_path) # Add reference for future search refinement config = next_prim.CreateAttribute("DeepSearch:Query", Sdf.ValueTypeNames.String) config.Set(item_name) # HACK: All "GetAttribute" calls should need to check if the attribute exists # translate prim next_object = gpt_results[index] index = index + 1 x = next_object['X'] y = next_object['Y'] z = next_object['Z'] set_transformTRS_attrs(parent_prim, Gf.Vec3d(x,y,z), Gf.Vec3d(0,-90,-90), Gf.Vec3d(1.0,1.0,1.0)) scale_object_if_needed(prim_parent_path) def place_greyboxes(gpt_results, root_prim_path): index = 0 for item in gpt_results: # Define Prim prim_parent_path = root_prim_path + item['object_name'].replace(" ", "_") prim_path = prim_parent_path + "/" + item['object_name'].replace(" ", "_") # Define Dimensions and material length = item['Length']/100 width = item['Width']/100 height = item['Height']/100 x = item['X'] y = item['Y']+height*100*.5 #shift bottom of object to y=0 z = item['Z'] material = item['Material'] # Create Prim parent_prim = create_prim(prim_parent_path) set_transformTRS_attrs(parent_prim) prim = create_prim(prim_path, 'Cube') set_transformTRS_attrs(prim, translate=Gf.Vec3d(x,y,z), scale=Gf.Vec3d(length, height, width)) prim.GetAttribute('extent').Set([(-50.0, -50.0, -50.0), (50.0, 50.0, 50.0)]) prim.GetAttribute('size').Set(100) index = index + 1 # Add Attribute and Material attr = prim.CreateAttribute("object_name", Sdf.ValueTypeNames.String) attr.Set(item['object_name']) apply_material_to_prim(material, prim_path)
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/window.py
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import omni.ui as ui import omni.usd import carb import asyncio import omni.kit.commands from omni.kit.window.popup_dialog.form_dialog import FormDialog from .utils import CreateCubeFromCurve from .style import gen_ai_style, guide from .chatgpt_apiconnect import call_Generate from .priminfo import PrimInfo from pxr import Sdf from .widgets import ProgressBar class GenAIWindow(ui.Window): def __init__(self, title: str, **kwargs) -> None: super().__init__(title, **kwargs) # Models self._path_model = ui.SimpleStringModel() self._prompt_model = ui.SimpleStringModel("generate warehouse objects") self._area_name_model = ui.SimpleStringModel() self._use_deepsearch = ui.SimpleBoolModel() self._use_chatgpt = ui.SimpleBoolModel() self._areas = [] self.response_log = None self.current_index = -1 self.current_area = None self._combo_changed_sub = None self.frame.set_build_fn(self._build_fn) def _build_fn(self): with self.frame: with ui.ScrollingFrame(): with ui.VStack(style=gen_ai_style): with ui.HStack(height=0): ui.Label("Content Generatation with ChatGPT", style={"font_size": 18}) ui.Button(name="properties", tooltip="Configure API Key and Nucleus Path", width=30, height=30, clicked_fn=lambda: self._open_settings()) with ui.CollapsableFrame("Getting Started Instructions", height=0, collapsed=True): ui.Label(guide, word_wrap=True) ui.Line() with ui.HStack(height=0): ui.Label("Area Name", width=ui.Percent(30)) ui.StringField(model=self._area_name_model) ui.Button(name="create", width=30, height=30, clicked_fn=lambda: self._create_new_area(self.get_area_name())) with ui.HStack(height=0): ui.Label("Current Room", width=ui.Percent(30)) self._build_combo_box() ui.Line() with ui.HStack(height=ui.Percent(50)): ui.Label("Prompt", width=0) ui.StringField(model=self._prompt_model, multiline=True) ui.Line() self._build_ai_section() def _save_settings(self, dialog): values = dialog.get_values() carb.log_info(values) settings = carb.settings.get_settings() settings.set_string("/persistent/exts/omni.example.airoomgenerator/APIKey", values["APIKey"]) settings.set_string("/persistent/exts/omni.example.airoomgenerator/deepsearch_nucleus_path", values["deepsearch_nucleus_path"]) settings.set_string("/persistent/exts/omni.example.airoomgenerator/path_filter", values["path_filter"]) dialog.hide() def _open_settings(self): settings = carb.settings.get_settings() apikey_value = settings.get_as_string("/persistent/exts/omni.example.airoomgenerator/APIKey") nucleus_path = settings.get_as_string("/persistent/exts/omni.example.airoomgenerator/deepsearch_nucleus_path") path_filter = settings.get_as_string("/persistent/exts/omni.example.airoomgenerator/path_filter") if apikey_value == "": apikey_value = "Enter API Key Here" if nucleus_path == "": nucleus_path = "(ENTERPRISE ONLY) Enter Nucleus Path Here" if path_filter == "": path_filter = "" field_defs = [ FormDialog.FieldDef("APIKey", "API Key: ", ui.StringField, apikey_value), FormDialog.FieldDef("deepsearch_nucleus_path", "Nucleus Path: ", ui.StringField, nucleus_path), FormDialog.FieldDef("path_filter", "Path Filter: ", ui.StringField, path_filter) ] dialog = FormDialog( title="Settings", message="Your Settings: ", field_defs = field_defs, ok_handler=lambda dialog: self._save_settings(dialog)) dialog.show() def _build_ai_section(self): with ui.HStack(height=0): ui.Spacer() ui.Label("Use ChatGPT: ") ui.CheckBox(model=self._use_chatgpt) ui.Label("Use Deepsearch: ", tooltip="ENTERPRISE USERS ONLY") ui.CheckBox(model=self._use_deepsearch) ui.Spacer() with ui.HStack(height=0): ui.Spacer(width=ui.Percent(10)) ui.Button("Generate", height=40, clicked_fn=lambda: self._generate()) ui.Spacer(width=ui.Percent(10)) self.progress = ProgressBar() with ui.CollapsableFrame("ChatGPT Response / Log", height=0, collapsed=True): self.response_log = ui.Label("", word_wrap=True) def _build_combo_box(self): self.combo_model = ui.ComboBox(self.current_index, *[str(x) for x in self._areas] ).model def combo_changed(item_model, item): index_value_model = item_model.get_item_value_model(item) self.current_area = self._areas[index_value_model.as_int] self.current_index = index_value_model.as_int self.rebuild_frame() self._combo_changed_sub = self.combo_model.subscribe_item_changed_fn(combo_changed) def _create_new_area(self, area_name: str): if area_name == "": carb.log_warn("No area name provided") return new_area_name = CreateCubeFromCurve(self.get_prim_path(), area_name) self._areas.append(new_area_name) self.current_index = len(self._areas) - 1 index_value_model = self.combo_model.get_item_value_model() index_value_model.set_value(self.current_index) def rebuild_frame(self): # we do want to update the area name and possibly last prompt? area_name = self.current_area.split("/World/Layout/") self._area_name_model.set_value(area_name[-1].replace("_", " ")) attr_prompt = self.get_prim().GetAttribute('genai:prompt') if attr_prompt.IsValid(): self._prompt_model.set_value(attr_prompt.Get()) else: self._prompt_model.set_value("") self.frame.rebuild() def _generate(self): prim = self.get_prim() attr = prim.GetAttribute('genai:prompt') if not attr.IsValid(): attr = prim.CreateAttribute('genai:prompt', Sdf.ValueTypeNames.String) attr.Set(self.get_prompt()) items_path = self.current_area + "/items" ctx = omni.usd.get_context() stage = ctx.get_stage() if stage.GetPrimAtPath(items_path).IsValid(): omni.kit.commands.execute('DeletePrims', paths=[items_path], destructive=False) # asyncio.ensure_future(self.progress.fill_bar(0,100)) run_loop = asyncio.get_event_loop() run_loop.create_task(call_Generate(self.get_prim_info(), self.get_prompt(), self._use_chatgpt.as_bool, self._use_deepsearch.as_bool, self.response_log, self.progress )) # Returns a PrimInfo object containing the Length, Width, Origin and Area Name def get_prim_info(self) -> PrimInfo: prim = self.get_prim() prim_info = None if prim.IsValid(): prim_info = PrimInfo(prim, self.current_area) return prim_info # # Get the prim path specified def get_prim_path(self): ctx = omni.usd.get_context() selection = ctx.get_selection().get_selected_prim_paths() if len(selection) > 0: return str(selection[0]) carb.log_warn("No Prim Selected") return "" # Get the area name specified def get_area_name(self): if self._area_name_model == "": carb.log_warn("No Area Name Provided") return self._area_name_model.as_string # Get the prompt specified def get_prompt(self): if self._prompt_model == "": carb.log_warn("No Prompt Provided") return self._prompt_model.as_string # Get the prim based on the Prim Path def get_prim(self): ctx = omni.usd.get_context() stage = ctx.get_stage() prim = stage.GetPrimAtPath(self.current_area) if prim.IsValid() is None: carb.log_warn("No valid prim in the scene") return prim def destroy(self): super().destroy() self._combo_changed_sub = None self._path_model = None self._prompt_model = None self._area_name_model = None self._use_deepsearch = None self._use_chatgpt = None
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/tests/__init__.py
from .test_hello_world import *
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/omni/example/airoomgenerator/tests/test_hello_world.py
# NOTE: # omni.kit.test - std python's unittest module with additional wrapping to add suport for async/await tests # For most things refer to unittest docs: https://docs.python.org/3/library/unittest.html import omni.kit.test # Extnsion for writing UI tests (simulate UI interaction) import omni.kit.ui_test as ui_test # Import extension python module we are testing with absolute import path, as if we are external user (other extension) import company.hello.world # Having a test class dervived from omni.kit.test.AsyncTestCase declared on the root of module will make it auto-discoverable by omni.kit.test class Test(omni.kit.test.AsyncTestCase): # Before running each test async def setUp(self): pass # After running each test async def tearDown(self): pass # Actual test, notice it is "async" function, so "await" can be used if needed async def test_hello_public_function(self): result = company.hello.world.some_public_function(4) self.assertEqual(result, 256) async def test_window_button(self): # Find a label in our window label = ui_test.find("My Window//Frame/**/Label[*]") # Find buttons in our window add_button = ui_test.find("My Window//Frame/**/Button[*].text=='Add'") reset_button = ui_test.find("My Window//Frame/**/Button[*].text=='Reset'") # Click reset button await reset_button.click() self.assertEqual(label.widget.text, "empty") await add_button.click() self.assertEqual(label.widget.text, "count: 1") await add_button.click() self.assertEqual(label.widget.text, "count: 2")
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/docs/CHANGELOG.md
# Changelog The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [1.0.0] - 2021-04-26 - Initial version of extension UI template with a window
NVIDIA-Omniverse/kit-extension-sample-airoomgenerator/exts/omni.example.airoomgenerator/docs/README.md
# AI Room Generator Sample Extension (omni.sample.airoomgenerator) ![Preview](../data/preview.png) ## Overview The AI Room Generator Sample Extension allows users to generate 3D content to populate a room using Generative AI. The user will specify what area that defines the room and a prompt that will get passed to ChatGPT. > NOTE: To enable the extension you will need to have ngsearch module. By default it is already avaliable in Omniverse USD Composer. If using Omniverse Code follow these [instructions](https://docs.omniverse.nvidia.com/prod_nucleus/prod_services/services/deepsearch/client/using_deepsearch_ui.html#using-deepsearch-beta-in-usd-composer) to get ngsearch This Sample Extension utilizes Omniverse's [Deepsearch](https://docs.omniverse.nvidia.com/prod_nucleus/prod_services/services/deepsearch/overview.html) functionality to search for models within a nucleus server. (ENTERPRISE USERS ONLY) ## UI Overview ![UI Image](../data/ui.png) 1. Settings (Cog Button) - Where the user can input their API Key from [OpenAI](https://platform.openai.com/account/api-keys) - Enterprise users can input their Deepsearch Enabled Nucleus Path 2. Area Name - The name that will be applied to the Area once added. 3. Add Area (Plus Button) - With an area selected and an Area Name provided, it will remove the selected object and spawn in a cube resembling the dimensions of the selected area prim. 4. Current Room - By default this will be empty. As you add rooms this combo box will populate and allow you to switch between each generated room maintaining the prompt (if the room items have been generated). This allows users to adjust their prompt later for an already generated room. 5. Prompt - The prompt that will be sent to ChatGPT. - Here is an example prompt for a reception area: - "This is the room where we meet our customers. Make sure there is a set of comfortable armchairs, a sofa, and a coffee table" 6. Use ChatGPT - This enables the extension to call ChatGPT, otherwise it will use a default assistant prompt which will be the same every time. 7. Use Deepsearch (ENTERPRISE USERS ONLY) - This enables the extension to use Deepsearch 8. Generate - With a room selected and a prompt, this will send all the related information to ChatGPT. A progress bar will show up indicating if the response is still going. 9. ChatGPT Reponse / Log - Once you have hit *Generate* this collapsable frame will contain the output recieved from ChatGPT. Here you can view the JSON data or if any issues arise with ChatGPT. ## How it works ### Getting information about the 3D Scene Everything starts with the USD scene in Omniverse. Users can easily circle an area using the Pencil tool in Omniverse or create a cube and scale it in the scene, type in the kind of room/environment they want to generate - for example, a warehouse, or a reception room - and with one click that area is created. ![Pencil](../data/pencil.png) ### Creating the Prompt for ChatGPT The ChatGPT prompt is composed of four pieces; system input, user input example, assistant output example, and user prompt. Let’s start with the aspects of the prompt that tailor to the user’s scenario. This includes text that the user inputs plus data from the scene. For example, if the user wants to create a reception room, they specify something like “This is the room where we meet our customers. Make sure there is a set of comfortable armchairs, a sofa and a coffee table”. Or, if they want to add a certain number of items they could add “make sure to include a minimum of 10 items”. This text is combined with scene information like the size and name of the area where we will place items as the User Prompt. ### Passing the results from ChatGPT ![deepsearch](../data/deepsearch.png) The items from the ChatGPT JSON response are then parsed by the extension and passed to the Omnivere DeepSearch API. DeepSearch allows users to search 3D models stored within an Omniverse Nucleus server using natural language queries. This means that even if we don’t know the exact file name of a model of a sofa, for example, we can retrieve it just by searching for “Comfortable Sofa” which is exactly what we got from ChatGPT. DeepSearch understands natural language and by asking it for a “Comfortable Sofa” we get a list of items that our helpful AI librarian has decided are best suited from the selection of assets we have in our current asset library. It is surprisingly good at this and so we often can use the first item it returns, but of course we build in choice in case the user wants to select something from the list. ### When not using Deepsearch ![greyboxing](../data/greyboxing.png) For those who are not Enterprise users or users that want to use greyboxing, by default as long as `use Deepsearch` is turned off the extension will generate cube of various shapes and sizes to best suit the response from ChatGPT.
NVIDIA-Omniverse/AnariUsdDevice/UsdParameterizedObject.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include <map> #include <string> #include <cstring> #include <cassert> #include <algorithm> #include <vector> #include "UsdAnari.h" #include "UsdSharedObjects.h" #include "UsdMultiTypeParameter.h" #include "helium/utility/IntrusivePtr.h" #include "anari/frontend/type_utility.h" class UsdDevice; class UsdBridge; // When deriving from UsdParameterizedObject<T>, define a a struct T::Data and // a static void T::registerParams() that registers any member of T::Data using REGISTER_PARAMETER_MACRO() template<typename T, typename D> class UsdParameterizedObject { public: struct UsdAnariDataTypeStore { ANARIDataType type0 = ANARI_UNKNOWN; ANARIDataType type1 = ANARI_UNKNOWN; ANARIDataType type2 = ANARI_UNKNOWN; ANARIDataType singleType() const { return type0; } bool isMultiType() const { return type1 != ANARI_UNKNOWN; } bool typeMatches(ANARIDataType inType) const { return inType == type0 || (isMultiType() && (inType == type1 || inType == type2)); } }; struct ParamTypeInfo { size_t dataOffset = 0; // offset of data, within paramDataSet D size_t typeOffset = 0; // offset of type, from data size_t size = 0; // Total size of data+type UsdAnariDataTypeStore types; }; using ParameterizedClassType = UsdParameterizedObject<T, D>; using ParamContainer = std::map<std::string, ParamTypeInfo>; void* getParam(const char* name, ANARIDataType& returnType) { // Check if name registered typename ParamContainer::iterator it = registeredParams->find(name); if (it != registeredParams->end()) { const ParamTypeInfo& typeInfo = it->second; void* destAddress = nullptr; getParamTypeAndAddress(paramDataSets[paramWriteIdx], typeInfo, returnType, destAddress); return destAddress; } return nullptr; } protected: helium::RefCounted** ptrToRefCountedPtr(void* address) { return reinterpret_cast<helium::RefCounted**>(address); } ANARIDataType* toAnariDataTypePtr(void* address) { return reinterpret_cast<ANARIDataType*>(address); } bool isRefCounted(ANARIDataType type) const { return anari::isObject(type) || type == ANARI_STRING; } void safeRefInc(void* paramPtr) // Pointer to the parameter address which holds a helium::RefCounted* { helium::RefCounted** refCountedPP = ptrToRefCountedPtr(paramPtr); if (*refCountedPP) (*refCountedPP)->refInc(helium::RefType::INTERNAL); } void safeRefDec(void* paramPtr, ANARIDataType paramType) // Pointer to the parameter address which holds a helium::RefCounted* { helium::RefCounted** refCountedPP = ptrToRefCountedPtr(paramPtr); if (*refCountedPP) { helium::RefCounted*& refCountedP = *refCountedPP; #ifdef CHECK_MEMLEAKS logDeallocationThroughDevice(allocDevice, refCountedP, paramType); #endif assert(refCountedP->useCount(helium::RefType::INTERNAL) > 0); refCountedP->refDec(helium::RefType::INTERNAL); refCountedP = nullptr; // Explicitly clear the pointer (see destructor) } } void* paramAddress(D& paramData, const ParamTypeInfo& typeInfo) { return reinterpret_cast<char*>(&paramData) + typeInfo.dataOffset; } ANARIDataType paramType(void* paramAddress, const ParamTypeInfo& typeInfo) { if(typeInfo.types.isMultiType()) return *toAnariDataTypePtr(static_cast<char*>(paramAddress) + typeInfo.typeOffset); else return typeInfo.types.singleType(); } void setMultiParamType(void* paramAddress, const ParamTypeInfo& typeInfo, ANARIDataType newType) { if(typeInfo.types.isMultiType()) *toAnariDataTypePtr(static_cast<char*>(paramAddress) + typeInfo.typeOffset) = newType; } void getParamTypeAndAddress(D& paramData, const ParamTypeInfo& typeInfo, ANARIDataType& returnType, void*& returnAddress) { returnAddress = paramAddress(paramData, typeInfo); returnType = paramType(returnAddress, typeInfo); } // Convenience function for usd-compatible parameters void formatUsdName(UsdSharedString* nameStr) { char* name = const_cast<char*>(UsdSharedString::c_str(nameStr)); assert(strlen(name) > 0); auto letter = [](unsigned c) { return ((c - 'A') < 26) || ((c - 'a') < 26); }; auto number = [](unsigned c) { return (c - '0') < 10; }; auto under = [](unsigned c) { return c == '_'; }; unsigned x = *name; if (!letter(x) && !under(x)) { *name = '_'; } x = *(++name); while (x != '\0') { if(!letter(x) && !number(x) && !under(x)) *name = '_'; x = *(++name); }; } public: UsdParameterizedObject() { static ParamContainer* reg = ParameterizedClassType::registerParams(); registeredParams = reg; } ~UsdParameterizedObject() { // Manually decrease the references on all objects in the read and writeparam datasets // (since the pointers are relinquished) auto it = registeredParams->begin(); while (it != registeredParams->end()) { const ParamTypeInfo& typeInfo = it->second; ANARIDataType readParamType, writeParamType; void* readParamAddress = nullptr; void* writeParamAddress = nullptr; getParamTypeAndAddress(paramDataSets[paramReadIdx], typeInfo, readParamType, readParamAddress); getParamTypeAndAddress(paramDataSets[paramWriteIdx], typeInfo, writeParamType, writeParamAddress); // Works even if two parameters point to the same object, as the object pointers are set to null if(isRefCounted(readParamType)) safeRefDec(readParamAddress, readParamType); if(isRefCounted(writeParamType)) safeRefDec(writeParamAddress, writeParamType); ++it; } } const D& getReadParams() const { return paramDataSets[paramReadIdx]; } D& getWriteParams() { return paramDataSets[paramWriteIdx]; } protected: void setParam(const char* name, ANARIDataType srcType, const void* rawSrc, UsdDevice* device) { #ifdef CHECK_MEMLEAKS allocDevice = device; #endif if(srcType == ANARI_UNKNOWN) { reportStatusThroughDevice(UsdLogInfo(device, this, ANARI_OBJECT, nullptr), ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "Attempting to set param %s with type %s", name, AnariTypeToString(srcType)); return; } else if(anari::isArray(srcType)) { // Flatten the source type in case of array srcType = ANARI_ARRAY; } // Check if name registered typename ParamContainer::iterator it = registeredParams->find(name); if (it != registeredParams->end()) { const ParamTypeInfo& typeInfo = it->second; // Check if type matches if (typeInfo.types.typeMatches(srcType)) { ANARIDataType destType; void* destAddress = nullptr; getParamTypeAndAddress(paramDataSets[paramWriteIdx], typeInfo, destType, destAddress); const void* srcAddress = rawSrc; //temporary src size_t numBytes = anari::sizeOf(srcType); // Size is determined purely by source data bool contentUpdate = srcType != destType; // Always do a content update if types differ (in case of multitype params) // Update data for all the different types if (srcType == ANARI_BOOL) { bool* destBool_p = reinterpret_cast<bool*>(destAddress); bool srcBool = *(reinterpret_cast<const uint32_t*>(srcAddress)); contentUpdate = contentUpdate || (*destBool_p != srcBool); *destBool_p = srcBool; } else { UsdSharedString* sharedStr = nullptr; if (srcType == ANARI_STRING) { // Wrap strings to make them refcounted, // from that point they are considered normal RefCounteds. UsdSharedString* destStr = reinterpret_cast<UsdSharedString*>(*ptrToRefCountedPtr(destAddress)); const char* srcCstr = reinterpret_cast<const char*>(srcAddress); contentUpdate = contentUpdate || !destStr || !strEquals(destStr->c_str(), srcCstr); // Note that execution of strEquals => (srcType == destType) if(contentUpdate) { sharedStr = new UsdSharedString(srcCstr); // Remember to refdec numBytes = sizeof(void*); srcAddress = &sharedStr; #ifdef CHECK_MEMLEAKS logAllocationThroughDevice(allocDevice, sharedStr, ANARI_STRING); #endif } } else contentUpdate = contentUpdate || bool(std::memcmp(destAddress, srcAddress, numBytes)); if(contentUpdate) { if(isRefCounted(destType)) safeRefDec(destAddress, destType); std::memcpy(destAddress, srcAddress, numBytes); if(isRefCounted(srcType)) safeRefInc(destAddress); } // If a string object has been created, decrease its public refcount (1 at creation) if (sharedStr) { assert(sharedStr->useCount() == 2); // Single public and internal reference sharedStr->refDec(); } } // Update the type for multitype params (so far only data has been updated) if(contentUpdate) setMultiParamType(destAddress, typeInfo, srcType); if(!strEquals(name, "usd::time")) // Allow for re-use of object as reference at different timestep, without triggering a full re-commit of the referenced object { #ifdef TIME_BASED_CACHING paramChanged = true; //For time-varying parameters, comparisons between content of potentially different timesteps is meaningless #else paramChanged = paramChanged || contentUpdate; #endif } } else reportStatusThroughDevice(UsdLogInfo(device, this, ANARI_OBJECT, nullptr), ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "Param %s is not of an accepted type. For example, use %s instead.", name, AnariTypeToString(typeInfo.types.type0)); } } void resetParam(const ParamTypeInfo& typeInfo) { size_t paramSize = typeInfo.size; // Copy to existing write param location ANARIDataType destType; void* destAddress = nullptr; getParamTypeAndAddress(paramDataSets[paramWriteIdx], typeInfo, destType, destAddress); // Create temporary default-constructed parameter set and find source param address ((multi-)type is of no concern) D defaultParamData; void* srcAddress = paramAddress(defaultParamData, typeInfo); // Make sure to dec existing ptr, as it will be relinquished if(isRefCounted(destType)) safeRefDec(destAddress, destType); // Just replace contents of the whole parameter structure, single or multiparam std::memcpy(destAddress, srcAddress, paramSize); } void resetParam(const char* name) { typename ParamContainer::iterator it = registeredParams->find(name); if (it != registeredParams->end()) { const ParamTypeInfo& typeInfo = it->second; resetParam(typeInfo); if(!strEquals(name, "usd::time")) { paramChanged = true; } } } void resetParams() { auto it = registeredParams->begin(); while (it != registeredParams->end()) { resetParam(it->second); ++it; } paramChanged = true; } void transferWriteToReadParams() { // Make sure object references are removed for // the overwritten readparams, and increased for the source writeparams auto it = registeredParams->begin(); while (it != registeredParams->end()) { const ParamTypeInfo& typeInfo = it->second; ANARIDataType srcType, destType; void* srcAddress = nullptr; void* destAddress = nullptr; getParamTypeAndAddress(paramDataSets[paramWriteIdx], typeInfo, srcType, srcAddress); getParamTypeAndAddress(paramDataSets[paramReadIdx], typeInfo, destType, destAddress); // SrcAddress and destAddress are not the same, but they may specifically contain the same object pointers. // Branch out on that situation (may also be disabled, which results in a superfluous inc/dec) if(std::memcmp(destAddress, srcAddress, typeInfo.size)) { // First inc, then dec (in case branch is taken out and the pointed to object is the same) if (isRefCounted(srcType)) safeRefInc(srcAddress); if (isRefCounted(destType)) safeRefDec(destAddress, destType); // Perform assignment immediately; there may be multiple parameters with the same object target, // which will be branched out at the compare the second time around std::memcpy(destAddress, srcAddress, typeInfo.size); } ++it; } } static ParamContainer* registerParams(); ParamContainer* registeredParams; typedef T DerivedClassType; typedef D DataType; D paramDataSets[2]; constexpr static unsigned int paramReadIdx = 0; constexpr static unsigned int paramWriteIdx = 1; bool paramChanged = false; #ifdef CHECK_MEMLEAKS UsdDevice* allocDevice = nullptr; #endif }; #define DEFINE_PARAMETER_MAP(DefClass, Params) template<> UsdParameterizedObject<DefClass,DefClass::DataType>::ParamContainer* UsdParameterizedObject<DefClass,DefClass::DataType>::registerParams() { static ParamContainer registeredParams; Params return &registeredParams; } #define REGISTER_PARAMETER_MACRO(ParamName, ParamType, ParamData) \ registeredParams.emplace( std::make_pair<std::string, ParamTypeInfo>( \ std::string(ParamName), \ {offsetof(DataType, ParamData), 0, sizeof(DataType::ParamData), {ParamType, ANARI_UNKNOWN, ANARI_UNKNOWN}} \ )); \ static_assert(ParamType == anari::ANARITypeFor<decltype(DataType::ParamData)>::value, "ANARI type " #ParamType " of member '" #ParamData "' does not correspond to member type"); #define REGISTER_PARAMETER_MULTITYPE_MACRO(ParamName, ParamType0, ParamType1, ParamType2, ParamData) \ { \ static_assert(ParamType0 == decltype(DataType::ParamData)::AnariType0, "MultiTypeParams registration: ParamType0 " #ParamType0 " of member '" #ParamData "' doesn't match AnariType0"); \ static_assert(ParamType1 == decltype(DataType::ParamData)::AnariType1, "MultiTypeParams registration: ParamType1 " #ParamType1 " of member '" #ParamData "' doesn't match AnariType1"); \ static_assert(ParamType2 == decltype(DataType::ParamData)::AnariType2, "MultiTypeParams registration: ParamType2 " #ParamType2 " of member '" #ParamData "' doesn't match AnariType2"); \ size_t dataOffset = offsetof(DataType, ParamData); \ size_t typeOffset = offsetof(DataType, ParamData.type); \ registeredParams.emplace( std::make_pair<std::string, ParamTypeInfo>( \ std::string(ParamName), \ {dataOffset, typeOffset - dataOffset, sizeof(DataType::ParamData), {ParamType0, ParamType1, ParamType2}} \ )); \ } // Static assert explainer: gets the element type of the array via the decltype of *std::begin(), which in turn accepts an array #define REGISTER_PARAMETER_ARRAY_MACRO(ParamName, ParamNameSuffix, ParamType, ParamData, NumEntries) \ { \ using element_type_t = std::remove_reference_t<decltype(*std::begin(std::declval<decltype(DataType::ParamData)&>()))>; \ static_assert(ParamType == anari::ANARITypeFor<element_type_t>::value, "ANARI type " #ParamType " of member '" #ParamData "' does not correspond to member type"); \ static_assert(sizeof(decltype(DataType::ParamData)) == sizeof(element_type_t)*NumEntries, "Number of elements of member '" #ParamData "' does not correspond with member declaration."); \ size_t offset0 = offsetof(DataType, ParamData[0]); \ size_t offset1 = offsetof(DataType, ParamData[1]); \ size_t paramSize = offset1-offset0; \ for(int i = 0; i < NumEntries; ++i) \ { \ registeredParams.emplace( std::make_pair<std::string, ParamTypeInfo>( \ ParamName + std::to_string(i) + ParamNameSuffix, \ {offset0+paramSize*i, 0, paramSize, {ParamType, ANARI_UNKNOWN, ANARI_UNKNOWN}} \ )); \ } \ }
NVIDIA-Omniverse/AnariUsdDevice/khr_geometry_glyph.json
{ "info" : { "name" : "KHR_GEOMETRY_GLYPH", "type" : "extension", "dependencies" : [] }, "objects" : [ { "type" : "ANARI_GEOMETRY", "name" : "glyph", "description" : "glyph geometry object", "parameters" : [ { "name" : "name", "types" : ["ANARI_STRING"], "tags" : [], "description" : "optional object name" }, { "name" : "primitive.color", "types" : ["ANARI_ARRAY1D"], "elementType" : [ "ANARI_UFIXED8", "ANARI_UFIXED8_VEC2", "ANARI_UFIXED8_VEC3", "ANARI_UFIXED8_VEC4", "ANARI_UFIXED8_R_SRGB", "ANARI_UFIXED8_RA_SRGB", "ANARI_UFIXED8_RGB_SRGB", "ANARI_UFIXED8_RGBA_SRGB", "ANARI_UFIXED16", "ANARI_UFIXED16_VEC2", "ANARI_UFIXED16_VEC3", "ANARI_UFIXED16_VEC4", "ANARI_UFIXED32", "ANARI_UFIXED32_VEC2", "ANARI_UFIXED32_VEC3", "ANARI_UFIXED32_VEC4", "ANARI_FLOAT32", "ANARI_FLOAT32_VEC2", "ANARI_FLOAT32_VEC3", "ANARI_FLOAT32_VEC4"], "tags" : [], "description" : "per primitive color" }, { "name" : "primitive.attribute0", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_FLOAT32", "ANARI_FLOAT32_VEC2", "ANARI_FLOAT32_VEC3", "ANARI_FLOAT32_VEC4"], "tags" : [], "description" : "per primitive attribute0" }, { "name" : "primitive.attribute1", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_FLOAT32", "ANARI_FLOAT32_VEC2", "ANARI_FLOAT32_VEC3", "ANARI_FLOAT32_VEC4"], "tags" : [], "description" : "per primitive attribute1" }, { "name" : "primitive.attribute2", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_FLOAT32", "ANARI_FLOAT32_VEC2", "ANARI_FLOAT32_VEC3", "ANARI_FLOAT32_VEC4"], "tags" : [], "description" : "per primitive attribute2" }, { "name" : "primitive.attribute3", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_FLOAT32", "ANARI_FLOAT32_VEC2", "ANARI_FLOAT32_VEC3", "ANARI_FLOAT32_VEC4"], "tags" : [], "description" : "per primitive attribute3" }, { "name" : "primitive.id", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_UINT32", "ANARI_UINT64"], "tags" : [], "description" : "primitive id" }, { "name" : "vertex.position", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_FLOAT32_VEC3"], "tags" : ["required"], "description" : "glyph position" }, { "name" : "vertex.scale", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_FLOAT32", "ANARI_FLOAT32_VEC3"], "tags" : [], "description" : "glyph scale" }, { "name" : "vertex.orientation", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_FLOAT32_QUAT_IJKW"], "tags" : [], "description" : "glyph orientation" }, { "name" : "vertex.cap", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_UINT8"], "tags" : [], "description" : "glyph cap type for cylinders and cones" }, { "name" : "vertex.color", "types" : ["ANARI_ARRAY1D"], "elementType" : [ "ANARI_UFIXED8", "ANARI_UFIXED8_VEC2", "ANARI_UFIXED8_VEC3", "ANARI_UFIXED8_VEC4", "ANARI_UFIXED8_R_SRGB", "ANARI_UFIXED8_RA_SRGB", "ANARI_UFIXED8_RGB_SRGB", "ANARI_UFIXED8_RGBA_SRGB", "ANARI_UFIXED16", "ANARI_UFIXED16_VEC2", "ANARI_UFIXED16_VEC3", "ANARI_UFIXED16_VEC4", "ANARI_UFIXED32", "ANARI_UFIXED32_VEC2", "ANARI_UFIXED32_VEC3", "ANARI_UFIXED32_VEC4", "ANARI_FLOAT32", "ANARI_FLOAT32_VEC2", "ANARI_FLOAT32_VEC3", "ANARI_FLOAT32_VEC4"], "tags" : [], "description" : "vertex color" }, { "name" : "vertex.attribute0", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_FLOAT32", "ANARI_FLOAT32_VEC2", "ANARI_FLOAT32_VEC3", "ANARI_FLOAT32_VEC4"], "tags" : [], "description" : "vertex attribute0" }, { "name" : "vertex.attribute1", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_FLOAT32", "ANARI_FLOAT32_VEC2", "ANARI_FLOAT32_VEC3", "ANARI_FLOAT32_VEC4"], "tags" : [], "description" : "vertex attribute1" }, { "name" : "vertex.attribute2", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_FLOAT32", "ANARI_FLOAT32_VEC2", "ANARI_FLOAT32_VEC3", "ANARI_FLOAT32_VEC4"], "tags" : [], "description" : "vertex attribute2" }, { "name" : "vertex.attribute3", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_FLOAT32", "ANARI_FLOAT32_VEC2", "ANARI_FLOAT32_VEC3", "ANARI_FLOAT32_VEC4"], "tags" : [], "description" : "vertex attribute3" }, { "name" : "primitive.index", "types" : ["ANARI_ARRAY1D"], "elementType" : ["ANARI_UINT32", "ANARI_UINT64"], "tags" : [], "description" : "index array" }, { "name" : "scale", "types" : ["ANARI_FLOAT32_VEC3"], "tags" : [], "description" : "global glyph scale" }, { "name" : "orientation", "types" : ["ANARI_FLOAT32_QUAT_IJKW"], "tags" : [], "description" : "global glyph orientation" }, { "name" : "caps", "types" : ["ANARI_STRING"], "tags" : [], "default" : "none", "values" : ["none", "first", "second", "both"], "description" : "global cap type for cylinders and cones" }, { "name" : "shapeType", "types" : ["ANARI_STRING"], "tags" : [], "description" : "glyph shape geometry type" }, { "name" : "shapeGeometry", "types" : ["ANARI_GEOMETRY"], "tags" : [], "description" : "glyph shape geometry" }, { "name" : "shapeTransform", "types" : ["ANARI_FLOAT32_MAT4"], "tags" : [], "description" : "glyph shape transform" } ] } ] }
NVIDIA-Omniverse/AnariUsdDevice/UsdRenderer.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBaseObject.h" #include "UsdParameterizedObject.h" struct UsdRendererData { }; class UsdRenderer : public UsdParameterizedBaseObject<UsdRenderer, UsdRendererData> { public: UsdRenderer(); ~UsdRenderer(); void remove(UsdDevice* device) override {} int getProperty(const char * name, ANARIDataType type, void * mem, uint64_t size, UsdDevice* device) override; protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override {} UsdBridge* usdBridge; };
NVIDIA-Omniverse/AnariUsdDevice/UsdGeometry.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridgedBaseObject.h" #include <memory> #include <limits> class UsdDataArray; struct UsdBridgeMeshData; static constexpr int MAX_ATTRIBS = 16; enum class UsdGeometryComponents { POSITION = 0, NORMAL, COLOR, INDEX, SCALE, ORIENTATION, ID, ATTRIBUTE0, ATTRIBUTE1, ATTRIBUTE2, ATTRIBUTE3 }; struct UsdGeometryData { UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; double timeStep = 0.0; int timeVarying = 0xFFFFFFFF; // TimeVarying bits const UsdDataArray* vertexPositions = nullptr; const UsdDataArray* vertexNormals = nullptr; const UsdDataArray* vertexColors = nullptr; const UsdDataArray* vertexAttributes[MAX_ATTRIBS] = { nullptr }; const UsdDataArray* primitiveNormals = nullptr; const UsdDataArray* primitiveColors = nullptr; const UsdDataArray* primitiveAttributes[MAX_ATTRIBS] = { nullptr }; const UsdDataArray* primitiveIds = nullptr; const UsdSharedString* attributeNames[MAX_ATTRIBS] = { nullptr }; const UsdDataArray* indices = nullptr; // Spheres const UsdDataArray* vertexRadii = nullptr; float radiusConstant = 1.0f; bool UseUsdGeomPoints = #ifdef USE_USD_GEOM_POINTS true; #else false; #endif // Cylinders const UsdDataArray* primitiveRadii = nullptr; // Curves // Glyphs const UsdDataArray* vertexScales = nullptr; const UsdDataArray* primitiveScales = nullptr; const UsdDataArray* vertexOrientations = nullptr; const UsdDataArray* primitiveOrientations = nullptr; UsdFloat3 scaleConstant = {1.0f, 1.0f, 1.0f}; UsdQuaternion orientationConstant; UsdSharedString* shapeType = nullptr; UsdGeometry* shapeGeometry = nullptr; UsdFloatMat4 shapeTransform; double shapeGeometryRefTimeStep = std::numeric_limits<float>::quiet_NaN(); }; struct UsdGeometryTempArrays; class UsdGeometry : public UsdBridgedBaseObject<UsdGeometry, UsdGeometryData, UsdGeometryHandle, UsdGeometryComponents> { public: enum GeomType { GEOM_UNKNOWN = 0, GEOM_TRIANGLE, GEOM_QUAD, GEOM_SPHERE, GEOM_CYLINDER, GEOM_CONE, GEOM_CURVE, GEOM_GLYPH }; typedef std::vector<UsdBridgeAttribute> AttributeArray; typedef std::vector<std::vector<char>> AttributeDataArraysType; UsdGeometry(const char* name, const char* type, UsdDevice* device); ~UsdGeometry(); void remove(UsdDevice* device) override; void filterSetParam(const char *name, ANARIDataType type, const void *mem, UsdDevice* device) override; bool isInstanced() const { return geomType == GEOM_SPHERE || geomType == GEOM_CONE || geomType == GEOM_CYLINDER || geomType == GEOM_GLYPH; } static constexpr ComponentPair componentParamNames[] = { ComponentPair(UsdGeometryComponents::POSITION, "position"), ComponentPair(UsdGeometryComponents::NORMAL, "normal"), ComponentPair(UsdGeometryComponents::COLOR, "color"), ComponentPair(UsdGeometryComponents::INDEX, "index"), ComponentPair(UsdGeometryComponents::SCALE, "scale"), ComponentPair(UsdGeometryComponents::SCALE, "radius"), ComponentPair(UsdGeometryComponents::ORIENTATION, "orientation"), ComponentPair(UsdGeometryComponents::ID, "id"), ComponentPair(UsdGeometryComponents::ATTRIBUTE0, "attribute0"), ComponentPair(UsdGeometryComponents::ATTRIBUTE1, "attribute1"), ComponentPair(UsdGeometryComponents::ATTRIBUTE2, "attribute2"), ComponentPair(UsdGeometryComponents::ATTRIBUTE3, "attribute3")}; protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override; void initializeGeomData(UsdBridgeMeshData& geomData); void initializeGeomData(UsdBridgeInstancerData& geomData); void initializeGeomData(UsdBridgeCurveData& geomData); void initializeGeomRefData(UsdBridgeInstancerRefData& geomRefData); bool checkArrayConstraints(const UsdDataArray* vertexArray, const UsdDataArray* primArray, const char* paramName, UsdDevice* device, const char* debugName, int attribIndex = -1); bool checkGeomParams(UsdDevice* device); void updateGeomData(UsdDevice* device, UsdBridge* usdBridge, UsdBridgeMeshData& meshData, bool isNew); void updateGeomData(UsdDevice* device, UsdBridge* usdBridge, UsdBridgeInstancerData& instancerData, bool isNew); void updateGeomData(UsdDevice* device, UsdBridge* usdBridge, UsdBridgeCurveData& curveData, bool isNew); template<typename UsdGeomType> bool commitTemplate(UsdDevice* device); void commitPrototypes(UsdBridge* usdBridge); template<typename GeomDataType> void setAttributeTimeVarying(typename GeomDataType::DataMemberId& timeVarying); void syncAttributeArrays(); template<typename GeomDataType> void copyAttributeArraysToData(GeomDataType& geomData); void assignTempDataToAttributes(bool perPrimInterpolation); GeomType geomType = GEOM_UNKNOWN; bool protoShapeChanged = false; // Do not automatically commit shapes (the object may have been recreated onto an already existing USD prim) std::unique_ptr<UsdGeometryTempArrays> tempArrays; AttributeArray attributeArray; };
NVIDIA-Omniverse/AnariUsdDevice/UsdMaterial.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridgedBaseObject.h" #include "UsdBridgeNumerics.h" #include "UsdDeviceUtils.h" #include <limits> class UsdSampler; template<typename ValueType> using UsdMaterialMultiTypeParameter = UsdMultiTypeParameter<ValueType, UsdSampler*, UsdSharedString*>; enum class UsdMaterialDataComponents { COLOR = 0, OPACITY, EMISSIVE, EMISSIVEFACTOR, ROUGHNESS, METALLIC, IOR }; struct UsdMaterialData { UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; double timeStep = std::numeric_limits<float>::quiet_NaN(); int timeVarying = 0; // Bitmask indicating which attributes are time-varying. // Standard parameters UsdMaterialMultiTypeParameter<UsdFloat3> color = {{ 1.0f, 1.0f, 1.0f }, ANARI_FLOAT32_VEC3}; UsdMaterialMultiTypeParameter<float> opacity = {1.0f, ANARI_FLOAT32}; UsdSharedString* alphaMode = nullptr; // Timevarying state linked to opacity float alphaCutoff = 0.5f; // Timevarying state linked to opacity // Possible PBR parameters UsdMaterialMultiTypeParameter<UsdFloat3> emissiveColor = {{ 1.0f, 1.0f, 1.0f }, ANARI_FLOAT32_VEC3}; UsdMaterialMultiTypeParameter<float> emissiveIntensity = {0.0f, ANARI_FLOAT32}; UsdMaterialMultiTypeParameter<float> roughness = {0.5f, ANARI_FLOAT32}; UsdMaterialMultiTypeParameter<float> metallic = {0.0f, ANARI_FLOAT32}; UsdMaterialMultiTypeParameter<float> ior = {1.0f, ANARI_FLOAT32}; double colorSamplerTimeStep = std::numeric_limits<float>::quiet_NaN(); double opacitySamplerTimeStep = std::numeric_limits<float>::quiet_NaN(); double emissiveSamplerTimeStep = std::numeric_limits<float>::quiet_NaN(); double emissiveIntensitySamplerTimeStep = std::numeric_limits<float>::quiet_NaN(); double roughnessSamplerTimeStep = std::numeric_limits<float>::quiet_NaN(); double metallicSamplerTimeStep = std::numeric_limits<float>::quiet_NaN(); double iorSamplerTimeStep = std::numeric_limits<float>::quiet_NaN(); }; class UsdMaterial : public UsdBridgedBaseObject<UsdMaterial, UsdMaterialData, UsdMaterialHandle, UsdMaterialDataComponents> { public: using MaterialDMI = UsdBridgeMaterialData::DataMemberId; UsdMaterial(const char* name, const char* type, UsdDevice* device); ~UsdMaterial(); void remove(UsdDevice* device) override; bool isPerInstance() const { return perInstance; } void updateBoundParameters(bool boundToInstance, UsdDevice* device); static constexpr ComponentPair componentParamNames[] = { ComponentPair(UsdMaterialDataComponents::COLOR, "color"), ComponentPair(UsdMaterialDataComponents::COLOR, "baseColor"), ComponentPair(UsdMaterialDataComponents::OPACITY, "opacity"), ComponentPair(UsdMaterialDataComponents::EMISSIVE, "emissive"), ComponentPair(UsdMaterialDataComponents::EMISSIVEFACTOR, "emissiveIntensity"), ComponentPair(UsdMaterialDataComponents::ROUGHNESS, "roughness"), ComponentPair(UsdMaterialDataComponents::METALLIC, "metallic"), ComponentPair(UsdMaterialDataComponents::IOR, "ior")}; protected: using MaterialInputAttribNamePair = std::pair<MaterialDMI, const char*>; template<typename ValueType> bool getMaterialInputSourceName(const UsdMaterialMultiTypeParameter<ValueType>& param, MaterialDMI dataMemberId, UsdDevice* device, const UsdLogInfo& logInfo); template<typename ValueType> bool getSamplerRefData(const UsdMaterialMultiTypeParameter<ValueType>& param, double refTimeStep, MaterialDMI dataMemberId, UsdDevice* device, const UsdLogInfo& logInfo); template<typename ValueType> void assignParameterToMaterialInput( const UsdMaterialMultiTypeParameter<ValueType>& param, UsdBridgeMaterialData::MaterialInput<ValueType>& matInput, const UsdLogInfo& logInfo); bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override; void setMaterialTimeVarying(UsdBridgeMaterialData::DataMemberId& timeVarying); bool isPbr = false; bool perInstance = false; // Whether material is attached to a point instancer bool instanceAttributeAttached = false; // Whether a value to any parameter has been set which in USD is different between per-instance and regular geometries OptionalList<MaterialInputAttribNamePair> materialInputAttributes; OptionalList<UsdSamplerHandle> samplerHandles; OptionalList<UsdSamplerRefData> samplerRefDatas; };
NVIDIA-Omniverse/AnariUsdDevice/UsdMaterial.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdMaterial.h" #include "UsdAnari.h" #include "UsdDevice.h" #include "UsdSampler.h" #include "UsdDataArray.h" #define SamplerType ANARI_SAMPLER using SamplerUsdType = AnariToUsdBridgedObject<SamplerType>::Type; #define REGISTER_PARAMETER_MATERIAL_MULTITYPE_MACRO(ParamName, ParamType0, ParamData) \ REGISTER_PARAMETER_MULTITYPE_MACRO(ParamName, ParamType0, SamplerType, ANARI_STRING, ParamData) DEFINE_PARAMETER_MAP(UsdMaterial, REGISTER_PARAMETER_MACRO("name", ANARI_STRING, name) REGISTER_PARAMETER_MACRO("usd::name", ANARI_STRING, usdName) REGISTER_PARAMETER_MACRO("usd::time", ANARI_FLOAT64, timeStep) REGISTER_PARAMETER_MACRO("usd::timeVarying", ANARI_INT32, timeVarying) REGISTER_PARAMETER_MACRO("usd::time.sampler.color", ANARI_FLOAT64, colorSamplerTimeStep) REGISTER_PARAMETER_MACRO("usd::time.sampler.baseColor", ANARI_FLOAT64, colorSamplerTimeStep) REGISTER_PARAMETER_MACRO("usd::time.sampler.opacity", ANARI_FLOAT64, opacitySamplerTimeStep) REGISTER_PARAMETER_MACRO("usd::time.sampler.emissive", ANARI_FLOAT64, emissiveSamplerTimeStep) REGISTER_PARAMETER_MACRO("usd::time.sampler.emissiveIntensity", ANARI_FLOAT64, emissiveIntensitySamplerTimeStep) REGISTER_PARAMETER_MACRO("usd::time.sampler.roughness", ANARI_FLOAT64, roughnessSamplerTimeStep) REGISTER_PARAMETER_MACRO("usd::time.sampler.metallic", ANARI_FLOAT64, metallicSamplerTimeStep) REGISTER_PARAMETER_MACRO("usd::time.sampler.ior", ANARI_FLOAT64, iorSamplerTimeStep) REGISTER_PARAMETER_MATERIAL_MULTITYPE_MACRO("color", ANARI_FLOAT32_VEC3, color) REGISTER_PARAMETER_MATERIAL_MULTITYPE_MACRO("baseColor", ANARI_FLOAT32_VEC3, color) REGISTER_PARAMETER_MATERIAL_MULTITYPE_MACRO("opacity", ANARI_FLOAT32, opacity) REGISTER_PARAMETER_MACRO("alphaMode", ANARI_STRING, alphaMode) REGISTER_PARAMETER_MACRO("alphaCutoff", ANARI_FLOAT32, alphaCutoff) REGISTER_PARAMETER_MATERIAL_MULTITYPE_MACRO("emissive", ANARI_FLOAT32_VEC3, emissiveColor) REGISTER_PARAMETER_MATERIAL_MULTITYPE_MACRO("emissiveIntensity", ANARI_FLOAT32, emissiveIntensity) REGISTER_PARAMETER_MATERIAL_MULTITYPE_MACRO("roughness", ANARI_FLOAT32, roughness) REGISTER_PARAMETER_MATERIAL_MULTITYPE_MACRO("metallic", ANARI_FLOAT32, metallic) REGISTER_PARAMETER_MATERIAL_MULTITYPE_MACRO("ior", ANARI_FLOAT32, ior) ) constexpr UsdMaterial::ComponentPair UsdMaterial::componentParamNames[]; // Workaround for C++14's lack of inlining constexpr arrays using DMI = UsdMaterial::MaterialDMI; UsdMaterial::UsdMaterial(const char* name, const char* type, UsdDevice* device) : BridgedBaseObjectType(ANARI_MATERIAL, name, device) { if (strEquals(type, "matte")) { isPbr = false; } else if (strEquals(type, "physicallyBased")) { isPbr = true; } else { device->reportStatus(this, ANARI_MATERIAL, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdMaterial '%s' intialization error: unknown material type", getName()); } } UsdMaterial::~UsdMaterial() { #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME if(cachedBridge) cachedBridge->DeleteMaterial(usdHandle); #endif } void UsdMaterial::remove(UsdDevice* device) { applyRemoveFunc(device, &UsdBridge::DeleteMaterial); } template<typename ValueType> bool UsdMaterial::getMaterialInputSourceName(const UsdMaterialMultiTypeParameter<ValueType>& param, MaterialDMI dataMemberId, UsdDevice* device, const UsdLogInfo& logInfo) { bool hasPositionAttrib = false; UsdSharedString* anariAttribStr = nullptr; param.Get(anariAttribStr); const char* anariAttrib = UsdSharedString::c_str(anariAttribStr); if(anariAttrib) { hasPositionAttrib = strEquals(anariAttrib, "objectPosition"); if( hasPositionAttrib && instanceAttributeAttached) { // In case of a per-instance specific attribute name, there can be only one change of the attribute name. // Otherwise there is a risk of the material attribute being used for two differently named attributes. reportStatusThroughDevice(logInfo, ANARI_SEVERITY_WARNING, ANARI_STATUS_INVALID_ARGUMENT, "UsdMaterial '%s' binds one of its parameters to %s, but is transitively bound to both an instanced geometry (cones, spheres, cylinders) and regular geometry. \ This is incompatible with USD, which demands a differently bound name for those categories. \ Please create two different samplers and bind each to only one of both categories of geometry. \ The parameter value will be updated, but may therefore invalidate previous bindings to the objectPosition attribute.", logInfo.sourceName, "'objectPosition'"); } const char* usdAttribName = AnariAttributeToUsdName(anariAttrib, perInstance, logInfo); materialInputAttributes.push_back(UsdBridge::MaterialInputAttribName(dataMemberId, usdAttribName)); } return hasPositionAttrib; } template<typename ValueType> bool UsdMaterial::getSamplerRefData(const UsdMaterialMultiTypeParameter<ValueType>& param, double refTimeStep, MaterialDMI dataMemberId, UsdDevice* device, const UsdLogInfo& logInfo) { UsdSampler* sampler = nullptr; param.Get(sampler); if(sampler) { const UsdSamplerData& samplerParamData = sampler->getReadParams(); double worldTimeStep = device->getReadParams().timeStep; double samplerObjTimeStep = samplerParamData.timeStep; double samplerRefTime = selectRefTime(refTimeStep, samplerObjTimeStep, worldTimeStep); // Reading child (sampler) data in the material has the consequence that the sampler's parameters as they were last committed are in effect "part of" the material parameter set, at this point of commit. // So in case a sampler at a particular timestep is referenced from a material at two different world timesteps // - ie. for this world timestep, a particular timestep of an image already committed and subsequently referenced at some other previous world timestep is reused - // the user needs to make sure that not only the timestep is set correctly on the sampler for the commit (which is by itself lightweight, as it does not trigger a full commit), // but also that the parameters read here have been re-set on the sampler to the values belonging to the referenced timestep, as if there is no USD representation of a sampler object. // Setting those parameters will in turn trigger a full commit of the sampler object, which is in theory inefficient. // However, in case of a sampler this is not a problem in practice; data transfer is only a concern when the filename is *not* set, at which point a relative file corresponding // to the sampler timestep will be automatically chosen and set for the material, without the sampler object requiring any updates. // In case a filename *is* set, only the filename is used and no data transfer/file io operations are performed. //const char* imageUrl = UsdSharedString::c_str(samplerParamData.imageUrl); // not required anymore since all materials are a graph int imageNumComponents = 4; if(samplerParamData.imageData) { imageNumComponents = static_cast<int>(anari::componentsOf(samplerParamData.imageData->getType())); } UsdSamplerRefData samplerRefData = {imageNumComponents, samplerRefTime, dataMemberId}; samplerHandles.push_back(sampler->getUsdHandle()); samplerRefDatas.push_back(samplerRefData); } return false; } template<typename ValueType> void UsdMaterial::assignParameterToMaterialInput(const UsdMaterialMultiTypeParameter<ValueType>& param, UsdBridgeMaterialData::MaterialInput<ValueType>& matInput, const UsdLogInfo& logInfo) { param.Get(matInput.Value); UsdSharedString* anariAttribStr = nullptr; matInput.SrcAttrib = param.Get(anariAttribStr) ? AnariAttributeToUsdName(anariAttribStr->c_str(), perInstance, logInfo) : nullptr; UsdSampler* sampler = nullptr; matInput.Sampler = param.Get(sampler); } void UsdMaterial::updateBoundParameters(bool boundToInstance, UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); const UsdMaterialData& paramData = getReadParams(); if(perInstance != boundToInstance) { UsdLogInfo logInfo = {device, this, ANARI_MATERIAL, getName()}; double worldTimeStep = device->getReadParams().timeStep; double dataTimeStep = selectObjTime(paramData.timeStep, worldTimeStep); // Fix up any parameters that have a geometry-type-dependent name set as source attribute materialInputAttributes.clear(); bool hasPositionAttrib = getMaterialInputSourceName(paramData.color, DMI::DIFFUSE, device, logInfo) || getMaterialInputSourceName(paramData.opacity, DMI::OPACITY, device, logInfo) || getMaterialInputSourceName(paramData.emissiveColor, DMI::EMISSIVECOLOR, device, logInfo) || getMaterialInputSourceName(paramData.emissiveIntensity, DMI::EMISSIVEINTENSITY, device, logInfo) || getMaterialInputSourceName(paramData.roughness, DMI::ROUGHNESS, device, logInfo) || getMaterialInputSourceName(paramData.metallic, DMI::METALLIC, device, logInfo) || getMaterialInputSourceName(paramData.ior, DMI::IOR, device, logInfo); DMI timeVarying; setMaterialTimeVarying(timeVarying); // Fixup attribute name and type depending on the newly bound geometry if(materialInputAttributes.size()) usdBridge->ChangeMaterialInputAttributes(usdHandle, materialInputAttributes.data(), materialInputAttributes.size(), dataTimeStep, timeVarying); if(hasPositionAttrib) instanceAttributeAttached = true; // As soon as any parameter is set to a position attribute, the geometry type for this material is 'locked-in' perInstance = boundToInstance; } if(paramData.color.type == SamplerType) { UsdSampler* colorSampler = nullptr; if (paramData.color.Get(colorSampler)) { colorSampler->updateBoundParameters(boundToInstance, device); } } } bool UsdMaterial::deferCommit(UsdDevice* device) { //const UsdMaterialData& paramData = getReadParams(); //if(UsdObjectNotInitialized<SamplerUsdType>(paramData.color.type == SamplerType)) //{ // return true; //} return false; } bool UsdMaterial::doCommitData(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); if(!device->getReadParams().outputMaterial) return false; bool isNew = false; if (!usdHandle.value) isNew = usdBridge->CreateMaterial(getName(), usdHandle); if (paramChanged || isNew) { const UsdMaterialData& paramData = getReadParams(); double worldTimeStep = device->getReadParams().timeStep; double dataTimeStep = selectObjTime(paramData.timeStep, worldTimeStep); UsdBridgeMaterialData matData; matData.IsPbr = isPbr; matData.AlphaMode = AnariToUsdAlphaMode(UsdSharedString::c_str(paramData.alphaMode)); matData.AlphaCutoff = paramData.alphaCutoff; UsdLogInfo logInfo = {device, this, ANARI_MATERIAL, getName()}; assignParameterToMaterialInput(paramData.color, matData.Diffuse, logInfo); assignParameterToMaterialInput(paramData.opacity, matData.Opacity, logInfo); assignParameterToMaterialInput(paramData.emissiveColor, matData.Emissive, logInfo); assignParameterToMaterialInput(paramData.emissiveIntensity, matData.EmissiveIntensity, logInfo); assignParameterToMaterialInput(paramData.roughness, matData.Roughness, logInfo); assignParameterToMaterialInput(paramData.metallic, matData.Metallic, logInfo); assignParameterToMaterialInput(paramData.ior, matData.Ior, logInfo); setMaterialTimeVarying(matData.TimeVarying); usdBridge->SetMaterialData(usdHandle, matData, dataTimeStep); paramChanged = false; return paramData.color.type == SamplerType; // Only commit refs when material actually contains a texture (filename param from diffusemap is required) } return false; } void UsdMaterial::doCommitRefs(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); const UsdMaterialData& paramData = getReadParams(); double worldTimeStep = device->getReadParams().timeStep; samplerHandles.clear(); samplerRefDatas.clear(); UsdLogInfo logInfo = {device, this, ANARI_MATERIAL, getName()}; getSamplerRefData(paramData.color, paramData.colorSamplerTimeStep, DMI::DIFFUSE, device, logInfo); getSamplerRefData(paramData.opacity, paramData.opacitySamplerTimeStep, DMI::OPACITY, device, logInfo); getSamplerRefData(paramData.emissiveColor, paramData.emissiveSamplerTimeStep, DMI::EMISSIVECOLOR, device, logInfo); getSamplerRefData(paramData.emissiveIntensity, paramData.emissiveIntensitySamplerTimeStep, DMI::EMISSIVEINTENSITY, device, logInfo); getSamplerRefData(paramData.roughness, paramData.roughnessSamplerTimeStep, DMI::ROUGHNESS, device, logInfo); getSamplerRefData(paramData.metallic, paramData.metallicSamplerTimeStep, DMI::METALLIC, device, logInfo); getSamplerRefData(paramData.ior, paramData.iorSamplerTimeStep, DMI::IOR, device, logInfo); if(samplerHandles.size()) usdBridge->SetSamplerRefs(usdHandle, samplerHandles.data(), samplerHandles.size(), worldTimeStep, samplerRefDatas.data()); else usdBridge->DeleteSamplerRefs(usdHandle, worldTimeStep); } void UsdMaterial::setMaterialTimeVarying(UsdBridgeMaterialData::DataMemberId& timeVarying) { timeVarying = DMI::ALL & (isTimeVarying(CType::COLOR) ? DMI::ALL : ~DMI::DIFFUSE) & (isTimeVarying(CType::OPACITY) ? DMI::ALL : ~DMI::OPACITY) & (isTimeVarying(CType::EMISSIVE) ? DMI::ALL : ~DMI::EMISSIVECOLOR) & (isTimeVarying(CType::EMISSIVEFACTOR) ? DMI::ALL : ~DMI::EMISSIVEINTENSITY) & (isTimeVarying(CType::ROUGHNESS) ? DMI::ALL : ~DMI::ROUGHNESS) & (isTimeVarying(CType::METALLIC) ? DMI::ALL : ~DMI::METALLIC) & (isTimeVarying(CType::IOR) ? DMI::ALL : ~DMI::IOR); }
NVIDIA-Omniverse/AnariUsdDevice/UsdWorld.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridgedBaseObject.h" class UsdDataArray; enum class UsdWorldComponents { INSTANCES = 0, SURFACES, VOLUMES }; struct UsdWorldData { UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; int timeVarying = 0xFFFFFFFF; // Bitmask indicating which attributes are time-varying. UsdDataArray* instances = nullptr; UsdDataArray* surfaces = nullptr; UsdDataArray* volumes = nullptr; }; class UsdWorld : public UsdBridgedBaseObject<UsdWorld, UsdWorldData, UsdWorldHandle, UsdWorldComponents> { public: UsdWorld(const char* name, UsdDevice* device); ~UsdWorld(); void remove(UsdDevice* device) override; static constexpr ComponentPair componentParamNames[] = { ComponentPair(UsdWorldComponents::INSTANCES, "instance"), ComponentPair(UsdWorldComponents::SURFACES, "surface"), ComponentPair(UsdWorldComponents::VOLUMES, "volume")}; protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override; std::vector<UsdInstanceHandle> instanceHandles; // for convenience std::vector<UsdSurfaceHandle> surfaceHandles; // for convenience std::vector<UsdVolumeHandle> volumeHandles; // for convenience };
NVIDIA-Omniverse/AnariUsdDevice/UsdLight.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridgedBaseObject.h" struct UsdLightData { UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; }; class UsdLight : public UsdBridgedBaseObject<UsdLight, UsdLightData, UsdLightHandle> { public: UsdLight(const char* name, UsdDevice* device); ~UsdLight(); void remove(UsdDevice* device) override; protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override {} };
NVIDIA-Omniverse/AnariUsdDevice/UsdFrame.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdFrame.h" #include "UsdBridge/UsdBridge.h" #include "UsdAnari.h" #include "UsdDevice.h" #include "anari/frontend/type_utility.h" DEFINE_PARAMETER_MAP(UsdFrame, REGISTER_PARAMETER_MACRO("world", ANARI_WORLD, world) REGISTER_PARAMETER_MACRO("renderer", ANARI_RENDERER, renderer) REGISTER_PARAMETER_MACRO("size", ANARI_UINT32_VEC2, size) REGISTER_PARAMETER_MACRO("channel.color", ANARI_DATA_TYPE, color) REGISTER_PARAMETER_MACRO("channel.depth", ANARI_DATA_TYPE, depth) ) UsdFrame::UsdFrame(UsdBridge* bridge) : UsdParameterizedBaseObject<UsdFrame, UsdFrameData>(ANARI_FRAME) { } UsdFrame::~UsdFrame() { delete[] mappedColorMem; delete[] mappedDepthMem; } bool UsdFrame::deferCommit(UsdDevice* device) { return false; } bool UsdFrame::doCommitData(UsdDevice* device) { return false; } const void* UsdFrame::mapBuffer(const char *channel, uint32_t *width, uint32_t *height, ANARIDataType *pixelType) { const UsdFrameData& paramData = getReadParams(); *width = paramData.size.Data[0]; *height = paramData.size.Data[1]; *pixelType = ANARI_UNKNOWN; if (strEquals(channel, "channel.color")) { mappedColorMem = ReserveBuffer(paramData.color); *pixelType = paramData.color; return mappedColorMem; } else if (strEquals(channel, "channel.depth")) { mappedDepthMem = ReserveBuffer(paramData.depth); *pixelType = paramData.depth; return mappedDepthMem; } *width = 0; *height = 0; return nullptr; } void UsdFrame::unmapBuffer(const char *channel) { if (strEquals(channel, "channel.color")) { delete[] mappedColorMem; mappedColorMem = nullptr; } else if (strEquals(channel, "channel.depth")) { delete[] mappedDepthMem; mappedDepthMem = nullptr; } } char* UsdFrame::ReserveBuffer(ANARIDataType format) { const UsdFrameData& paramData = getReadParams(); size_t formatSize = anari::sizeOf(format); size_t memSize = formatSize * paramData.size.Data[0] * paramData.size.Data[1]; return new char[memSize]; } void UsdFrame::saveUsd(UsdDevice* device) { device->getUsdBridge()->SaveScene(); }
NVIDIA-Omniverse/AnariUsdDevice/UsdSampler.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridgedBaseObject.h" enum class UsdSamplerComponents { DATA = 0, WRAPS, WRAPT, WRAPR }; struct UsdSamplerData { UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; double timeStep = 0.0; int timeVarying = 0; // Bitmask indicating which attributes are time-varying. const UsdDataArray* imageData = nullptr; UsdSharedString* inAttribute = nullptr; UsdSharedString* imageUrl = nullptr; UsdSharedString* wrapS = nullptr; UsdSharedString* wrapT = nullptr; UsdSharedString* wrapR = nullptr; }; class UsdSampler : public UsdBridgedBaseObject<UsdSampler, UsdSamplerData, UsdSamplerHandle, UsdSamplerComponents> { protected: enum SamplerType { SAMPLER_UNKNOWN = 0, SAMPLER_1D, SAMPLER_2D, SAMPLER_3D }; public: UsdSampler(const char* name, const char* type, UsdDevice* device); ~UsdSampler(); void remove(UsdDevice* device) override; bool isPerInstance() const { return perInstance; } void updateBoundParameters(bool boundToInstance, UsdDevice* device); static constexpr ComponentPair componentParamNames[] = { ComponentPair(CType::DATA, "image"), ComponentPair(CType::DATA, "imageUrl"), ComponentPair(CType::WRAPS, "wrapMode"), ComponentPair(CType::WRAPS, "wrapMode1"), ComponentPair(CType::WRAPT, "wrapMode2"), ComponentPair(CType::WRAPR, "wrapMode3")}; protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override {} void setSamplerTimeVarying(UsdBridgeSamplerData::DataMemberId& timeVarying); SamplerType samplerType = SAMPLER_UNKNOWN; bool perInstance = false; // Whether sampler is attached to a point instancer bool instanceAttributeAttached = false; // Whether a value to inAttribute has been set which in USD is different between per-instance and regular geometries };
NVIDIA-Omniverse/AnariUsdDevice/UsdInstance.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridgedBaseObject.h" class UsdGroup; enum class UsdInstanceComponents { GROUP = 0, TRANSFORM }; struct UsdInstanceData { UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; int timeVarying = 0xFFFFFFFF; // Bitmask indicating which attributes are time-varying. UsdGroup* group = nullptr; UsdFloatMat4 transform; }; class UsdInstance : public UsdBridgedBaseObject<UsdInstance, UsdInstanceData, UsdInstanceHandle, UsdInstanceComponents> { public: UsdInstance(const char* name, UsdDevice* device); ~UsdInstance(); void remove(UsdDevice* device) override; static constexpr ComponentPair componentParamNames[] = { ComponentPair(UsdInstanceComponents::GROUP, "group"), ComponentPair(UsdInstanceComponents::TRANSFORM, "transform")}; protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override; };
NVIDIA-Omniverse/AnariUsdDevice/UsdDataArray.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBaseObject.h" #include "UsdParameterizedObject.h" #include "anari/frontend/anari_enums.h" class UsdDevice; struct UsdDataLayout { bool isDense() const { return byteStride1 == typeSize && byteStride2 == numItems1*byteStride1 && byteStride3 == numItems2*byteStride2; } bool isOneDimensional() const { return numItems2 == 1 && numItems3 == 1; } void copyDims(uint64_t dims[3]) const { std::memcpy(dims, &numItems1, sizeof(uint64_t)*3); } void copyStride(int64_t stride[3]) const { std::memcpy(stride, &byteStride1, sizeof(int64_t)*3); } uint64_t typeSize = 0; uint64_t numItems1 = 0; uint64_t numItems2 = 0; uint64_t numItems3 = 0; int64_t byteStride1 = 0; int64_t byteStride2 = 0; int64_t byteStride3 = 0; }; struct UsdDataArrayParams { // Even though we are not dealing with a usd-backed object, the data array can still have an identifying name. // The pointer can then be used as id for resources (plus defining their filenames) such as textures, // so they can be shared and still removed during garbage collection (after an UsdAnari object has already been destroyed). // The persistence reason is why these strings have to be added to the string list of the device on construction. UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; }; class UsdDataArray : public UsdParameterizedBaseObject<UsdDataArray, UsdDataArrayParams> { public: UsdDataArray(const void *appMemory, ANARIMemoryDeleter deleter, const void *userData, ANARIDataType dataType, uint64_t numItems1, int64_t byteStride1, uint64_t numItems2, int64_t byteStride2, uint64_t numItems3, int64_t byteStride3, UsdDevice* device ); UsdDataArray(ANARIDataType dataType, uint64_t numItems1, uint64_t numItems2, uint64_t numItems3, UsdDevice* device ); ~UsdDataArray(); void filterSetParam(const char *name, ANARIDataType type, const void *mem, UsdDevice* device) override; int getProperty(const char *name, ANARIDataType type, void *mem, uint64_t size, UsdDevice* device) override; void commit(UsdDevice* device) override; void remove(UsdDevice* device) override {} void* map(UsdDevice* device); void unmap(UsdDevice* device); void privatize(); const char* getName() const override { return UsdSharedString::c_str(getReadParams().usdName); } const void* getData() const { return data; } ANARIDataType getType() const { return type; } const UsdDataLayout& getLayout() const { return layout; } size_t getDataSizeInBytes() const { return dataSizeInBytes; } protected: bool deferCommit(UsdDevice* device) override { return false; } bool doCommitData(UsdDevice* device) override { return false; } void doCommitRefs(UsdDevice* device) override {} void setLayoutAndSize(uint64_t numItems1, int64_t byteStride1, uint64_t numItems2, int64_t byteStride2, uint64_t numItems3, int64_t byteStride3); bool CheckFormatting(UsdDevice* device); // Ref manipulation on arrays of anariobjects void incRef(const ANARIObject* anariObjects, uint64_t numAnariObjects); void decRef(const ANARIObject* anariObjects, uint64_t numAnariObjects); // Private memory management void allocPrivateData(); void freePrivateData(bool mappedCopy = false); void freePublicData(const void* appMemory); void publicToPrivateData(); // Mapped memory management void CreateMappedObjectCopy(); void TransferAndRemoveMappedObjectCopy(); const void* data = nullptr; ANARIMemoryDeleter dataDeleter = nullptr; const void* deleterUserData = nullptr; ANARIDataType type; UsdDataLayout layout; size_t dataSizeInBytes; bool isPrivate; const void* mappedObjectCopy; #ifdef CHECK_MEMLEAKS UsdDevice* allocDevice; #endif };
NVIDIA-Omniverse/AnariUsdDevice/UsdDeviceQueries.h
// Copyright 2021 The Khronos Group // SPDX-License-Identifier: Apache-2.0 // This file was generated by generate_queries.py // Don't make changes to this directly #include <anari/anari.h> namespace anari { namespace usd { #define ANARI_INFO_required 0 #define ANARI_INFO_default 1 #define ANARI_INFO_minimum 2 #define ANARI_INFO_maximum 3 #define ANARI_INFO_description 4 #define ANARI_INFO_elementType 5 #define ANARI_INFO_value 6 #define ANARI_INFO_sourceExtension 7 #define ANARI_INFO_extension 8 #define ANARI_INFO_parameter 9 #define ANARI_INFO_channel 10 #define ANARI_INFO_use 11 const int extension_count = 17; const char ** query_extensions(); const char ** query_object_types(ANARIDataType type); const ANARIParameter * query_params(ANARIDataType type, const char *subtype); const void * query_param_info_enum(ANARIDataType type, const char *subtype, const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType); const void * query_param_info(ANARIDataType type, const char *subtype, const char *paramName, ANARIDataType paramType, const char *infoNameString, ANARIDataType infoType); const void * query_object_info_enum(ANARIDataType type, const char *subtype, int infoName, ANARIDataType infoType); const void * query_object_info(ANARIDataType type, const char *subtype, const char *infoNameString, ANARIDataType infoType); } }
NVIDIA-Omniverse/AnariUsdDevice/UsdDevice.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "anari/backend/DeviceImpl.h" #include "anari/backend/LibraryImpl.h" #include "UsdBaseObject.h" #include <vector> #include <memory> #ifdef _WIN32 #ifdef anari_library_usd_EXPORTS #define USDDevice_INTERFACE __declspec(dllexport) #else #define USDDevice_INTERFACE __declspec(dllimport) #endif #endif extern "C" { #ifdef WIN32 USDDevice_INTERFACE void __cdecl anari_library_usd_init(); #else void anari_library_usd_init(); #endif } class UsdDevice; class UsdDeviceInternals; class UsdBaseObject; class UsdVolume; struct UsdDeviceData { UsdSharedString* hostName = nullptr; UsdSharedString* outputPath = nullptr; bool createNewSession = true; bool outputBinary = false; bool writeAtCommit = false; double timeStep = 0.0; bool outputMaterial = true; bool outputPreviewSurfaceShader = true; bool outputMdlShader = true; }; class UsdDevice : public anari::DeviceImpl, public UsdParameterizedBaseObject<UsdDevice, UsdDeviceData> { public: UsdDevice(); UsdDevice(ANARILibrary library); ~UsdDevice(); /////////////////////////////////////////////////////////////////////////// // Main virtual interface to accepting API calls /////////////////////////////////////////////////////////////////////////// // Data Arrays //////////////////////////////////////////////////////////// ANARIArray1D newArray1D(const void *appMemory, ANARIMemoryDeleter deleter, const void *userdata, ANARIDataType, uint64_t numItems1) override; ANARIArray2D newArray2D(const void *appMemory, ANARIMemoryDeleter deleter, const void *userdata, ANARIDataType, uint64_t numItems1, uint64_t numItems2) override; ANARIArray3D newArray3D(const void *appMemory, ANARIMemoryDeleter deleter, const void *userdata, ANARIDataType, uint64_t numItems1, uint64_t numItems2, uint64_t numItems3) override; void* mapArray(ANARIArray) override; void unmapArray(ANARIArray) override; // Renderable Objects ///////////////////////////////////////////////////// ANARILight newLight(const char *type) override { return nullptr; } ANARICamera newCamera(const char *type) override; ANARIGeometry newGeometry(const char *type); ANARISpatialField newSpatialField(const char *type) override; ANARISurface newSurface() override; ANARIVolume newVolume(const char *type) override; // Model Meta-Data //////////////////////////////////////////////////////// ANARIMaterial newMaterial(const char *material_type) override; ANARISampler newSampler(const char *type) override; // Instancing ///////////////////////////////////////////////////////////// ANARIGroup newGroup() override; ANARIInstance newInstance(const char *type) override; // Top-level Worlds /////////////////////////////////////////////////////// ANARIWorld newWorld() override; // Query functions //////////////////////////////////////////////////////// const char ** getObjectSubtypes(ANARIDataType objectType) override; const void* getObjectInfo(ANARIDataType objectType, const char* objectSubtype, const char* infoName, ANARIDataType infoType) override; const void* getParameterInfo(ANARIDataType objectType, const char* objectSubtype, const char* parameterName, ANARIDataType parameterType, const char* infoName, ANARIDataType infoType) override; // Object + Parameter Lifetime Management ///////////////////////////////// void setParameter(ANARIObject object, const char *name, ANARIDataType type, const void *mem) override; void unsetParameter(ANARIObject object, const char *name) override; void unsetAllParameters(ANARIObject o) override; void* mapParameterArray1D(ANARIObject o, const char* name, ANARIDataType dataType, uint64_t numElements1, uint64_t *elementStride) override; void* mapParameterArray2D(ANARIObject o, const char* name, ANARIDataType dataType, uint64_t numElements1, uint64_t numElements2, uint64_t *elementStride) override; void* mapParameterArray3D(ANARIObject o, const char* name, ANARIDataType dataType, uint64_t numElements1, uint64_t numElements2, uint64_t numElements3, uint64_t *elementStride) override; void unmapParameterArray(ANARIObject o, const char* name) override; void commitParameters(ANARIObject object) override; void release(ANARIObject _obj) override; void retain(ANARIObject _obj) override; // Object Query Interface ///////////////////////////////////////////////// int getProperty(ANARIObject object, const char *name, ANARIDataType type, void *mem, uint64_t size, uint32_t mask) override; // FrameBuffer Manipulation /////////////////////////////////////////////// ANARIFrame newFrame() override; const void *frameBufferMap(ANARIFrame fb, const char *channel, uint32_t *width, uint32_t *height, ANARIDataType *pixelType) override; void frameBufferUnmap(ANARIFrame fb, const char *channel) override; // Frame Rendering //////////////////////////////////////////////////////// ANARIRenderer newRenderer(const char *type) override; void renderFrame(ANARIFrame frame) override; int frameReady(ANARIFrame, ANARIWaitMask) override { return 1; } void discardFrame(ANARIFrame) override {} // UsdParameterizedBaseObject interface /////////////////////////////////////////////////////////// void filterSetParam( const char *name, ANARIDataType type, const void *mem, UsdDevice* device) override; void filterResetParam( const char *name) override; void commit(UsdDevice* device) override; void remove(UsdDevice* device) override {} // USD Specific /////////////////////////////////////////////////////////// bool isInitialized() { return getUsdBridge() != nullptr; } UsdBridge* getUsdBridge(); bool nameExists(const char* name); void addToCommitList(UsdBaseObject* object, bool commitData); bool isFlushingCommitList() const { return lockCommitList; } void addToVolumeList(UsdVolume* volume); void removeFromVolumeList(UsdVolume* volume); // Allows for selected strings to persist, // so their pointers can be cached beyond their containing objects' lifetimes, // to be used for garbage collecting resource files. void addToResourceStringList(UsdSharedString* sharedString); #ifdef CHECK_MEMLEAKS // Memleak checking void LogObjAllocation(const UsdBaseObject* ptr); void LogObjDeallocation(const UsdBaseObject* ptr); std::vector<const UsdBaseObject*> allocatedObjects; void LogStrAllocation(const UsdSharedString* ptr); void LogStrDeallocation(const UsdSharedString* ptr); std::vector<const UsdSharedString*> allocatedStrings; void LogRawAllocation(const void* ptr); void LogRawDeallocation(const void* ptr); std::vector<const void*> allocatedRawMemory; #endif void reportStatus(void* source, ANARIDataType sourceType, ANARIStatusSeverity severity, ANARIStatusCode statusCode, const char *format, ...); void reportStatus(void* source, ANARIDataType sourceType, ANARIStatusSeverity severity, ANARIStatusCode statusCode, const char *format, va_list& arglist); protected: UsdBaseObject* getBaseObjectPtr(ANARIObject object); // UsdParameterizedBaseObject interface /////////////////////////////////////////////////////////// bool deferCommit(UsdDevice* device) { return false; }; bool doCommitData(UsdDevice* device) { return false; }; void doCommitRefs(UsdDevice* device) {}; // USD Specific Cleanup ///////////////////////////////////////////////////////////// void clearCommitList(); void flushCommitList(); void clearDeviceParameters(); void clearResourceStringList(); void initializeBridge(); const char* makeUniqueName(const char* name); ANARIArray CreateDataArray(const void *appMemory, ANARIMemoryDeleter deleter, const void *userData, ANARIDataType dataType, uint64_t numItems1, int64_t byteStride1, uint64_t numItems2, int64_t byteStride2, uint64_t numItems3, int64_t byteStride3); template<int typeInt> void writeTypeToUsd(); void removePrimsFromUsd(bool onlyRemoveHandles = false); std::unique_ptr<UsdDeviceInternals> internals; bool bridgeInitAttempt = false; // Using object pointers as basis for deferred commits; another option would be to traverse // the bridge's internal cache handles, but a handle may map to multiple objects (with the same name) // so that's not 1-1 with the effects of a non-deferred commit order. using CommitListType = std::pair<helium::IntrusivePtr<UsdBaseObject>, bool>; std::vector<CommitListType> commitList; std::vector<UsdBaseObject*> removeList; std::vector<UsdVolume*> volumeList; // Tracks all volumes to auto-commit when child fields have been committed bool lockCommitList = false; std::vector<helium::IntrusivePtr<UsdSharedString>> resourceStringList; ANARIStatusCallback statusFunc = nullptr; const void* statusUserData = nullptr; ANARIStatusCallback userSetStatusFunc = nullptr; const void* userSetStatusUserData = nullptr; std::vector<char> lastStatusMessage; };
NVIDIA-Omniverse/AnariUsdDevice/UsdCamera.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBaseObject.h" #include "UsdBridgedBaseObject.h" enum class UsdCameraComponents { VIEW = 0, PROJECTION }; struct UsdCameraData { UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; int timeVarying = 0xFFFFFFFF; // TimeVarying bits UsdFloat3 position = {0.0f, 0.0f, 0.0f}; UsdFloat3 direction = {0.0f, 0.0f, -1.0f}; UsdFloat3 up = {0.0f, 1.0f, 0.0f}; UsdFloatBox2 imageRegion = {0.0f, 0.0f, 1.0f, 1.0f}; // perspective/orthographic float aspect = 1.0f; float near = 1.0f; float far = 10000; float fovy = M_PI/3.0f; float height = 1.0f; }; class UsdCamera : public UsdBridgedBaseObject<UsdCamera, UsdCameraData, UsdCameraHandle, UsdCameraComponents> { public: UsdCamera(const char* name, const char* type, UsdDevice* device); ~UsdCamera(); void remove(UsdDevice* device) override; enum CameraType { CAMERA_UNKNOWN = 0, CAMERA_PERSPECTIVE, CAMERA_ORTHOGRAPHIC }; static constexpr ComponentPair componentParamNames[] = { ComponentPair(UsdCameraComponents::VIEW, "view"), ComponentPair(UsdCameraComponents::PROJECTION, "projection")}; protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override {} void copyParameters(UsdBridgeCameraData& camData); CameraType cameraType = CAMERA_UNKNOWN; };
NVIDIA-Omniverse/AnariUsdDevice/UsdDeviceUtils.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include <vector> #include <memory> template<typename ValueType, typename ContainerType = std::vector<ValueType>> struct OptionalList { void ensureList() { if(!list) list = std::make_unique<ContainerType>(); } void clear() { if(list) list->resize(0); } void push_back(const ValueType& value) { ensureList(); list->push_back(value); } void emplace_back(const ValueType& value) { ensureList(); list->emplace_back(value); } const ValueType* data() { if(list) return list->data(); return nullptr; } size_t size() { if(list) return list->size(); return 0; } std::unique_ptr<ContainerType> list; };
NVIDIA-Omniverse/AnariUsdDevice/UsdSurface.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridgedBaseObject.h" #include <limits> class UsdGeometry; class UsdMaterial; struct UsdSurfaceData { UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; // No timevarying data: geometry and material reference always set over all timesteps UsdGeometry* geometry = nullptr; UsdMaterial* material = nullptr; double geometryRefTimeStep = std::numeric_limits<float>::quiet_NaN(); double materialRefTimeStep = std::numeric_limits<float>::quiet_NaN(); }; class UsdSurface : public UsdBridgedBaseObject<UsdSurface, UsdSurfaceData, UsdSurfaceHandle> { public: UsdSurface(const char* name, UsdDevice* device); ~UsdSurface(); void remove(UsdDevice* device) override; protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override; };
NVIDIA-Omniverse/AnariUsdDevice/UsdVolume.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridgedBaseObject.h" #include <limits> class UsdSpatialField; class UsdDevice; class UsdDataArray; enum class UsdVolumeComponents { COLOR = 0, OPACITY, VALUERANGE }; struct UsdVolumeData { UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; int timeVarying = 0xFFFFFFFF; // Bitmask indicating which attributes are time-varying. (field reference always set over all timesteps) UsdSpatialField* field = nullptr; double fieldRefTimeStep = std::numeric_limits<float>::quiet_NaN(); bool preClassified = false; //TF params const UsdDataArray* color = nullptr; const UsdDataArray* opacity = nullptr; UsdFloatBox1 valueRange = { 0.0f, 1.0f }; float unitDistance = 1.0f; }; class UsdVolume : public UsdBridgedBaseObject<UsdVolume, UsdVolumeData, UsdVolumeHandle, UsdVolumeComponents> { public: UsdVolume(const char* name, UsdDevice* device); ~UsdVolume(); void remove(UsdDevice* device) override; static constexpr ComponentPair componentParamNames[] = { ComponentPair(UsdVolumeComponents::COLOR, "color"), ComponentPair(UsdVolumeComponents::OPACITY, "opacity"), ComponentPair(UsdVolumeComponents::VALUERANGE, "valueRange")}; protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override {} bool CheckTfParams(UsdDevice* device); bool UpdateVolume(UsdDevice* device, const char* debugName); UsdSpatialField* prevField = nullptr; UsdDevice* usdDevice = nullptr; };
NVIDIA-Omniverse/AnariUsdDevice/UsdDataArray.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdDataArray.h" #include "UsdDevice.h" #include "UsdAnari.h" #include "anari/frontend/type_utility.h" DEFINE_PARAMETER_MAP(UsdDataArray, REGISTER_PARAMETER_MACRO("name", ANARI_STRING, name) REGISTER_PARAMETER_MACRO("usd::name", ANARI_STRING, usdName) ) #define TO_OBJ_PTR reinterpret_cast<const ANARIObject*> UsdDataArray::UsdDataArray(const void *appMemory, ANARIMemoryDeleter deleter, const void *userData, ANARIDataType dataType, uint64_t numItems1, int64_t byteStride1, uint64_t numItems2, int64_t byteStride2, uint64_t numItems3, int64_t byteStride3, UsdDevice* device ) : UsdParameterizedBaseObject<UsdDataArray, UsdDataArrayParams>(ANARI_ARRAY) , data(appMemory) , dataDeleter(deleter) , deleterUserData(userData) , type(dataType) , isPrivate(false) #ifdef CHECK_MEMLEAKS , allocDevice(device) #endif { setLayoutAndSize(numItems1, byteStride1, numItems2, byteStride2, numItems3, byteStride3); if (CheckFormatting(device)) { // Make sure to incref all anari objects in case of object array if (anari::isObject(type)) { incRef(TO_OBJ_PTR(data), layout.numItems1); } } } UsdDataArray::UsdDataArray(ANARIDataType dataType, uint64_t numItems1, uint64_t numItems2, uint64_t numItems3, UsdDevice* device) : UsdParameterizedBaseObject<UsdDataArray, UsdDataArrayParams>(ANARI_ARRAY) , type(dataType) , isPrivate(true) #ifdef CHECK_MEMLEAKS , allocDevice(device) #endif { setLayoutAndSize(numItems1, 0, numItems2, 0, numItems3, 0); if (CheckFormatting(device)) { allocPrivateData(); } } UsdDataArray::~UsdDataArray() { // Decref anari objects in case of object array if (anari::isObject(type)) { decRef(TO_OBJ_PTR(data), layout.numItems1); } if (isPrivate) { freePrivateData(); } else { freePublicData(data); } } void UsdDataArray::filterSetParam(const char *name, ANARIDataType type, const void *mem, UsdDevice* device) { if(setNameParam(name, type, mem, device)) device->addToResourceStringList(getWriteParams().usdName); //Name is kept for the lifetime of the device (to allow using pointer for caching resource's names) } int UsdDataArray::getProperty(const char * name, ANARIDataType type, void * mem, uint64_t size, UsdDevice* device) { int nameResult = getNameProperty(name, type, mem, size, device); return nameResult; } void UsdDataArray::commit(UsdDevice* device) { if (anari::isObject(type) && (layout.numItems2 != 1 || layout.numItems3 != 1)) device->reportStatus(this, ANARI_ARRAY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdDataArray only supports one-dimensional ANARI_OBJECT arrays"); UsdParameterizedBaseObject<UsdDataArray, UsdDataArrayParams>::commit(device); } void * UsdDataArray::map(UsdDevice * device) { if (anari::isObject(type)) { CreateMappedObjectCopy(); } return const_cast<void *>(data); } void UsdDataArray::unmap(UsdDevice * device) { if (anari::isObject(type)) { TransferAndRemoveMappedObjectCopy(); } } void UsdDataArray::privatize() { if(!isPrivate) { publicToPrivateData(); isPrivate = true; } } void UsdDataArray::setLayoutAndSize(uint64_t numItems1, int64_t byteStride1, uint64_t numItems2, int64_t byteStride2, uint64_t numItems3, int64_t byteStride3) { size_t typeSize = anari::sizeOf(type); if (byteStride1 == 0) byteStride1 = typeSize; if (byteStride2 == 0) byteStride2 = byteStride1 * numItems1; if (byteStride3 == 0) byteStride3 = byteStride2 * numItems2; dataSizeInBytes = byteStride3 * numItems3 - (byteStride1 - typeSize); layout = { typeSize, numItems1, numItems2, numItems3, byteStride1, byteStride2, byteStride3 }; } bool UsdDataArray::CheckFormatting(UsdDevice* device) { if (anari::isObject(type)) { if (!layout.isDense() || !layout.isOneDimensional()) { device->reportStatus(this, ANARI_ARRAY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdDataArray construction failed: arrays with object type have to be one dimensional and without stride."); layout.numItems1 = layout.numItems2 = layout.numItems3 = 0; data = nullptr; type = ANARI_UNKNOWN; return false; } } return true; } void UsdDataArray::incRef(const ANARIObject* anariObjects, uint64_t numAnariObjects) { for (int i = 0; i < numAnariObjects; ++i) { const UsdBaseObject* baseObj = (reinterpret_cast<const UsdBaseObject*>(anariObjects[i])); if (baseObj) baseObj->refInc(helium::RefType::INTERNAL); } } void UsdDataArray::decRef(const ANARIObject* anariObjects, uint64_t numAnariObjects) { for (int i = 0; i < numAnariObjects; ++i) { const UsdBaseObject* baseObj = (reinterpret_cast<const UsdBaseObject*>(anariObjects[i])); #ifdef CHECK_MEMLEAKS allocDevice->LogObjDeallocation(baseObj); #endif if (baseObj) { assert(baseObj->useCount(helium::RefType::INTERNAL) > 0); baseObj->refDec(helium::RefType::INTERNAL); } } } void UsdDataArray::allocPrivateData() { // Alloc the owned memory char* newData = new char[dataSizeInBytes]; memset(newData, 0, dataSizeInBytes); data = newData; #ifdef CHECK_MEMLEAKS allocDevice->LogRawAllocation(newData); #endif } void UsdDataArray::freePrivateData(bool mappedCopy) { const void*& memToFree = mappedCopy ? mappedObjectCopy : data; #ifdef CHECK_MEMLEAKS allocDevice->LogRawDeallocation(memToFree); #endif // Deallocate owned memory delete[](char*)memToFree; memToFree = nullptr; } void UsdDataArray::freePublicData(const void* appMemory) { if (dataDeleter) { dataDeleter(deleterUserData, appMemory); dataDeleter = nullptr; } } void UsdDataArray::publicToPrivateData() { // Alloc private dest, copy appMemory src to it const void* appMemory = data; allocPrivateData(); std::memcpy(const_cast<void *>(data), appMemory, dataSizeInBytes); // In case of object array, Refcount 'transfers' to the copy (splits off user-managed public refcount) // Delete appMemory if appropriate freePublicData(appMemory); // No refcount modification necessary, public refcount managed by user } void UsdDataArray::CreateMappedObjectCopy() { // Move the original array to a different spot and allocate new memory for the mapped object array. mappedObjectCopy = data; allocPrivateData(); // Transfer contents over to new memory, keep old one for managing references later on. std::memcpy(const_cast<void *>(data), mappedObjectCopy, dataSizeInBytes); } void UsdDataArray::TransferAndRemoveMappedObjectCopy() { const ANARIObject* newAnariObjects = TO_OBJ_PTR(data); const ANARIObject* oldAnariObjects = TO_OBJ_PTR(mappedObjectCopy); uint64_t numAnariObjects = layout.numItems1; // First, increase reference counts of all objects that different in the new object array for (int i = 0; i < numAnariObjects; ++i) { const UsdBaseObject* newObj = (reinterpret_cast<const UsdBaseObject*>(newAnariObjects[i])); const UsdBaseObject* oldObj = (reinterpret_cast<const UsdBaseObject*>(oldAnariObjects[i])); if (newObj != oldObj && newObj) newObj->refInc(helium::RefType::INTERNAL); } // Then, decrease reference counts of all objects that are different in the original array (which will delete those that not referenced anymore) for (int i = 0; i < numAnariObjects; ++i) { const UsdBaseObject* newObj = (reinterpret_cast<const UsdBaseObject*>(newAnariObjects[i])); const UsdBaseObject* oldObj = (reinterpret_cast<const UsdBaseObject*>(oldAnariObjects[i])); if (newObj != oldObj && oldObj) { #ifdef CHECK_MEMLEAKS allocDevice->LogObjDeallocation(oldObj); #endif oldObj->refDec(helium::RefType::INTERNAL); } } // Release the mapped object copy's allocated memory freePrivateData(true); }
NVIDIA-Omniverse/AnariUsdDevice/UsdInstance.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdInstance.h" #include "UsdAnari.h" #include "UsdDevice.h" #include "UsdGroup.h" #define GroupType ANARI_GROUP using GroupUsdType = AnariToUsdBridgedObject<GroupType>::Type; DEFINE_PARAMETER_MAP(UsdInstance, REGISTER_PARAMETER_MACRO("name", ANARI_STRING, name) REGISTER_PARAMETER_MACRO("usd::name", ANARI_STRING, usdName) REGISTER_PARAMETER_MACRO("usd::timeVarying", ANARI_INT32, timeVarying) REGISTER_PARAMETER_MACRO("group", GroupType, group) REGISTER_PARAMETER_MACRO("transform", ANARI_FLOAT32_MAT4, transform) ) constexpr UsdInstance::ComponentPair UsdInstance::componentParamNames[]; // Workaround for C++14's lack of inlining constexpr arrays UsdInstance::UsdInstance(const char* name, UsdDevice* device) : BridgedBaseObjectType(ANARI_INSTANCE, name, device) { } UsdInstance::~UsdInstance() { #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME if(cachedBridge) cachedBridge->DeleteInstance(usdHandle); #endif } void UsdInstance::remove(UsdDevice* device) { applyRemoveFunc(device, &UsdBridge::DeleteInstance); } bool UsdInstance::deferCommit(UsdDevice* device) { const UsdInstanceData& paramData = getReadParams(); if(UsdObjectNotInitialized<GroupUsdType>(paramData.group)) { return true; } return false; } bool UsdInstance::doCommitData(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); const char* instanceName = getName(); bool isNew = false; if (!usdHandle.value) isNew = usdBridge->CreateInstance(instanceName, usdHandle); if (paramChanged || isNew) { doCommitRefs(device); // Perform immediate commit of refs - no params from children required paramChanged = false; } return false; } void UsdInstance::doCommitRefs(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); const UsdInstanceData& paramData = getReadParams(); double timeStep = device->getReadParams().timeStep; bool groupTimeVarying = isTimeVarying(UsdInstanceComponents::GROUP); bool transformTimeVarying = isTimeVarying(UsdInstanceComponents::TRANSFORM); if (paramData.group) { usdBridge->SetGroupRef(usdHandle, paramData.group->getUsdHandle(), groupTimeVarying, timeStep); } else { usdBridge->DeleteGroupRef(usdHandle, groupTimeVarying, timeStep); } usdBridge->SetInstanceTransform(usdHandle, paramData.transform.Data, transformTimeVarying, timeStep); }
NVIDIA-Omniverse/AnariUsdDevice/UsdGeometry.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdGeometry.h" #include "UsdAnari.h" #include "UsdDataArray.h" #include "UsdDevice.h" #include "UsdBridgeUtils.h" #include "anari/frontend/type_utility.h" #include <cmath> DEFINE_PARAMETER_MAP(UsdGeometry, REGISTER_PARAMETER_MACRO("name", ANARI_STRING, name) REGISTER_PARAMETER_MACRO("usd::name", ANARI_STRING, usdName) REGISTER_PARAMETER_MACRO("usd::time", ANARI_FLOAT64, timeStep) REGISTER_PARAMETER_MACRO("usd::timeVarying", ANARI_INT32, timeVarying) REGISTER_PARAMETER_MACRO("usd::time.shapeGeometry", ANARI_FLOAT64, shapeGeometryRefTimeStep) REGISTER_PARAMETER_MACRO("usd::useUsdGeomPoints", ANARI_BOOL, UseUsdGeomPoints) REGISTER_PARAMETER_MACRO("primitive.index", ANARI_ARRAY, indices) REGISTER_PARAMETER_MACRO("primitive.normal", ANARI_ARRAY, primitiveNormals) REGISTER_PARAMETER_MACRO("primitive.color", ANARI_ARRAY, primitiveColors) REGISTER_PARAMETER_MACRO("primitive.radius", ANARI_ARRAY, primitiveRadii) REGISTER_PARAMETER_MACRO("primitive.scale", ANARI_ARRAY, primitiveScales) REGISTER_PARAMETER_MACRO("primitive.orientation", ANARI_ARRAY, primitiveOrientations) REGISTER_PARAMETER_ARRAY_MACRO("primitive.attribute", "", ANARI_ARRAY, primitiveAttributes, MAX_ATTRIBS) REGISTER_PARAMETER_MACRO("primitive.id", ANARI_ARRAY, primitiveIds) REGISTER_PARAMETER_MACRO("vertex.position", ANARI_ARRAY, vertexPositions) REGISTER_PARAMETER_MACRO("vertex.normal", ANARI_ARRAY, vertexNormals) REGISTER_PARAMETER_MACRO("vertex.color", ANARI_ARRAY, vertexColors) REGISTER_PARAMETER_MACRO("vertex.radius", ANARI_ARRAY, vertexRadii) REGISTER_PARAMETER_MACRO("vertex.scale", ANARI_ARRAY, vertexScales) REGISTER_PARAMETER_MACRO("vertex.orientation", ANARI_ARRAY, vertexOrientations) REGISTER_PARAMETER_ARRAY_MACRO("vertex.attribute", "", ANARI_ARRAY, vertexAttributes, MAX_ATTRIBS) REGISTER_PARAMETER_ARRAY_MACRO("usd::attribute", ".name", ANARI_STRING, attributeNames, MAX_ATTRIBS) REGISTER_PARAMETER_MACRO("radius", ANARI_FLOAT32, radiusConstant) REGISTER_PARAMETER_MACRO("scale", ANARI_FLOAT32_VEC3, scaleConstant) REGISTER_PARAMETER_MACRO("orientation", ANARI_FLOAT32_QUAT_IJKW, orientationConstant) REGISTER_PARAMETER_MACRO("shapeType", ANARI_STRING, shapeType) REGISTER_PARAMETER_MACRO("shapeGeometry", ANARI_GEOMETRY, shapeGeometry) REGISTER_PARAMETER_MACRO("shapeTransform", ANARI_FLOAT32_MAT4, shapeTransform) ) // See .h for usage. constexpr UsdGeometry::ComponentPair UsdGeometry::componentParamNames[]; // Workaround for C++14's lack of inlining constexpr arrays struct UsdGeometryTempArrays { UsdGeometryTempArrays(const UsdGeometry::AttributeArray& attributes) : Attributes(attributes) {} std::vector<int> CurveLengths; std::vector<float> PointsArray; std::vector<float> NormalsArray; std::vector<float> RadiiArray; std::vector<float> ScalesArray; std::vector<float> OrientationsArray; std::vector<int64_t> IdsArray; std::vector<int64_t> InvisIdsArray; std::vector<char> ColorsArray; // generic byte array ANARIDataType ColorsArrayType; UsdGeometry::AttributeDataArraysType AttributeDataArrays; const UsdGeometry::AttributeArray& Attributes; void resetColorsArray(size_t numElements, ANARIDataType type) { ColorsArray.resize(numElements*anari::sizeOf(type)); ColorsArrayType = type; } void reserveColorsArray(size_t numElements) { ColorsArray.reserve(numElements*anari::sizeOf(ColorsArrayType)); } size_t expandColorsArray(size_t numElements) { size_t startByte = ColorsArray.size(); size_t typeSize = anari::sizeOf(ColorsArrayType); ColorsArray.resize(startByte+numElements*typeSize); return startByte/typeSize; } void copyToColorsArray(const void* source, size_t srcIdx, size_t destIdx, size_t numElements) { size_t typeSize = anari::sizeOf(ColorsArrayType); size_t srcStart = srcIdx*typeSize; size_t dstStart = destIdx*typeSize; size_t numBytes = numElements*typeSize; assert(dstStart+numBytes <= ColorsArray.size()); memcpy(ColorsArray.data()+dstStart, reinterpret_cast<const char*>(source)+srcStart, numBytes); } void resetAttributeDataArray(size_t attribIdx, size_t numElements) { if(Attributes[attribIdx].Data) { uint32_t eltSize = Attributes[attribIdx].EltSize; AttributeDataArrays[attribIdx].resize(numElements*eltSize); } else AttributeDataArrays[attribIdx].resize(0); } void reserveAttributeDataArray(size_t attribIdx, size_t numElements) { if(Attributes[attribIdx].Data) { uint32_t eltSize = Attributes[attribIdx].EltSize; AttributeDataArrays[attribIdx].reserve(numElements*eltSize); } } size_t expandAttributeDataArray(size_t attribIdx, size_t numElements) { if(Attributes[attribIdx].Data) { uint32_t eltSize = Attributes[attribIdx].EltSize; size_t startByte = AttributeDataArrays[attribIdx].size(); AttributeDataArrays[attribIdx].resize(startByte+numElements*eltSize); return startByte/eltSize; } return 0; } void copyToAttributeDataArray(size_t attribIdx, size_t srcIdx, size_t destIdx, size_t numElements) { if(Attributes[attribIdx].Data) { uint32_t eltSize = Attributes[attribIdx].EltSize; const void* attribSrc = reinterpret_cast<const char*>(Attributes[attribIdx].Data) + srcIdx*eltSize; size_t dstStart = destIdx*eltSize; size_t numBytes = numElements*eltSize; assert(dstStart+numBytes <= AttributeDataArrays[attribIdx].size()); void* attribDest = &AttributeDataArrays[attribIdx][dstStart]; memcpy(attribDest, attribSrc, numElements*eltSize); } } }; namespace { struct UsdGeometryDebugData { UsdDevice* device = nullptr; UsdGeometry* geometry = nullptr; const char* debugName = nullptr; }; UsdGeometry::GeomType GetGeomType(const char* type) { UsdGeometry::GeomType geomType; if (strEquals(type, "sphere")) geomType = UsdGeometry::GEOM_SPHERE; else if (strEquals(type, "cylinder")) geomType = UsdGeometry::GEOM_CYLINDER; else if (strEquals(type, "cone")) geomType = UsdGeometry::GEOM_CONE; else if (strEquals(type, "curve")) geomType = UsdGeometry::GEOM_CURVE; else if(strEquals(type, "triangle")) geomType = UsdGeometry::GEOM_TRIANGLE; else if (strEquals(type, "quad")) geomType = UsdGeometry::GEOM_QUAD; else if (strEquals(type, "glyph")) geomType = UsdGeometry::GEOM_GLYPH; else geomType = UsdGeometry::GEOM_UNKNOWN; return geomType; } uint64_t GetNumberOfPrims(bool hasIndices, const UsdDataLayout& indexLayout, UsdGeometry::GeomType geomType) { if(geomType == UsdGeometry::GEOM_CURVE) return indexLayout.numItems1 - 1; else if(hasIndices) return indexLayout.numItems1; int perPrimVertexCount = 1; switch(geomType) { case UsdGeometry::GEOM_CYLINDER: case UsdGeometry::GEOM_CONE: perPrimVertexCount = 2; break; case UsdGeometry::GEOM_TRIANGLE: perPrimVertexCount = 3; break; case UsdGeometry::GEOM_QUAD: perPrimVertexCount = 4; break; default: break; }; return indexLayout.numItems1 / perPrimVertexCount; } bool isBitSet(int value, int bit) { return (bool)(value & (1 << bit)); } size_t getIndex(const void* indices, ANARIDataType type, size_t elt) { size_t result; switch (type) { case ANARI_INT32: case ANARI_INT32_VEC2: result = (reinterpret_cast<const int*>(indices))[elt]; break; case ANARI_UINT32: case ANARI_UINT32_VEC2: result = (reinterpret_cast<const uint32_t*>(indices))[elt]; break; case ANARI_INT64: case ANARI_INT64_VEC2: result = (reinterpret_cast<const int64_t*>(indices))[elt]; break; case ANARI_UINT64: case ANARI_UINT64_VEC2: result = (reinterpret_cast<const uint64_t*>(indices))[elt]; break; default: result = 0; break; } return result; } void getValues1(const void* vertices, ANARIDataType type, size_t idx, float* result) { if (type == ANARI_FLOAT32) { const float* vertf = reinterpret_cast<const float*>(vertices); result[0] = vertf[idx]; } else if (type == ANARI_FLOAT64) { const double* vertd = reinterpret_cast<const double*>(vertices); result[0] = (float)vertd[idx]; } } void getValues2(const void* vertices, ANARIDataType type, size_t idx, float* result) { if (type == ANARI_FLOAT32_VEC2) { const float* vertf = reinterpret_cast<const float*>(vertices); result[0] = vertf[idx * 2]; result[1] = vertf[idx * 2 + 1]; } else if (type == ANARI_FLOAT64_VEC2) { const double* vertd = reinterpret_cast<const double*>(vertices); result[0] = (float)vertd[idx * 2]; result[1] = (float)vertd[idx * 2 + 1]; } } void getValues3(const void* vertices, ANARIDataType type, size_t idx, float* result) { if (type == ANARI_FLOAT32_VEC3) { const float* vertf = reinterpret_cast<const float*>(vertices); result[0] = vertf[idx * 3]; result[1] = vertf[idx * 3 + 1]; result[2] = vertf[idx * 3 + 2]; } else if (type == ANARI_FLOAT64_VEC3) { const double* vertd = reinterpret_cast<const double*>(vertices); result[0] = (float)vertd[idx * 3]; result[1] = (float)vertd[idx * 3 + 1]; result[2] = (float)vertd[idx * 3 + 2]; } } void getValues4(const void* vertices, ANARIDataType type, size_t idx, float* result) { if (type == ANARI_FLOAT32_VEC4) { const float* vertf = reinterpret_cast<const float*>(vertices); result[0] = vertf[idx * 4]; result[1] = vertf[idx * 4 + 1]; result[2] = vertf[idx * 4 + 2]; result[3] = vertf[idx * 4 + 3]; } else if (type == ANARI_FLOAT64_VEC4) { const double* vertd = reinterpret_cast<const double*>(vertices); result[0] = (float)vertd[idx * 4]; result[1] = (float)vertd[idx * 4 + 1]; result[2] = (float)vertd[idx * 4 + 2]; result[3] = (float)vertd[idx * 4 + 3]; } } void generateIndexedSphereData(const UsdGeometryData& paramData, const UsdGeometry::AttributeArray& attributeArray, UsdGeometryTempArrays* tempArrays) { if (paramData.indices) { auto& attribDataArrays = tempArrays->AttributeDataArrays; assert(attribDataArrays.size() == attributeArray.size()); uint64_t numVertices = paramData.vertexPositions->getLayout().numItems1; ANARIDataType scaleType = paramData.vertexScales ? paramData.vertexScales->getType() : (paramData.primitiveScales ? paramData.primitiveScales->getType() : ANARI_UNKNOWN); size_t scaleComps = anari::componentsOf(scaleType); bool perPrimNormals = !paramData.vertexNormals && paramData.primitiveNormals; bool perPrimRadii = !paramData.vertexRadii && paramData.primitiveRadii; bool perPrimScales = !paramData.vertexScales && paramData.primitiveScales; bool perPrimColors = !paramData.vertexColors && paramData.primitiveColors; bool perPrimOrientations = !paramData.vertexOrientations && paramData.primitiveOrientations; ANARIDataType colorType = perPrimColors ? paramData.primitiveColors->getType() : ANARI_UINT8; // Vertex colors aren't reordered // Effectively only has to reorder if the source array is perPrim, otherwise this function effectively falls through and the source array is assigned directly at parent scope. tempArrays->NormalsArray.resize(perPrimNormals ? numVertices*3 : 0); tempArrays->RadiiArray.resize(perPrimScales ? numVertices : 0); tempArrays->ScalesArray.resize(perPrimScales ? numVertices*scaleComps : 0); tempArrays->OrientationsArray.resize(perPrimOrientations ? numVertices*4 : 0); tempArrays->IdsArray.resize(numVertices, -1); // Always filled, since indices implies necessity for invisibleIds, and therefore also an Id array tempArrays->resetColorsArray(perPrimColors ? numVertices : 0, colorType); for(size_t attribIdx = 0; attribIdx < attribDataArrays.size(); ++attribIdx) { tempArrays->resetAttributeDataArray(attribIdx, attributeArray[attribIdx].PerPrimData ? numVertices : 0); } const void* indices = paramData.indices->getData(); uint64_t numIndices = paramData.indices->getLayout().numItems1; ANARIDataType indexType = paramData.indices->getType(); int64_t maxId = -1; for (uint64_t primIdx = 0; primIdx < numIndices; ++primIdx) { size_t vertIdx = getIndex(indices, indexType, primIdx); // Normals if (perPrimNormals) { float* normalsDest = &tempArrays->NormalsArray[vertIdx * 3]; getValues3(paramData.primitiveNormals->getData(), paramData.primitiveNormals->getType(), primIdx, normalsDest); } // Orientations if (perPrimOrientations) { float* orientsDest = &tempArrays->OrientationsArray[vertIdx*4]; getValues4(paramData.primitiveOrientations->getData(), paramData.primitiveOrientations->getType(), primIdx, orientsDest); } // Radii if (perPrimRadii) { float* radiiDest = &tempArrays->RadiiArray[vertIdx]; getValues1(paramData.primitiveRadii->getData(), paramData.primitiveRadii->getType(), primIdx, radiiDest); } // Scales if (perPrimScales) { float* scalesDest = &tempArrays->ScalesArray[vertIdx*scaleComps]; if(scaleComps == 1) getValues1(paramData.primitiveScales->getData(), paramData.primitiveScales->getType(), primIdx, scalesDest); else if(scaleComps == 3) getValues3(paramData.primitiveScales->getData(), paramData.primitiveScales->getType(), primIdx, scalesDest); } // Colors if (perPrimColors) { assert(primIdx < paramData.primitiveColors->getLayout().numItems1); tempArrays->copyToColorsArray(paramData.primitiveColors->getData(), primIdx, vertIdx, 1); } // Attributes for(size_t attribIdx = 0; attribIdx < attribDataArrays.size(); ++attribIdx) { if(attributeArray[attribIdx].PerPrimData) { tempArrays->copyToAttributeDataArray(attribIdx, primIdx, vertIdx, 1); } } // Ids if (paramData.primitiveIds) { int64_t id = static_cast<int64_t>(getIndex(paramData.primitiveIds->getData(), paramData.primitiveIds->getType(), primIdx)); tempArrays->IdsArray[vertIdx] = id; if (id > maxId) maxId = id; } else { int64_t id = static_cast<int64_t>(vertIdx); maxId = tempArrays->IdsArray[vertIdx] = id; } } // Assign unused ids to untouched vertices, then add those ids to invisible array tempArrays->InvisIdsArray.resize(0); tempArrays->InvisIdsArray.reserve(numVertices); for (uint64_t vertIdx = 0; vertIdx < numVertices; ++vertIdx) { if (tempArrays->IdsArray[vertIdx] == -1) { tempArrays->IdsArray[vertIdx] = ++maxId; tempArrays->InvisIdsArray.push_back(maxId); } } } } void convertLinesToSticks(const UsdGeometryData& paramData, const UsdGeometry::AttributeArray& attributeArray, UsdGeometryTempArrays* tempArrays) { // Converts arrays of vertex endpoint 2-tuples (optionally obtained via index 2-tuples) into center vertices with correct seglengths. auto& attribDataArrays = tempArrays->AttributeDataArrays; assert(attribDataArrays.size() == attributeArray.size()); const UsdDataArray* vertexArray = paramData.vertexPositions; uint64_t numVertices = vertexArray->getLayout().numItems1; const void* vertices = vertexArray->getData(); ANARIDataType vertexType = vertexArray->getType(); const UsdDataArray* indexArray = paramData.indices; uint64_t numSticks = indexArray ? indexArray->getLayout().numItems1 : numVertices/2; uint64_t numIndices = numSticks * 2; // Indices are 2-element vectors in ANARI const void* indices = indexArray ? indexArray->getData() : nullptr; ANARIDataType indexType = indexArray ? indexArray->getType() : ANARI_UINT32; tempArrays->PointsArray.resize(numSticks * 3); tempArrays->ScalesArray.resize(numSticks * 3); // Scales are always present tempArrays->OrientationsArray.resize(numSticks * 4); tempArrays->IdsArray.resize(paramData.primitiveIds ? numSticks : 0); // Only reorder per-vertex arrays, per-prim is already in order of the output stick center vertices ANARIDataType colorType = paramData.vertexColors ? paramData.vertexColors->getType() : ANARI_UINT8; tempArrays->resetColorsArray(paramData.vertexColors ? numSticks : 0, colorType); for(size_t attribIdx = 0; attribIdx < attribDataArrays.size(); ++attribIdx) { tempArrays->resetAttributeDataArray(attribIdx, !attributeArray[attribIdx].PerPrimData ? numSticks : 0); } for (size_t i = 0; i < numIndices; i += 2) { size_t primIdx = i / 2; size_t vertIdx0 = indices ? getIndex(indices, indexType, i) : i; size_t vertIdx1 = indices ? getIndex(indices, indexType, i + 1) : i + 1; assert(vertIdx0 < numVertices); assert(vertIdx1 < numVertices); float point0[3], point1[3]; getValues3(vertices, vertexType, vertIdx0, point0); getValues3(vertices, vertexType, vertIdx1, point1); tempArrays->PointsArray[primIdx * 3] = (point0[0] + point1[0]) * 0.5f; tempArrays->PointsArray[primIdx * 3 + 1] = (point0[1] + point1[1]) * 0.5f; tempArrays->PointsArray[primIdx * 3 + 2] = (point0[2] + point1[2]) * 0.5f; float scaleVal = paramData.radiusConstant; if (paramData.vertexRadii) { getValues1(paramData.vertexRadii->getData(), paramData.vertexRadii->getType(), vertIdx0, &scaleVal); } else if (paramData.primitiveRadii) { getValues1(paramData.primitiveRadii->getData(), paramData.primitiveRadii->getType(), primIdx, &scaleVal); } float segDir[3] = { point1[0] - point0[0], point1[1] - point0[1], point1[2] - point0[2], }; float segLength = sqrtf(segDir[0] * segDir[0] + segDir[1] * segDir[1] + segDir[2] * segDir[2]); tempArrays->ScalesArray[primIdx * 3] = scaleVal; tempArrays->ScalesArray[primIdx * 3 + 1] = scaleVal; tempArrays->ScalesArray[primIdx * 3 + 2] = segLength * 0.5f; // Rotation // USD shapes are always lengthwise-oriented along the z axis usdbridgenumerics::DirectionToQuaternionZ(segDir, segLength, tempArrays->OrientationsArray.data() + primIdx*4); //Colors if (paramData.vertexColors) { assert(vertIdx0 < paramData.vertexColors->getLayout().numItems1); tempArrays->copyToColorsArray(paramData.vertexColors->getData(), vertIdx0, primIdx, 1); } // Attributes for(size_t attribIdx = 0; attribIdx < attribDataArrays.size(); ++attribIdx) { if(!attributeArray[attribIdx].PerPrimData) { tempArrays->copyToAttributeDataArray(attribIdx, vertIdx0, primIdx, 1); } } // Ids if (paramData.primitiveIds) { tempArrays->IdsArray[primIdx] = (int64_t)getIndex(paramData.primitiveIds->getData(), paramData.primitiveIds->getType(), primIdx); } } } void pushVertex(const UsdGeometryData& paramData, const UsdGeometry::AttributeArray& attributeArray, UsdGeometryTempArrays* tempArrays, const void* vertices, ANARIDataType vertexType, bool hasNormals, bool hasColors, bool hasRadii, size_t segStart, size_t primIdx) { auto& attribDataArrays = tempArrays->AttributeDataArrays; float point[3]; getValues3(vertices, vertexType, segStart, point); tempArrays->PointsArray.push_back(point[0]); tempArrays->PointsArray.push_back(point[1]); tempArrays->PointsArray.push_back(point[2]); // Normals if (hasNormals) { float normals[3]; if (paramData.vertexNormals) { getValues3(paramData.vertexNormals->getData(), paramData.vertexNormals->getType(), segStart, normals); } else if (paramData.primitiveNormals) { getValues3(paramData.primitiveNormals->getData(), paramData.primitiveNormals->getType(), primIdx, normals); } tempArrays->NormalsArray.push_back(normals[0]); tempArrays->NormalsArray.push_back(normals[1]); tempArrays->NormalsArray.push_back(normals[2]); } // Radii if (hasRadii) { float radii; if (paramData.vertexRadii) { getValues1(paramData.vertexRadii->getData(), paramData.vertexRadii->getType(), segStart, &radii); } else if (paramData.primitiveRadii) { getValues1(paramData.primitiveRadii->getData(), paramData.primitiveRadii->getType(), primIdx, &radii); } tempArrays->ScalesArray.push_back(radii); } // Colors if (hasColors) { size_t destIdx = tempArrays->expandColorsArray(1); if (paramData.vertexColors) { tempArrays->copyToColorsArray(paramData.vertexColors->getData(), segStart, destIdx, 1); } else if (paramData.primitiveColors) { tempArrays->copyToColorsArray(paramData.primitiveColors->getData(), primIdx, destIdx, 1); } } // Attributes for(size_t attribIdx = 0; attribIdx < attribDataArrays.size(); ++attribIdx) { size_t srcIdx = attributeArray[attribIdx].PerPrimData ? primIdx : segStart; size_t destIdx = tempArrays->expandAttributeDataArray(attribIdx, 1); tempArrays->copyToAttributeDataArray(attribIdx, srcIdx, destIdx, 1); } } #define PUSH_VERTEX(x, y) \ pushVertex(paramData, attributeArray, tempArrays, \ vertices, vertexType, \ hasNormals, hasColors, hasRadii, \ x, y) void reorderCurveGeometry(const UsdGeometryData& paramData, const UsdGeometry::AttributeArray& attributeArray, UsdGeometryTempArrays* tempArrays) { auto& attribDataArrays = tempArrays->AttributeDataArrays; assert(attribDataArrays.size() == attributeArray.size()); const UsdDataArray* vertexArray = paramData.vertexPositions; uint64_t numVertices = vertexArray->getLayout().numItems1; const void* vertices = vertexArray->getData(); ANARIDataType vertexType = vertexArray->getType(); const UsdDataArray* indexArray = paramData.indices; uint64_t numSegments = indexArray ? indexArray->getLayout().numItems1 : numVertices-1; const void* indices = indexArray ? indexArray->getData() : nullptr; ANARIDataType indexType = indexArray ? indexArray->getType() : ANARI_UINT32; uint64_t maxNumVerts = numSegments*2; tempArrays->CurveLengths.resize(0); tempArrays->PointsArray.resize(0); tempArrays->PointsArray.reserve(maxNumVerts * 3); // Conservative max number of points bool hasNormals = paramData.vertexNormals || paramData.primitiveNormals; if (hasNormals) { tempArrays->NormalsArray.resize(0); tempArrays->NormalsArray.reserve(maxNumVerts * 3); } bool hasColors = paramData.vertexColors || paramData.primitiveColors; if (hasColors) { tempArrays->resetColorsArray(0, paramData.vertexColors ? paramData.vertexColors->getType() : paramData.primitiveColors->getType()); tempArrays->reserveColorsArray(maxNumVerts); } bool hasRadii = paramData.vertexRadii || paramData.primitiveRadii; if (hasRadii) { tempArrays->ScalesArray.resize(0); tempArrays->ScalesArray.reserve(maxNumVerts); } for(size_t attribIdx = 0; attribIdx < attribDataArrays.size(); ++attribIdx) { tempArrays->resetAttributeDataArray(attribIdx, 0); tempArrays->reserveAttributeDataArray(attribIdx, maxNumVerts); } size_t prevSegEnd = 0; int curveLength = 0; for (size_t primIdx = 0; primIdx < numSegments; ++primIdx) { size_t segStart = indices ? getIndex(indices, indexType, primIdx) : primIdx; if (primIdx != 0 && prevSegEnd != segStart) { PUSH_VERTEX(prevSegEnd, primIdx - 1); curveLength += 1; tempArrays->CurveLengths.push_back(curveLength); curveLength = 0; } assert(segStart+1 < numVertices); // begin and end vertex should be in range PUSH_VERTEX(segStart, primIdx); curveLength += 1; prevSegEnd = segStart + 1; } if (curveLength != 0) { PUSH_VERTEX(prevSegEnd, numSegments - 1); curveLength += 1; tempArrays->CurveLengths.push_back(curveLength); } } template<typename T> void setInstancerDataArray(const char* arrayName, const UsdDataArray* vertArray, const UsdDataArray* primArray, const std::vector<T>& tmpArray, UsdBridgeType tmpArrayType, void const*& instancerDataArray, UsdBridgeType& instancerDataArrayType, const UsdGeometryData& paramData, const UsdGeometryDebugData& dbgData) { // Normals if (paramData.indices && tmpArray.size()) { instancerDataArray = tmpArray.data(); instancerDataArrayType = tmpArrayType; } else { const UsdDataArray* normals = vertArray; if (normals) { instancerDataArray = normals->getData(); instancerDataArrayType = AnariToUsdBridgeType(normals->getType()); } else if(primArray) { dbgData.device->reportStatus(dbgData.geometry, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' primitive.%s not transferred: per-primitive arrays provided without setting primitive.index", dbgData.debugName, arrayName); } } } } UsdGeometry::UsdGeometry(const char* name, const char* type, UsdDevice* device) : BridgedBaseObjectType(ANARI_GEOMETRY, name, device) { bool createTempArrays = false; geomType = GetGeomType(type); if(isInstanced() || geomType == GEOM_CURVE) createTempArrays = true; if(geomType == GEOM_UNKNOWN) device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' construction failed: type %s not supported", getName(), type); if(createTempArrays) tempArrays = std::make_unique<UsdGeometryTempArrays>(attributeArray); } UsdGeometry::~UsdGeometry() { #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME if(cachedBridge) cachedBridge->DeleteGeometry(usdHandle); #endif } void UsdGeometry::remove(UsdDevice* device) { applyRemoveFunc(device, &UsdBridge::DeleteGeometry); } void UsdGeometry::filterSetParam(const char *name, ANARIDataType type, const void *mem, UsdDevice* device) { if(geomType == GEOM_GLYPH && strEquals(name, "shapeType") || strEquals(name, "shapeGeometry") || strEquals(name, "shapeTransform")) protoShapeChanged = true; if(usdHandle.value && strEquals(name, "usd::useUsdGeomPoints")) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_WARNING, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' filterSetParam failed: 'usd::useUsdGeomPoints' parameter cannot be changed after the first commit", getName()); return; } BridgedBaseObjectType::filterSetParam(name, type, mem, device); } template<typename GeomDataType> void UsdGeometry::setAttributeTimeVarying(typename GeomDataType::DataMemberId& timeVarying) { typedef typename GeomDataType::DataMemberId DMI; const UsdGeometryData& paramData = getReadParams(); static constexpr int attribStartBit = static_cast<int>(UsdGeometryComponents::ATTRIBUTE0); for(size_t attribIdx = 0; attribIdx < attributeArray.size(); ++attribIdx) { DMI attributeId = DMI::ATTRIBUTE0 + attribIdx; timeVarying = timeVarying & (isBitSet(paramData.timeVarying, attribStartBit+(int)attribIdx) ? DMI::ALL : ~attributeId); } } void UsdGeometry::syncAttributeArrays() { const UsdGeometryData& paramData = getReadParams(); // Find the max index of the last attribute that still contains an array int attribCount = 0; for(int i = 0; i < MAX_ATTRIBS; ++i) { if(paramData.primitiveAttributes[i] != nullptr || paramData.vertexAttributes[i] != nullptr) attribCount = i+1; } // Set the attribute arrays and related info, resize temporary attribute array data for reordering if(attribCount) { attributeArray.resize(attribCount); for(int i = 0; i < attribCount; ++i) { const UsdDataArray* attribArray = paramData.vertexAttributes[i] ? paramData.vertexAttributes[i] : paramData.primitiveAttributes[i]; if (attribArray) { attributeArray[i].Data = attribArray->getData(); attributeArray[i].DataType = AnariToUsdBridgeType(attribArray->getType()); attributeArray[i].PerPrimData = paramData.vertexAttributes[i] ? false : true; attributeArray[i].EltSize = static_cast<uint32_t>(anari::sizeOf(attribArray->getType())); attributeArray[i].Name = UsdSharedString::c_str(paramData.attributeNames[i]); } else { attributeArray[i].Data = nullptr; attributeArray[i].DataType = UsdBridgeType::UNDEFINED; } } if(tempArrays) tempArrays->AttributeDataArrays.resize(attribCount); } } template<typename GeomDataType> void UsdGeometry::copyAttributeArraysToData(GeomDataType& geomData) { geomData.Attributes = attributeArray.data(); geomData.NumAttributes = static_cast<uint32_t>(attributeArray.size()); } void UsdGeometry::assignTempDataToAttributes(bool perPrimInterpolation) { const AttributeDataArraysType& attribDataArrays = tempArrays->AttributeDataArrays; assert(attributeArray.size() == attribDataArrays.size()); for(size_t attribIdx = 0; attribIdx < attribDataArrays.size(); ++attribIdx) { if(attribDataArrays[attribIdx].size()) // Always > 0 if attributeArray[attribIdx].Data is set attributeArray[attribIdx].Data = attribDataArrays[attribIdx].data(); attributeArray[attribIdx].PerPrimData = perPrimInterpolation; // Already converted to per-vertex (or per-prim) } } void UsdGeometry::initializeGeomData(UsdBridgeMeshData& geomData) { typedef UsdBridgeMeshData::DataMemberId DMI; const UsdGeometryData& paramData = getReadParams(); geomData.TimeVarying = DMI::ALL & (isTimeVarying(CType::POSITION) ? DMI::ALL : ~DMI::POINTS) & (isTimeVarying(CType::NORMAL) ? DMI::ALL : ~DMI::NORMALS) & (isTimeVarying(CType::COLOR) ? DMI::ALL : ~DMI::COLORS) & (isTimeVarying(CType::INDEX) ? DMI::ALL : ~DMI::INDICES); setAttributeTimeVarying<UsdBridgeMeshData>(geomData.TimeVarying); geomData.FaceVertexCount = geomType == GEOM_QUAD ? 4 : 3; } void UsdGeometry::initializeGeomData(UsdBridgeInstancerData& geomData) { typedef UsdBridgeInstancerData::DataMemberId DMI; const UsdGeometryData& paramData = getReadParams(); geomData.TimeVarying = DMI::ALL & (isTimeVarying(CType::POSITION) ? DMI::ALL : ~DMI::POINTS) & (( ((geomType == GEOM_CYLINDER || geomType == GEOM_CONE) && (isTimeVarying(CType::NORMAL) || isTimeVarying(CType::POSITION) || isTimeVarying(CType::INDEX))) || ((geomType == GEOM_GLYPH) && isTimeVarying(CType::ORIENTATION)) ) ? DMI::ALL : ~DMI::ORIENTATIONS) & (isTimeVarying(CType::SCALE) ? DMI::ALL : ~DMI::SCALES) & (isTimeVarying(CType::INDEX) ? DMI::ALL : ~DMI::INVISIBLEIDS) & (isTimeVarying(CType::COLOR) ? DMI::ALL : ~DMI::COLORS) & (isTimeVarying(CType::ID) ? DMI::ALL : ~DMI::INSTANCEIDS) & ~DMI::SHAPEINDICES; // Shapeindices are always the same, and USD clients typically do not support timevarying shapes setAttributeTimeVarying<UsdBridgeInstancerData>(geomData.TimeVarying); geomData.UseUsdGeomPoints = geomType == GEOM_SPHERE && paramData.UseUsdGeomPoints; } void UsdGeometry::initializeGeomData(UsdBridgeCurveData& geomData) { typedef UsdBridgeCurveData::DataMemberId DMI; const UsdGeometryData& paramData = getReadParams(); // Turn off what is not timeVarying geomData.TimeVarying = DMI::ALL & (isTimeVarying(CType::POSITION) ? DMI::ALL : ~DMI::POINTS) & (isTimeVarying(CType::NORMAL) ? DMI::ALL : ~DMI::NORMALS) & (isTimeVarying(CType::SCALE) ? DMI::ALL : ~DMI::SCALES) & (isTimeVarying(CType::COLOR) ? DMI::ALL : ~DMI::COLORS) & ((isTimeVarying(CType::POSITION) || isTimeVarying(CType::INDEX)) ? DMI::ALL : ~DMI::CURVELENGTHS); setAttributeTimeVarying<UsdBridgeCurveData>(geomData.TimeVarying); } void UsdGeometry::initializeGeomRefData(UsdBridgeInstancerRefData& geomRefData) { const UsdGeometryData& paramData = getReadParams(); // The anari side currently only supports only one shape, so just set DefaultShape bool isGlyph = geomType == GEOM_GLYPH; if(isGlyph && paramData.shapeGeometry) geomRefData.DefaultShape = UsdBridgeInstancerRefData::SHAPE_MESH; else { UsdGeometry::GeomType defaultShape = (isGlyph && paramData.shapeType) ? GetGeomType(paramData.shapeType->c_str()) : geomType; switch (defaultShape) { case GEOM_CYLINDER: geomRefData.DefaultShape = UsdBridgeInstancerRefData::SHAPE_CYLINDER; break; case GEOM_CONE: geomRefData.DefaultShape = UsdBridgeInstancerRefData::SHAPE_CONE; break; default: geomRefData.DefaultShape = UsdBridgeInstancerRefData::SHAPE_SPHERE; break; }; } geomRefData.ShapeTransform = paramData.shapeTransform; } bool UsdGeometry::checkArrayConstraints(const UsdDataArray* vertexArray, const UsdDataArray* primArray, const char* paramName, UsdDevice* device, const char* debugName, int attribIndex) { const UsdGeometryData& paramData = getReadParams(); UsdLogInfo logInfo(device, this, ANARI_GEOMETRY, debugName); const UsdDataArray* vertices = paramData.vertexPositions; const UsdDataLayout& vertLayout = vertices->getLayout(); const UsdDataArray* indices = paramData.indices; const UsdDataLayout& indexLayout = indices ? indices->getLayout() : vertLayout; const UsdDataLayout& perVertLayout = vertexArray ? vertexArray->getLayout() : vertLayout; const UsdDataLayout& perPrimLayout = primArray ? primArray->getLayout() : indexLayout; const UsdDataLayout& attrLayout = vertexArray ? perVertLayout : perPrimLayout; if (!AssertOneDimensional(attrLayout, logInfo, paramName) || !AssertNoStride(attrLayout, logInfo, paramName) ) { return false; } if (vertexArray && vertexArray->getLayout().numItems1 < vertLayout.numItems1) { if(attribIndex == -1) device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: all 'vertex.X' array elements should at least be the size of vertex.positions", debugName); else device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: all 'vertex.attribute%i' array elements should at least be the size of vertex.positions", debugName, attribIndex); return false; } uint64_t numPrims = GetNumberOfPrims(indices, indexLayout, geomType); if (primArray && primArray->getLayout().numItems1 < numPrims) { if(attribIndex == -1) device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: size of 'primitive.X' array too small", debugName); else device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: size of 'primitive.attribute%i' array too small", debugName, attribIndex); return false; } return true; } bool UsdGeometry::checkGeomParams(UsdDevice* device) { const UsdGeometryData& paramData = getReadParams(); const char* debugName = getName(); bool success = true; success = success && checkArrayConstraints(paramData.vertexPositions, nullptr, "vertex.position", device, debugName); success = success && checkArrayConstraints(nullptr, paramData.indices, "primitive.index", device, debugName); success = success && checkArrayConstraints(paramData.vertexNormals, paramData.primitiveNormals, "vertex/primitive.normal", device, debugName); for(int i = 0; i < MAX_ATTRIBS; ++i) success = success && checkArrayConstraints(paramData.vertexAttributes[i], paramData.primitiveAttributes[i], "vertex/primitive.attribute", device, debugName, i); success = success && checkArrayConstraints(paramData.vertexColors, paramData.primitiveColors, "vertex/primitive.color", device, debugName); success = success && checkArrayConstraints(paramData.vertexRadii, paramData.primitiveRadii, "vertex/primitive.radius", device, debugName); success = success && checkArrayConstraints(paramData.vertexScales, paramData.primitiveScales, "vertex/primitive.scale", device, debugName); success = success && checkArrayConstraints(paramData.vertexOrientations, paramData.primitiveOrientations, "vertex/primitive.orientation", device, debugName); success = success && checkArrayConstraints(nullptr, paramData.primitiveIds, "primitive.id", device, debugName); if (!success) return false; ANARIDataType vertType = paramData.vertexPositions->getType(); if (vertType != ANARI_FLOAT32_VEC3 && vertType != ANARI_FLOAT64_VEC3) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: 'vertex.position' parameter should be of type ANARI_FLOAT32_VEC3 or ANARI_FLOAT64_VEC3.", debugName); return false; } if (paramData.indices) { ANARIDataType indexType = paramData.indices->getType(); UsdBridgeType flattenedType = AnariToUsdBridgeType_Flattened(indexType); if( (geomType == GEOM_TRIANGLE || geomType == GEOM_QUAD) && (flattenedType == UsdBridgeType::UINT || flattenedType == UsdBridgeType::ULONG || flattenedType == UsdBridgeType::LONG)) { static bool reported = false; // Hardcode this to show only once to make sure developers get to see it, without spamming the console. if(!reported) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_WARNING, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' has 'primitive.index' of type other than ANARI_INT32, which may result in an overflow for FaceVertexIndicesAttr of UsdGeomMesh.", debugName); reported = true; } } if (geomType == GEOM_SPHERE || geomType == GEOM_CURVE || geomType == GEOM_GLYPH) { if(geomType == GEOM_SPHERE && paramData.UseUsdGeomPoints) device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_WARNING, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' is a sphere geometry with indices, but the usd::useUsdGeomPoints parameter is not set, so all vertices will show as spheres.", debugName); if (indexType != ANARI_INT32 && indexType != ANARI_UINT32 && indexType != ANARI_INT64 && indexType != ANARI_UINT64) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: 'primitive.index' parameter should be of type ANARI_(U)INT32/64.", debugName); return false; } } else if (geomType == GEOM_CYLINDER || geomType == GEOM_CONE) { if (indexType != ANARI_UINT32_VEC2 && indexType != ANARI_INT32_VEC2 && indexType != ANARI_UINT64_VEC2 && indexType != ANARI_INT64_VEC2) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: 'primitive.index' parameter should be of type ANARI_(U)INT_VEC2.", debugName); return false; } } else if (geomType == GEOM_TRIANGLE) { if (indexType != ANARI_UINT32_VEC3 && indexType != ANARI_INT32_VEC3 && indexType != ANARI_UINT64_VEC3 && indexType != ANARI_INT64_VEC3) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: 'primitive.index' parameter should be of type ANARI_(U)INT_VEC3.", debugName); return false; } } else if (geomType == GEOM_QUAD) { if (indexType != ANARI_UINT32_VEC4 && indexType != ANARI_INT32_VEC4 && indexType != ANARI_UINT64_VEC4 && indexType != ANARI_INT64_VEC4) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: 'primitive.index' parameter should be of type ANARI_(U)INT_VEC4.", debugName); return false; } } } const UsdDataArray* normals = paramData.vertexNormals ? paramData.vertexNormals : paramData.primitiveNormals; if (normals) { ANARIDataType arrayType = normals->getType(); if (arrayType != ANARI_FLOAT32_VEC3 && arrayType != ANARI_FLOAT64_VEC3) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: 'vertex/primitive.normal' parameter should be of type ANARI_FLOAT32_VEC3 or ANARI_FLOAT64_VEC3.", debugName); return false; } } const UsdDataArray* colors = paramData.vertexColors ? paramData.vertexColors : paramData.primitiveColors; if (colors) { ANARIDataType arrayType = colors->getType(); if ((int)arrayType < (int)ANARI_INT8 || (int)arrayType > (int)ANARI_UFIXED8_R_SRGB) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: 'vertex/primitive.color' parameter should be of Color type (see ANARI standard)", debugName); return false; } } const UsdDataArray* radii = paramData.vertexRadii ? paramData.vertexRadii : paramData.primitiveRadii; if (radii) { ANARIDataType arrayType = radii->getType(); if (arrayType != ANARI_FLOAT32 && arrayType != ANARI_FLOAT64) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: 'vertex/primitive.radius' parameter should be of type ANARI_FLOAT32 or ANARI_FLOAT64.", debugName); return false; } } const UsdDataArray* scales = paramData.vertexScales ? paramData.vertexScales : paramData.primitiveScales; if (scales) { ANARIDataType arrayType = scales->getType(); if (arrayType != ANARI_FLOAT32 && arrayType != ANARI_FLOAT64 && arrayType != ANARI_FLOAT32_VEC3 && arrayType != ANARI_FLOAT64_VEC3) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: 'vertex/primitive.scale' parameter should be of type ANARI_FLOAT32(_VEC3) or ANARI_FLOAT64(_VEC3).", debugName); return false; } } const UsdDataArray* orientations = paramData.vertexOrientations ? paramData.vertexOrientations : paramData.primitiveOrientations; if (orientations) { ANARIDataType arrayType = orientations->getType(); if (arrayType != ANARI_FLOAT32_QUAT_IJKW) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: 'vertex/primitive.orientation' parameter should be of type ANARI_FLOAT32_QUAT_IJKW.", debugName); return false; } } if (paramData.primitiveIds) { ANARIDataType idType = paramData.primitiveIds->getType(); if (idType != ANARI_INT32 && idType != ANARI_UINT32 && idType != ANARI_INT64 && idType != ANARI_UINT64) { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: 'primitive.id' parameter should be of type ANARI_(U)INT or ANARI_(U)LONG.", debugName); return false; } } return true; } void UsdGeometry::updateGeomData(UsdDevice* device, UsdBridge* usdBridge, UsdBridgeMeshData& meshData, bool isNew) { const UsdGeometryData& paramData = getReadParams(); const UsdDataArray* vertices = paramData.vertexPositions; meshData.NumPoints = vertices->getLayout().numItems1; meshData.Points = vertices->getData(); meshData.PointsType = AnariToUsdBridgeType(vertices->getType()); const UsdDataArray* normals = paramData.vertexNormals ? paramData.vertexNormals : paramData.primitiveNormals; if (normals) { meshData.Normals = normals->getData(); meshData.NormalsType = AnariToUsdBridgeType(normals->getType()); meshData.PerPrimNormals = paramData.vertexNormals ? false : true; } const UsdDataArray* colors = paramData.vertexColors ? paramData.vertexColors : paramData.primitiveColors; if (colors) { meshData.Colors = colors->getData(); meshData.ColorsType = AnariToUsdBridgeType(colors->getType()); meshData.PerPrimColors = paramData.vertexColors ? false : true; } const UsdDataArray* indices = paramData.indices; if (indices) { ANARIDataType indexType = indices->getType(); meshData.NumIndices = indices->getLayout().numItems1 * anari::componentsOf(indexType); meshData.Indices = indices->getData(); meshData.IndicesType = AnariToUsdBridgeType_Flattened(indexType); } else { meshData.NumIndices = meshData.NumPoints; // Vertices are implicitly indexed consecutively (FaceVertexCount determines how many prims) } //meshData.UpdatesToPerform = Still to be implemented double worldTimeStep = device->getReadParams().timeStep; double dataTimeStep = selectObjTime(paramData.timeStep, worldTimeStep); usdBridge->SetGeometryData(usdHandle, meshData, dataTimeStep); } void UsdGeometry::updateGeomData(UsdDevice* device, UsdBridge* usdBridge, UsdBridgeInstancerData& instancerData, bool isNew) { const UsdGeometryData& paramData = getReadParams(); const char* debugName = getName(); if (geomType == GEOM_SPHERE || geomType == GEOM_GLYPH) { // A paramData.indices (primitive-indexed spheres) array, is not supported in USD, also duplicate spheres make no sense. // Instead, Ids/InvisibleIds are assigned to emulate sparsely indexed spheres (sourced from paramData.primitiveIds if available), // with the per-vertex arrays remaining intact. Any per-prim arrays are explicitly converted to per-vertex via the tempArrays. generateIndexedSphereData(paramData, attributeArray, tempArrays.get()); const UsdDataArray* vertices = paramData.vertexPositions; instancerData.NumPoints = vertices->getLayout().numItems1; instancerData.Points = vertices->getData(); instancerData.PointsType = AnariToUsdBridgeType(vertices->getType()); UsdGeometryDebugData dbgData = { device, this, debugName }; // Orientations // are a bit extended beyond the spec: even spheres can set them, and the use of normals is also supported if(paramData.vertexOrientations || paramData.primitiveOrientations) { setInstancerDataArray("orientation", paramData.vertexOrientations, paramData.primitiveOrientations, tempArrays->OrientationsArray, UsdBridgeType::FLOAT4, instancerData.Orientations, instancerData.OrientationsType, paramData, dbgData); } else { setInstancerDataArray("normal", paramData.vertexNormals, paramData.primitiveNormals, tempArrays->NormalsArray, UsdBridgeType::FLOAT3, instancerData.Orientations, instancerData.OrientationsType, paramData, dbgData); } // Scales if(geomType == GEOM_SPHERE) { setInstancerDataArray("radius", paramData.vertexRadii, paramData.primitiveRadii, tempArrays->RadiiArray, UsdBridgeType::FLOAT, instancerData.Scales, instancerData.ScalesType, paramData, dbgData); } else { size_t numTmpScales = tempArrays->ScalesArray.size(); bool scalarScale = (numTmpScales == instancerData.NumPoints); assert(!numTmpScales || scalarScale || numTmpScales == instancerData.NumPoints*3); setInstancerDataArray("scale", paramData.vertexScales, paramData.primitiveScales, tempArrays->ScalesArray, scalarScale ? UsdBridgeType::FLOAT : UsdBridgeType::FLOAT3, instancerData.Scales, instancerData.ScalesType, paramData, dbgData); } // Colors setInstancerDataArray("color", paramData.vertexColors, paramData.primitiveColors, tempArrays->ColorsArray, AnariToUsdBridgeType(tempArrays->ColorsArrayType), instancerData.Colors, instancerData.ColorsType, paramData, dbgData); // Attributes // By default, syncAttributeArrays and initializeGeomData already set up instancerData.Attributes // Just set attributeArray's data to tempArrays where necessary if(paramData.indices) { // Type remains the same, everything per-vertex (as explained above) assignTempDataToAttributes(false); } else { // Check whether any perprim attributes exist for(size_t attribIdx = 0; attribIdx < attributeArray.size(); ++attribIdx) { if(attributeArray[attribIdx].Data && attributeArray[attribIdx].PerPrimData) { attributeArray[attribIdx].Data = nullptr; device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' primitive.attribute%i not transferred: per-primitive arrays provided without setting primitive.index", debugName, static_cast<int>(attribIdx)); } } } // Ids if (paramData.indices && tempArrays->IdsArray.size()) { instancerData.InstanceIds = tempArrays->IdsArray.data(); instancerData.InstanceIdsType = UsdBridgeType::LONG; } else { const UsdDataArray* ids = paramData.primitiveIds; if (ids) { instancerData.InstanceIds = ids->getData(); instancerData.InstanceIdsType = AnariToUsdBridgeType(ids->getType()); } } // Invisible Ids if (paramData.indices && tempArrays->InvisIdsArray.size()) { instancerData.InvisibleIds = tempArrays->InvisIdsArray.data(); instancerData.InvisibleIdsType = UsdBridgeType::LONG; instancerData.NumInvisibleIds = tempArrays->InvisIdsArray.size(); } for(int i = 0; i < 3; ++i) instancerData.Scale.Data[i] = (geomType == GEOM_SPHERE) ? paramData.radiusConstant : paramData.scaleConstant.Data[i]; instancerData.Orientation = paramData.orientationConstant; } else { convertLinesToSticks(paramData, attributeArray, tempArrays.get()); instancerData.NumPoints = tempArrays->PointsArray.size()/3; if (instancerData.NumPoints > 0) { instancerData.Points = tempArrays->PointsArray.data(); instancerData.PointsType = UsdBridgeType::FLOAT3; instancerData.Scales = tempArrays->ScalesArray.data(); instancerData.ScalesType = UsdBridgeType::FLOAT3; instancerData.Orientations = tempArrays->OrientationsArray.data(); instancerData.OrientationsType = UsdBridgeType::FLOAT4; // Colors if (tempArrays->ColorsArray.size()) { instancerData.Colors = tempArrays->ColorsArray.data(); instancerData.ColorsType = AnariToUsdBridgeType(tempArrays->ColorsArrayType); } else if(const UsdDataArray* colors = paramData.primitiveColors) { // Per-primitive color array corresponds to per-vertex stick output instancerData.Colors = colors->getData(); instancerData.ColorsType = AnariToUsdBridgeType(colors->getType()); } // Attributes assignTempDataToAttributes(false); // Ids if (tempArrays->IdsArray.size()) { instancerData.InstanceIds = tempArrays->IdsArray.data(); instancerData.InstanceIdsType = UsdBridgeType::LONG; } } } double worldTimeStep = device->getReadParams().timeStep; double dataTimeStep = selectObjTime(paramData.timeStep, worldTimeStep); usdBridge->SetGeometryData(usdHandle, instancerData, dataTimeStep); if(isNew && geomType != GEOM_GLYPH && !instancerData.UseUsdGeomPoints) commitPrototypes(usdBridge); // Also initialize the prototype shape on the instancer geom } void UsdGeometry::updateGeomData(UsdDevice* device, UsdBridge* usdBridge, UsdBridgeCurveData& curveData, bool isNew) { const UsdGeometryData& paramData = getReadParams(); reorderCurveGeometry(paramData, attributeArray, tempArrays.get()); curveData.NumPoints = tempArrays->PointsArray.size() / 3; if (curveData.NumPoints > 0) { curveData.Points = tempArrays->PointsArray.data(); curveData.PointsType = UsdBridgeType::FLOAT3; curveData.CurveLengths = tempArrays->CurveLengths.data(); curveData.NumCurveLengths = tempArrays->CurveLengths.size(); if (tempArrays->NormalsArray.size()) { curveData.Normals = tempArrays->NormalsArray.data(); curveData.NormalsType = UsdBridgeType::FLOAT3; } curveData.PerPrimNormals = false;// Always vertex colored as per reorderCurveGeometry. One entry per whole curve would be useless // Attributes assignTempDataToAttributes(false); // Copy colors if (tempArrays->ColorsArray.size()) { curveData.Colors = tempArrays->ColorsArray.data(); curveData.ColorsType = AnariToUsdBridgeType(tempArrays->ColorsArrayType); } curveData.PerPrimColors = false; // Always vertex colored as per reorderCurveGeometry. One entry per whole curve would be useless // Assign scales if (tempArrays->ScalesArray.size()) { curveData.Scales = tempArrays->ScalesArray.data(); curveData.ScalesType = UsdBridgeType::FLOAT; } curveData.UniformScale = paramData.radiusConstant; } double worldTimeStep = device->getReadParams().timeStep; double dataTimeStep = selectObjTime(paramData.timeStep, worldTimeStep); usdBridge->SetGeometryData(usdHandle, curveData, dataTimeStep); } template<typename UsdGeomType> bool UsdGeometry::commitTemplate(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); const UsdGeometryData& paramData = getReadParams(); const char* debugName = getName(); UsdGeomType geomData; syncAttributeArrays(); initializeGeomData(geomData); copyAttributeArraysToData(geomData); bool isNew = false; if (!usdHandle.value) { isNew = usdBridge->CreateGeometry(debugName, usdHandle, geomData); } if (paramChanged || isNew) { if (paramData.vertexPositions) { if(checkGeomParams(device)) updateGeomData(device, usdBridge, geomData, isNew); } else { device->reportStatus(this, ANARI_GEOMETRY, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdGeometry '%s' commit failed: missing 'vertex.position'.", debugName); } paramChanged = false; } return isNew; } void UsdGeometry::commitPrototypes(UsdBridge* usdBridge) { UsdBridgeInstancerRefData instancerRefData; initializeGeomRefData(instancerRefData); usdBridge->SetPrototypeData(usdHandle, instancerRefData); } bool UsdGeometry::deferCommit(UsdDevice* device) { return false; } bool UsdGeometry::doCommitData(UsdDevice* device) { if(geomType == GEOM_UNKNOWN) return false; bool isNew = false; switch (geomType) { case GEOM_TRIANGLE: isNew = commitTemplate<UsdBridgeMeshData>(device); break; case GEOM_QUAD: isNew = commitTemplate<UsdBridgeMeshData>(device); break; case GEOM_SPHERE: isNew = commitTemplate<UsdBridgeInstancerData>(device); break; case GEOM_CYLINDER: isNew = commitTemplate<UsdBridgeInstancerData>(device); break; case GEOM_CONE: isNew = commitTemplate<UsdBridgeInstancerData>(device); break; case GEOM_GLYPH: isNew = commitTemplate<UsdBridgeInstancerData>(device); break; case GEOM_CURVE: isNew = commitTemplate<UsdBridgeCurveData>(device); break; default: break; } return geomType == GEOM_GLYPH && (isNew || protoShapeChanged); // Defer commit of prototypes until the geometry refs are in place } void UsdGeometry::doCommitRefs(UsdDevice* device) { assert(geomType == GEOM_GLYPH && protoShapeChanged); UsdBridge* usdBridge = device->getUsdBridge(); const UsdGeometryData& paramData = getReadParams(); double worldTimeStep = device->getReadParams().timeStep; // Make sure the references are updated on the Bridge side. if (paramData.shapeGeometry) { double geomObjTimeStep = paramData.shapeGeometry->getReadParams().timeStep; UsdGeometryHandle protoGeomHandle = paramData.shapeGeometry->getUsdHandle(); size_t numHandles = 1; double protoTimestep = selectRefTime(paramData.shapeGeometryRefTimeStep, geomObjTimeStep, worldTimeStep); usdBridge->SetPrototypeRefs(usdHandle, &protoGeomHandle, numHandles, worldTimeStep, &protoTimestep ); } else { usdBridge->DeletePrototypeRefs(usdHandle, worldTimeStep); } // Now set the prototype relations to the reference paths (Bridge uses paths from SetPrototypeRefs) commitPrototypes(usdBridge); protoShapeChanged = false; }
NVIDIA-Omniverse/AnariUsdDevice/UsdGroup.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdGroup.h" #include "UsdAnari.h" #include "UsdDataArray.h" #include "UsdDevice.h" #include "UsdSurface.h" #include "UsdVolume.h" #define SurfaceType ANARI_SURFACE #define VolumeType ANARI_VOLUME using SurfaceUsdType = AnariToUsdBridgedObject<SurfaceType>::Type; using VolumeUsdType = AnariToUsdBridgedObject<VolumeType>::Type; DEFINE_PARAMETER_MAP(UsdGroup, REGISTER_PARAMETER_MACRO("name", ANARI_STRING, name) REGISTER_PARAMETER_MACRO("usd::name", ANARI_STRING, usdName) REGISTER_PARAMETER_MACRO("usd::timeVarying", ANARI_INT32, timeVarying) REGISTER_PARAMETER_MACRO("surface", ANARI_ARRAY, surfaces) REGISTER_PARAMETER_MACRO("volume", ANARI_ARRAY, volumes) ) constexpr UsdGroup::ComponentPair UsdGroup::componentParamNames[]; // Workaround for C++14's lack of inlining constexpr arrays UsdGroup::UsdGroup(const char* name, UsdDevice* device) : BridgedBaseObjectType(ANARI_GROUP, name, device) { } UsdGroup::~UsdGroup() { #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME if(cachedBridge) cachedBridge->DeleteGroup(usdHandle); #endif } void UsdGroup::remove(UsdDevice* device) { applyRemoveFunc(device, &UsdBridge::DeleteGroup); } bool UsdGroup::deferCommit(UsdDevice* device) { const UsdGroupData& paramData = getReadParams(); if(UsdObjectNotInitialized<SurfaceUsdType>(paramData.surfaces) || UsdObjectNotInitialized<VolumeUsdType>(paramData.volumes)) { return true; } return false; } bool UsdGroup::doCommitData(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); bool isNew = false; if (!usdHandle.value) isNew = usdBridge->CreateGroup(getName(), usdHandle); if (paramChanged || isNew) { doCommitRefs(device); // Perform immediate commit of refs - no params from children required paramChanged = false; } return false; } void UsdGroup::doCommitRefs(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); const UsdGroupData& paramData = getReadParams(); double timeStep = device->getReadParams().timeStep; UsdLogInfo logInfo(device, this, ANARI_GROUP, this->getName()); bool surfacesTimeVarying = isTimeVarying(UsdGroupComponents::SURFACES); bool volumesTimeVarying = isTimeVarying(UsdGroupComponents::VOLUMES); ManageRefArray<SurfaceType, ANARISurface, UsdSurface>(usdHandle, paramData.surfaces, surfacesTimeVarying, timeStep, surfaceHandles, &UsdBridge::SetSurfaceRefs, &UsdBridge::DeleteSurfaceRefs, usdBridge, logInfo, "UsdGroup commit failed: 'surface' array elements should be of type ANARI_SURFACE"); ManageRefArray<VolumeType, ANARIVolume, UsdVolume>(usdHandle, paramData.volumes, volumesTimeVarying, timeStep, volumeHandles, &UsdBridge::SetVolumeRefs, &UsdBridge::DeleteVolumeRefs, usdBridge, logInfo, "UsdGroup commit failed: 'volume' array elements should be of type ANARI_VOLUME"); }
NVIDIA-Omniverse/AnariUsdDevice/UsdFrame.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBaseObject.h" #include "UsdParameterizedObject.h" class UsdRenderer; class UsdWorld; struct UsdFrameData { UsdWorld* world = nullptr; UsdRenderer* renderer = nullptr; UsdUint2 size = {0, 0}; ANARIDataType color = ANARI_UNKNOWN; ANARIDataType depth = ANARI_UNKNOWN; }; class UsdFrame : public UsdParameterizedBaseObject<UsdFrame, UsdFrameData> { public: UsdFrame(UsdBridge* bridge); ~UsdFrame(); void remove(UsdDevice* device) override {} const void* mapBuffer(const char* channel, uint32_t *width, uint32_t *height, ANARIDataType *pixelType); void unmapBuffer(const char* channel); void saveUsd(UsdDevice* device); protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override {} char* ReserveBuffer(ANARIDataType format); char* mappedColorMem = nullptr; char* mappedDepthMem = nullptr; };
NVIDIA-Omniverse/AnariUsdDevice/UsdCamera.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdCamera.h" #include "UsdAnari.h" #include "UsdDataArray.h" #include "UsdDevice.h" DEFINE_PARAMETER_MAP(UsdCamera, REGISTER_PARAMETER_MACRO("name", ANARI_STRING, name) REGISTER_PARAMETER_MACRO("usd::name", ANARI_STRING, usdName) REGISTER_PARAMETER_MACRO("usd::timeVarying", ANARI_INT32, timeVarying) REGISTER_PARAMETER_MACRO("position", ANARI_FLOAT32_VEC3, position) REGISTER_PARAMETER_MACRO("direction", ANARI_FLOAT32_VEC3, direction) REGISTER_PARAMETER_MACRO("up", ANARI_FLOAT32_VEC3, up) REGISTER_PARAMETER_MACRO("imageRegion", ANARI_FLOAT32_BOX2, imageRegion) REGISTER_PARAMETER_MACRO("aspect", ANARI_FLOAT32, aspect) REGISTER_PARAMETER_MACRO("near", ANARI_FLOAT32, near) REGISTER_PARAMETER_MACRO("far", ANARI_FLOAT32, far) REGISTER_PARAMETER_MACRO("fovy", ANARI_FLOAT32, fovy) REGISTER_PARAMETER_MACRO("height", ANARI_FLOAT32, height) ) constexpr UsdCamera::ComponentPair UsdCamera::componentParamNames[]; // Workaround for C++14's lack of inlining constexpr arrays UsdCamera::UsdCamera(const char* name, const char* type, UsdDevice* device) : BridgedBaseObjectType(ANARI_CAMERA, name, device) { if(strEquals(type, "perspective")) cameraType = CAMERA_PERSPECTIVE; else if(strEquals(type, "orthographic")) cameraType = CAMERA_ORTHOGRAPHIC; } UsdCamera::~UsdCamera() { #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME if(cachedBridge) cachedBridge->DeleteGroup(usdHandle); #endif } void UsdCamera::remove(UsdDevice* device) { applyRemoveFunc(device, &UsdBridge::DeleteCamera); } bool UsdCamera::deferCommit(UsdDevice* device) { return false; } void UsdCamera::copyParameters(UsdBridgeCameraData& camData) { typedef UsdBridgeCameraData::DataMemberId DMI; const UsdCameraData& paramData = getReadParams(); camData.Position = paramData.position; camData.Direction = paramData.direction; camData.Up = paramData.up; camData.ImageRegion = paramData.imageRegion; camData.Aspect = paramData.aspect; camData.Near = paramData.near; camData.Far = paramData.far; camData.Fovy = paramData.fovy; camData.Height = paramData.height; camData.TimeVarying = DMI::ALL & (isTimeVarying(CType::VIEW) ? DMI::ALL : ~DMI::VIEW) & (isTimeVarying(CType::PROJECTION) ? DMI::ALL : ~DMI::PROJECTION); } bool UsdCamera::doCommitData(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); const UsdCameraData& paramData = getReadParams(); double timeStep = device->getReadParams().timeStep; bool isNew = false; if (!usdHandle.value) isNew = usdBridge->CreateCamera(getName(), usdHandle); if (paramChanged || isNew) { UsdBridgeCameraData camData; copyParameters(camData); usdBridge->SetCameraData(usdHandle, camData, timeStep); paramChanged = false; } return false; }
NVIDIA-Omniverse/AnariUsdDevice/UsdBaseObject.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "helium/utility/IntrusivePtr.h" #include "UsdCommonMacros.h" #include "UsdParameterizedObject.h" class UsdDevice; // Base parameterized class without being derived as such - nontemplated to allow for polymorphic use class UsdBaseObject : public helium::RefCounted { public: // If device != 0, the object is added to the commit list UsdBaseObject(ANARIDataType t, UsdDevice* device = nullptr); virtual void filterSetParam( const char *name, ANARIDataType type, const void *mem, UsdDevice* device) = 0; virtual void filterResetParam( const char *name) = 0; virtual void resetAllParams() = 0; virtual void* getParameter(const char* name, ANARIDataType& returnType) = 0; virtual int getProperty(const char *name, ANARIDataType type, void *mem, uint64_t size, UsdDevice* device) = 0; virtual void commit(UsdDevice* device) = 0; virtual void remove(UsdDevice* device) = 0; // Remove any committed data and refs ANARIDataType getType() const { return type; } protected: virtual bool deferCommit(UsdDevice* device) = 0; // Returns whether data commit has to be deferred virtual bool doCommitData(UsdDevice* device) = 0; // Data commit, execution can be immediate, returns whether doCommitRefs has to be performed virtual void doCommitRefs(UsdDevice* device) = 0; // For updates with dependencies on referenced object's data, is always executed deferred ANARIDataType type; friend class UsdDevice; }; // Templated base implementation of parameterized object template<typename T, typename D> class UsdParameterizedBaseObject : public UsdBaseObject, public UsdParameterizedObject<T, D> { public: typedef UsdParameterizedObject<T, D> ParamClass; UsdParameterizedBaseObject(ANARIDataType t, UsdDevice* device = nullptr) : UsdBaseObject(t, device) {} void filterSetParam( const char *name, ANARIDataType type, const void *mem, UsdDevice* device) override { ParamClass::setParam(name, type, mem, device); } void filterResetParam( const char *name) override { ParamClass::resetParam(name); } void resetAllParams() override { ParamClass::resetParams(); } void* getParameter(const char* name, ANARIDataType& returnType) override { return ParamClass::getParam(name, returnType); } int getProperty(const char *name, ANARIDataType type, void *mem, uint64_t size, UsdDevice* device) override { return 0; } void commit(UsdDevice* device) override { ParamClass::transferWriteToReadParams(); UsdBaseObject::commit(device); } // Convenience functions for commonly used name property virtual const char* getName() const { return ""; } protected: // Convenience functions for commonly used name property bool setNameParam(const char *name, ANARIDataType type, const void *mem, UsdDevice* device) { const char* objectName = static_cast<const char*>(mem); if (type == ANARI_STRING) { if (strEquals(name, "name")) { if (!objectName || strEquals(objectName, "")) { reportStatusThroughDevice(UsdLogInfo(device, this, ANARI_OBJECT, nullptr), ANARI_SEVERITY_WARNING, ANARI_STATUS_NO_ERROR, "%s: ANARI object %s cannot be an empty string, using auto-generated name instead.", getName(), "name"); } else { ParamClass::setParam(name, type, mem, device); ParamClass::setParam("usd::name", type, mem, device); this->formatUsdName(this->getWriteParams().usdName); } return true; } else if (strEquals(name, "usd::name")) { reportStatusThroughDevice(UsdLogInfo(device, this, ANARI_OBJECT, nullptr), ANARI_SEVERITY_WARNING, ANARI_STATUS_NO_ERROR, "%s parameter '%s' cannot be set, only read with getProperty().", getName(), "usd::name"); return true; } } return false; } int getNameProperty(const char *name, ANARIDataType type, void *mem, uint64_t size, UsdDevice* device) { if (type == ANARI_STRING && strEquals(name, "usd::name")) { snprintf((char*)mem, size, "%s", UsdSharedString::c_str(this->getReadParams().usdName)); return 1; } else if (type == ANARI_UINT64 && strEquals(name, "usd::name.size")) { if (Assert64bitStringLengthProperty(size, UsdLogInfo(device, this, ANARI_ARRAY, this->getName()), "usd::name.size")) { uint64_t nameLen = this->getReadParams().usdName ? strlen(this->getReadParams().usdName->c_str())+1 : 0; memcpy(mem, &nameLen, size); } return 1; } return 0; } };
NVIDIA-Omniverse/AnariUsdDevice/UsdAnari.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridgeData.h" #include "UsdCommonMacros.h" #include "anari/frontend/anari_enums.h" #include "anari/anari_cpp/Traits.h" #include <cstring> class UsdDevice; class UsdDataArray; class UsdFrame; class UsdGeometry; class UsdGroup; class UsdInstance; class UsdLight; class UsdMaterial; class UsdRenderer; class UsdSurface; class UsdSampler; class UsdSpatialField; class UsdVolume; class UsdWorld; class UsdCamera; class UsdSharedString; class UsdBaseObject; struct UsdDataLayout; namespace anari { ANARI_TYPEFOR_SPECIALIZATION(UsdUint2, ANARI_UINT32_VEC2); ANARI_TYPEFOR_SPECIALIZATION(UsdFloat2, ANARI_FLOAT32_VEC2); ANARI_TYPEFOR_SPECIALIZATION(UsdFloat3, ANARI_FLOAT32_VEC3); ANARI_TYPEFOR_SPECIALIZATION(UsdFloat4, ANARI_FLOAT32_VEC4); ANARI_TYPEFOR_SPECIALIZATION(UsdQuaternion, ANARI_FLOAT32_QUAT_IJKW); ANARI_TYPEFOR_SPECIALIZATION(UsdFloatMat4, ANARI_FLOAT32_MAT4); ANARI_TYPEFOR_SPECIALIZATION(UsdFloatBox1, ANARI_FLOAT32_BOX1); ANARI_TYPEFOR_SPECIALIZATION(UsdFloatBox2, ANARI_FLOAT32_BOX2); ANARI_TYPEFOR_SPECIALIZATION(UsdSharedString*, ANARI_STRING); ANARI_TYPEFOR_SPECIALIZATION(UsdDataArray*, ANARI_ARRAY); ANARI_TYPEFOR_SPECIALIZATION(UsdFrame*, ANARI_FRAME); ANARI_TYPEFOR_SPECIALIZATION(UsdGeometry*, ANARI_GEOMETRY); ANARI_TYPEFOR_SPECIALIZATION(UsdGroup*, ANARI_GROUP); ANARI_TYPEFOR_SPECIALIZATION(UsdInstance*, ANARI_INSTANCE); ANARI_TYPEFOR_SPECIALIZATION(UsdLight*, ANARI_LIGHT); ANARI_TYPEFOR_SPECIALIZATION(UsdMaterial*, ANARI_MATERIAL); ANARI_TYPEFOR_SPECIALIZATION(UsdRenderer*, ANARI_RENDERER); ANARI_TYPEFOR_SPECIALIZATION(UsdSampler*, ANARI_SAMPLER); ANARI_TYPEFOR_SPECIALIZATION(UsdSpatialField*, ANARI_SPATIAL_FIELD); ANARI_TYPEFOR_SPECIALIZATION(UsdSurface*, ANARI_SURFACE); ANARI_TYPEFOR_SPECIALIZATION(UsdVolume*, ANARI_VOLUME); ANARI_TYPEFOR_SPECIALIZATION(UsdWorld*, ANARI_WORLD); } // Shared convenience functions namespace { inline bool strEquals(const char* arg0, const char* arg1) { return strcmp(arg0, arg1) == 0; } template <typename T> inline void writeToVoidP(void *_p, T v) { T *p = (T *)_p; *p = v; } } // Standard log info struct UsdLogInfo { UsdLogInfo(UsdDevice* dev, void* src, ANARIDataType srcType, const char* srcName) : device(dev) , source(src) , sourceType(srcType) , sourceName(srcName) {} UsdDevice* device = nullptr; void* source = nullptr; ANARIDataType sourceType = ANARI_VOID_POINTER; const char* sourceName = nullptr; }; void reportStatusThroughDevice(const UsdLogInfo& logInfo, ANARIStatusSeverity severity, ANARIStatusCode statusCode, const char *format, const char* firstArg, const char* secondArg); // In case #include <UsdDevice.h> is undesired #ifdef CHECK_MEMLEAKS void logAllocationThroughDevice(UsdDevice* device, const void* ptr, ANARIDataType ptrType); void logDeallocationThroughDevice(UsdDevice* device, const void* ptr, ANARIDataType ptrType); #endif // Anari <=> USD conversions UsdBridgeType AnariToUsdBridgeType(ANARIDataType anariType); UsdBridgeType AnariToUsdBridgeType_Flattened(ANARIDataType anariType); const char* AnariTypeToString(ANARIDataType anariType); const char* AnariAttributeToUsdName(const char* param, bool perInstance, const UsdLogInfo& logInfo); UsdBridgeMaterialData::AlphaModes AnariToUsdAlphaMode(const char* alphaMode); ANARIStatusSeverity UsdBridgeLogLevelToAnariSeverity(UsdBridgeLogLevel level); bool Assert64bitStringLengthProperty(uint64_t size, const UsdLogInfo& logInfo, const char* propName); bool AssertOneDimensional(const UsdDataLayout& layout, const UsdLogInfo& logInfo, const char* arrayName); bool AssertNoStride(const UsdDataLayout& layout, const UsdLogInfo& logInfo, const char* arrayName); bool AssertArrayType(UsdDataArray* dataArray, ANARIDataType dataType, const UsdLogInfo& logInfo, const char* errorMessage); // Template definitions template<typename AnariType> class AnariToUsdObject {}; template<int AnariType> class AnariToUsdBridgedObject {}; template<int AnariType> class AnariToUsdBaseObject {}; #define USDBRIDGE_DEFINE_OBJECT_MAPPING(AnariType, UsdType) \ template<>\ class AnariToUsdObject<AnariType>\ {\ public:\ using Type = UsdType;\ }; #define USDBRIDGE_DEFINE_BASE_OBJECT_MAPPING(AnariType, UsdType) \ template<>\ class AnariToUsdBaseObject<(int)AnariType>\ {\ public:\ using Type = UsdType;\ }; #define USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(AnariType, UsdType)\ template<>\ class AnariToUsdBridgedObject<(int)AnariType>\ {\ public:\ using Type = UsdType;\ };\ template<>\ class AnariToUsdBaseObject<(int)AnariType>\ {\ public:\ using Type = UsdType;\ }; USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIObject, UsdBaseObject) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIDevice, UsdDevice) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIArray, UsdDataArray) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIArray1D, UsdDataArray) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIArray2D, UsdDataArray) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIArray3D, UsdDataArray) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIFrame, UsdFrame) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIGeometry, UsdGeometry) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIGroup, UsdGroup) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIInstance, UsdInstance) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARILight, UsdLight) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIMaterial, UsdMaterial) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARISampler, UsdSampler) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARISurface, UsdSurface) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIRenderer, UsdRenderer) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARISpatialField, UsdSpatialField) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIVolume, UsdVolume) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARIWorld, UsdWorld) USDBRIDGE_DEFINE_OBJECT_MAPPING(ANARICamera, UsdCamera) USDBRIDGE_DEFINE_BASE_OBJECT_MAPPING(ANARI_DEVICE, UsdDevice) USDBRIDGE_DEFINE_BASE_OBJECT_MAPPING(ANARI_ARRAY, UsdDataArray) USDBRIDGE_DEFINE_BASE_OBJECT_MAPPING(ANARI_ARRAY1D, UsdDataArray) USDBRIDGE_DEFINE_BASE_OBJECT_MAPPING(ANARI_ARRAY2D, UsdDataArray) USDBRIDGE_DEFINE_BASE_OBJECT_MAPPING(ANARI_ARRAY3D, UsdDataArray) USDBRIDGE_DEFINE_BASE_OBJECT_MAPPING(ANARI_FRAME, UsdFrame) USDBRIDGE_DEFINE_BASE_OBJECT_MAPPING(ANARI_RENDERER, UsdRenderer) USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(ANARI_GEOMETRY, UsdGeometry) USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(ANARI_GROUP, UsdGroup) USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(ANARI_INSTANCE, UsdInstance) USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(ANARI_LIGHT, UsdLight) USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(ANARI_MATERIAL, UsdMaterial) USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(ANARI_SURFACE, UsdSurface) USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(ANARI_SAMPLER, UsdSampler) USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(ANARI_SPATIAL_FIELD, UsdSpatialField) USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(ANARI_VOLUME, UsdVolume) USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(ANARI_WORLD, UsdWorld) USDBRIDGE_DEFINE_BRIDGED_OBJECT_MAPPING(ANARI_CAMERA, UsdCamera) template<typename AnariType> typename AnariToUsdObject<AnariType>::Type* AnariToUsdObjectPtr(AnariType object) { return (typename AnariToUsdObject<AnariType>::Type*) object; }
NVIDIA-Omniverse/AnariUsdDevice/usd_device_features.json
{ "info" : { "name" : "USD_DEVICE", "type" : "extension", "dependencies" : [] }, "objects" : [ { "type" : "ANARI_DEVICE", "parameters" : [ { "name" : "usd::serialize.hostName", "types" : ["ANARI_STRING"], "tags" : [], "description" : "Nucleus server name. If not present, output will be routed to local disk." }, { "name" : "usd::serialize.location", "types" : ["ANARI_STRING"], "tags" : [], "default" : "./", "description" : "USD output path" }, { "name" : "usd::serialize.newSession", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Is a new session directory created on device commit, or the last (ie. highest numbered) one reused." }, { "name" : "usd::serialize.outputBinary", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Enable binary .usd output, or ascii-based .usda" }, { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Global scene timestep" }, { "name" : "usd::writeAtCommit", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "(Experimental) Output USD as much as possible at commit of objects instead of anariRenderFrame" }, { "name" : "usd::output.material", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Output material objects." }, { "name" : "usd::output.previewSurfaceShader", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Output materials according to the USD preview surface schema" }, { "name" : "usd::output.mdlShader", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Output materials according to the Omniverse MDL schema" }, { "name" : "usd::garbageCollect", "types" : [], "tags" : [], "description" : "Instruct the USD device to remove USD output of objects that are not referenced within USD by other objects" }, { "name" : "usd::removeUnusedNames", "types" : [], "tags" : [], "description" : "Clean up the name cache for object name generation and uniqueness checks" }, { "name" : "usd::connection.logVerbosity", "types" : ["ANARI_INT32"], "tags" : [], "default" : 0, "minimum" : 0, "maximum" : 4, "description" : "Verbosity of logging information from the Nucleus connection, with the highest value being the loudest, similar to debug." }, { "name" : "usd::sceneStage", "types" : ["ANARI_VOID_POINTER"], "tags" : [], "description" : "USD stage pointer" }, { "name" : "usd::enableSaving", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Allows the USD output to be written out, or just updated in memory if disabled. Useful in conjunction with usd::sceneStage." } ] }, { "type" : "ANARI_GEOMETRY", "name" : "triangle", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the geometry object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.position", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying position bit" }, { "name" : "usd::timeVarying.normal", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying normal bit" }, { "name" : "usd::timeVarying.color", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying color bit" }, { "name" : "usd::timeVarying.index", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying index bit" }, { "name" : "usd::timeVarying.id", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying id bit" }, { "name" : "usd::timeVarying.attribute0", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute0 bit" }, { "name" : "usd::timeVarying.attribute1", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute1 bit" }, { "name" : "usd::timeVarying.attribute2", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute2 bit" }, { "name" : "usd::timeVarying.attribute3", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute3 bit" }, { "name" : "usd::attribute0.name", "types" : ["ANARI_STRING"], "tags" : [], "description" : "Alternative name for attribute0 primvar output" }, { "name" : "usd::attribute1.name", "types" : ["ANARI_STRING"], "tags" : [], "description" : "Alternative name for attribute1 primvar output" }, { "name" : "usd::attribute2.name", "types" : ["ANARI_STRING"], "tags" : [], "description" : "Alternative name for attribute2 primvar output" }, { "name" : "usd::attribute3.name", "types" : ["ANARI_STRING"], "tags" : [], "description" : "Alternative name for attribute3 primvar output" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_GEOMETRY", "name" : "quad", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the geometry object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.position", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying position bit" }, { "name" : "usd::timeVarying.normal", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying normal bit" }, { "name" : "usd::timeVarying.color", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying color bit" }, { "name" : "usd::timeVarying.index", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying index bit" }, { "name" : "usd::timeVarying.id", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying id bit" }, { "name" : "usd::timeVarying.attribute0", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute0 bit" }, { "name" : "usd::timeVarying.attribute1", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute1 bit" }, { "name" : "usd::timeVarying.attribute2", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute2 bit" }, { "name" : "usd::timeVarying.attribute3", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute3 bit" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_GEOMETRY", "name" : "sphere", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the geometry object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.position", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying position bit" }, { "name" : "usd::timeVarying.color", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying color bit" }, { "name" : "usd::timeVarying.index", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying index bit" }, { "name" : "usd::timeVarying.radius", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying radius bit" }, { "name" : "usd::timeVarying.id", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying id bit" }, { "name" : "usd::timeVarying.attribute0", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute0 bit" }, { "name" : "usd::timeVarying.attribute1", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute1 bit" }, { "name" : "usd::timeVarying.attribute2", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute2 bit" }, { "name" : "usd::timeVarying.attribute3", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute3 bit" }, { "name" : "usd::useUsdGeomPoints", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "For sphere geometries, use UsdGeomPoints instead of UsdGeomPointInstancer to represent the spheres. Cannot be changed after the first commit." }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_GEOMETRY", "name" : "cone", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the geometry object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.position", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying position bit" }, { "name" : "usd::timeVarying.color", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying color bit" }, { "name" : "usd::timeVarying.index", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying index bit" }, { "name" : "usd::timeVarying.radius", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying radius bit" }, { "name" : "usd::timeVarying.id", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying id bit" }, { "name" : "usd::timeVarying.attribute0", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute0 bit" }, { "name" : "usd::timeVarying.attribute1", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute1 bit" }, { "name" : "usd::timeVarying.attribute2", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute2 bit" }, { "name" : "usd::timeVarying.attribute3", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute3 bit" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_GEOMETRY", "name" : "cylinder", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the geometry object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.position", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying position bit" }, { "name" : "usd::timeVarying.color", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying color bit" }, { "name" : "usd::timeVarying.index", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying index bit" }, { "name" : "usd::timeVarying.radius", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying radius bit" }, { "name" : "usd::timeVarying.id", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying id bit" }, { "name" : "usd::timeVarying.attribute0", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute0 bit" }, { "name" : "usd::timeVarying.attribute1", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute1 bit" }, { "name" : "usd::timeVarying.attribute2", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute2 bit" }, { "name" : "usd::timeVarying.attribute3", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute3 bit" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_GEOMETRY", "name" : "curve", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the geometry object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.position", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying position bit" }, { "name" : "usd::timeVarying.color", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying color bit" }, { "name" : "usd::timeVarying.index", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying index bit" }, { "name" : "usd::timeVarying.radius", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying radius bit" }, { "name" : "usd::timeVarying.id", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying id bit" }, { "name" : "usd::timeVarying.attribute0", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute0 bit" }, { "name" : "usd::timeVarying.attribute1", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute1 bit" }, { "name" : "usd::timeVarying.attribute2", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute2 bit" }, { "name" : "usd::timeVarying.attribute3", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute3 bit" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_GEOMETRY", "name" : "glyph", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the geometry object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.position", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying position bit" }, { "name" : "usd::timeVarying.color", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying color bit" }, { "name" : "usd::timeVarying.index", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying index bit" }, { "name" : "usd::timeVarying.scale", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying scale bit" }, { "name" : "usd::timeVarying.orientation", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying orientation bit" }, { "name" : "usd::timeVarying.id", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying id bit" }, { "name" : "usd::timeVarying.attribute0", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute0 bit" }, { "name" : "usd::timeVarying.attribute1", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute1 bit" }, { "name" : "usd::timeVarying.attribute2", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute2 bit" }, { "name" : "usd::timeVarying.attribute3", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying attribute3 bit" }, { "name" : "usd::time.shapeGeometry", "types" : ["ANARI_INT32"], "tags" : [], "description" : "The timestep of the object attached to the shapeGeometry parameter of the glyph geometry, at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_MATERIAL", "name" : "matte", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the material object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.color", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying color bit" }, { "name" : "usd::time.sampler.color", "types" : ["ANARI_FLOAT64"], "tags" : [], "description" : "The timestep of the sampler object attached to the color parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::time.sampler.opacity", "types" : ["ANARI_FLOAT64"], "tags" : [], "description" : "The timestep of the sampler object attached to the opacity parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_MATERIAL", "name" : "physicallyBased", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the material object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.baseColor", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying baseColor bit" }, { "name" : "usd::timeVarying.opacity", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying opacity bit" }, { "name" : "usd::timeVarying.emissive", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying emissive bit" }, { "name" : "usd::timeVarying.roughness", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying roughness bit" }, { "name" : "usd::timeVarying.metallic", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying metallic bit" }, { "name" : "usd::timeVarying.ior", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying ior bit" }, { "name" : "usd::time.sampler.baseColor", "types" : ["ANARI_FLOAT64"], "tags" : [], "description" : "The timestep of the sampler object attached to the baseColor parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::time.sampler.opacity", "types" : ["ANARI_FLOAT64"], "tags" : [], "description" : "The timestep of the sampler object attached to the opacity parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::time.sampler.emissive", "types" : ["ANARI_FLOAT64"], "tags" : [], "description" : "The timestep of the sampler object attached to the emissive parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::time.sampler.roughness", "types" : ["ANARI_FLOAT64"], "tags" : [], "description" : "The timestep of the sampler object attached to the roughness parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::time.sampler.metallic", "types" : ["ANARI_FLOAT64"], "tags" : [], "description" : "The timestep of the sampler object attached to the metallic parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::time.sampler.ior", "types" : ["ANARI_FLOAT64"], "tags" : [], "description" : "The timestep of the sampler object attached to the ior parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_SPATIAL_FIELD", "name" : "structuredRegular", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the spatialfield object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.data", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying data bit" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_SAMPLER", "name" : "image1D", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the sampler object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.image", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying image/imageUrl bit" }, { "name" : "usd::timeVarying.wrapMode", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying wrapMode bit" }, { "name" : "usd::imageUrl", "types" : ["ANARI_STRING"], "tags" : [], "description" : "Location of an image which will directly be written into the USD sampler" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_SAMPLER", "name" : "image2D", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the sampler object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.image", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying image/imageUrl bit" }, { "name" : "usd::timeVarying.wrapMode1", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying wrapMode1 bit" }, { "name" : "usd::timeVarying.wrapMode2", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying wrapMode2 bit" }, { "name" : "usd::imageUrl", "types" : ["ANARI_STRING"], "tags" : [], "description" : "Location of an image which will directly be written into the USD sampler" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_SAMPLER", "name" : "image3D", "parameters" : [ { "name" : "usd::time", "types" : ["ANARI_FLOAT64"], "tags" : [], "default" : 0.0, "description" : "Timestep of the sampler object" }, { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.image", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying image/imageUrl bit" }, { "name" : "usd::timeVarying.wrapMode1", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying wrapMode1 bit" }, { "name" : "usd::timeVarying.wrapMode2", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying wrapMode2 bit" }, { "name" : "usd::timeVarying.wrapMode3", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Time varying wrapMode3 bit" }, { "name" : "usd::imageUrl", "types" : ["ANARI_STRING"], "tags" : [], "description" : "Location of an image which will directly be written into the USD sampler" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_VOLUME", "name" : "transferFunction1D", "parameters" : [ { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.color", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying color bit" }, { "name" : "usd::timeVarying.opacity", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying opacity bit" }, { "name" : "usd::timeVarying.valueRange", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying valueRange bit" }, { "name" : "usd::preClassified", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Use preclassification to produce a VDB grid with a color and opacity field, instead of a density field" }, { "name" : "usd::time.value", "types" : ["ANARI_FLOAT64"], "tags" : [], "description" : "The timestep of the object attached to the value parameter of the volume, at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_WORLD", "parameters" : [ { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.instance", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying instance bit" }, { "name" : "usd::timeVarying.surface", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying surface bit" }, { "name" : "usd::timeVarying.volume", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying volume bit" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_INSTANCE", "parameters" : [ { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.group", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying group bit" }, { "name" : "usd::timeVarying.transform", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying transform bit" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_GROUP", "parameters" : [ { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.surface", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying surface bit" }, { "name" : "usd::timeVarying.volume", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying volume bit" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_SURFACE", "parameters" : [ { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::time.geometry", "types" : ["ANARI_FLOAT64"], "tags" : [], "description" : "The timestep of the object attached to the geometry parameter of the surface, at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::time.material", "types" : ["ANARI_FLOAT64"], "tags" : [], "description" : "The timestep of the object attached to the material parameter of the surface, at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset." }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] }, { "type" : "ANARI_CAMERA", "name" : "perspective", "description" : "perspective camera object", "parameters" : [ { "name" : "usd::timeVarying", "types" : ["ANARI_INT32"], "tags" : [], "description" : "Time varying bitfield" }, { "name" : "usd::timeVarying.view", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying view matrix bit" }, { "name" : "usd::timeVarying.projection", "types" : ["ANARI_BOOL"], "tags" : [], "default" : true, "description" : "Time varying projection matrix bit" }, { "name" : "usd::removePrim", "types" : ["ANARI_BOOL"], "tags" : [], "default" : false, "description" : "Explicitly delete prim from USD output after commit" } ] } ] }
NVIDIA-Omniverse/AnariUsdDevice/UsdWorld.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdWorld.h" #include "UsdAnari.h" #include "UsdInstance.h" #include "UsdSurface.h" #include "UsdVolume.h" #include "UsdDevice.h" #include "UsdDataArray.h" #include "UsdGroup.h" #define InstanceType ANARI_INSTANCE #define SurfaceType ANARI_SURFACE #define VolumeType ANARI_VOLUME using InstanceUsdType = AnariToUsdBridgedObject<InstanceType>::Type; using SurfaceUsdType = AnariToUsdBridgedObject<SurfaceType>::Type; using VolumeUsdType = AnariToUsdBridgedObject<VolumeType>::Type; DEFINE_PARAMETER_MAP(UsdWorld, REGISTER_PARAMETER_MACRO("name", ANARI_STRING, name) REGISTER_PARAMETER_MACRO("usd::name", ANARI_STRING, usdName) REGISTER_PARAMETER_MACRO("usd::timeVarying", ANARI_INT32, timeVarying) REGISTER_PARAMETER_MACRO("instance", ANARI_ARRAY, instances) REGISTER_PARAMETER_MACRO("surface", ANARI_ARRAY, surfaces) REGISTER_PARAMETER_MACRO("volume", ANARI_ARRAY, volumes) ) constexpr UsdWorld::ComponentPair UsdWorld::componentParamNames[]; // Workaround for C++14's lack of inlining constexpr arrays UsdWorld::UsdWorld(const char* name, UsdDevice* device) : BridgedBaseObjectType(ANARI_WORLD, name, device) { } UsdWorld::~UsdWorld() { #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME if(cachedBridge) cachedBridge->DeleteWorld(usdHandle); #endif } void UsdWorld::remove(UsdDevice* device) { applyRemoveFunc(device, &UsdBridge::DeleteWorld); } bool UsdWorld::deferCommit(UsdDevice* device) { const UsdWorldData& paramData = getReadParams(); if(UsdObjectNotInitialized<InstanceUsdType>(paramData.instances) || UsdObjectNotInitialized<SurfaceUsdType>(paramData.surfaces) || UsdObjectNotInitialized<VolumeUsdType>(paramData.volumes)) { return true; } return false; } bool UsdWorld::doCommitData(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); const char* objName = getName(); bool isNew = false; if(!usdHandle.value) isNew = usdBridge->CreateWorld(objName, usdHandle); if (paramChanged || isNew) { doCommitRefs(device); // Perform immediate commit of refs - no params from children required paramChanged = false; } return false; } void UsdWorld::doCommitRefs(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); const UsdWorldData& paramData = getReadParams(); double timeStep = device->getReadParams().timeStep; const char* objName = getName(); bool instancesTimeVarying = isTimeVarying(UsdWorldComponents::INSTANCES); bool surfacesTimeVarying = isTimeVarying(UsdWorldComponents::SURFACES); bool volumesTimeVarying = isTimeVarying(UsdWorldComponents::VOLUMES); UsdLogInfo logInfo(device, this, ANARI_WORLD, this->getName()); ManageRefArray<InstanceType, ANARIInstance, UsdInstance>(usdHandle, paramData.instances, instancesTimeVarying, timeStep, instanceHandles, &UsdBridge::SetInstanceRefs, &UsdBridge::DeleteInstanceRefs, usdBridge, logInfo, "UsdWorld commit failed: 'instance' array elements should be of type ANARI_INSTANCE"); ManageRefArray<SurfaceType, ANARISurface, UsdSurface>(usdHandle, paramData.surfaces, surfacesTimeVarying, timeStep, surfaceHandles, &UsdBridge::SetSurfaceRefs, &UsdBridge::DeleteSurfaceRefs, usdBridge, logInfo, "UsdGroup commit failed: 'surface' array elements should be of type ANARI_SURFACE"); ManageRefArray<VolumeType, ANARIVolume, UsdVolume>(usdHandle, paramData.volumes, volumesTimeVarying, timeStep, volumeHandles, &UsdBridge::SetVolumeRefs, &UsdBridge::DeleteVolumeRefs, usdBridge, logInfo, "UsdGroup commit failed: 'volume' array elements should be of type ANARI_VOLUME"); }
NVIDIA-Omniverse/AnariUsdDevice/UsdSurface.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdSurface.h" #include "UsdAnari.h" #include "UsdDevice.h" #include "UsdMaterial.h" #include "UsdGeometry.h" #define GeometryType ANARI_GEOMETRY #define MaterialType ANARI_MATERIAL using GeometryUsdType = AnariToUsdBridgedObject<GeometryType>::Type; using MaterialUsdType = AnariToUsdBridgedObject<MaterialType>::Type; DEFINE_PARAMETER_MAP(UsdSurface, REGISTER_PARAMETER_MACRO("name", ANARI_STRING, name) REGISTER_PARAMETER_MACRO("usd::name", ANARI_STRING, usdName) REGISTER_PARAMETER_MACRO("usd::time.geometry", ANARI_FLOAT64, geometryRefTimeStep) REGISTER_PARAMETER_MACRO("usd::time.material", ANARI_FLOAT64, materialRefTimeStep) REGISTER_PARAMETER_MACRO("geometry", GeometryType, geometry) REGISTER_PARAMETER_MACRO("material", MaterialType, material) ) UsdSurface::UsdSurface(const char* name, UsdDevice* device) : BridgedBaseObjectType(ANARI_SURFACE, name, device) { } UsdSurface::~UsdSurface() { #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME // Given that the object is destroyed, none of its references to other objects // has to be updated anymore. if(cachedBridge) cachedBridge->DeleteSurface(usdHandle); #endif } void UsdSurface::remove(UsdDevice* device) { applyRemoveFunc(device, &UsdBridge::DeleteSurface); } bool UsdSurface::deferCommit(UsdDevice* device) { // Given that all handles/data are used in doCommitRefs, which is always executed deferred, we don't need to check for initialization //const UsdSurfaceData& paramData = getReadParams(); //if(UsdObjectNotInitialized<GeometryUsdType>(paramData.geometry) || UsdObjectNotInitialized<MaterialUsdType>(paramData.material)) //{ // return true; //} return false; } bool UsdSurface::doCommitData(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); bool isNew = false; if (!usdHandle.value) isNew = usdBridge->CreateSurface(getName(), usdHandle); if (paramChanged || isNew) { paramChanged = false; return true; // In this case a doCommitRefs is required, with data (timesteps, handles) from children } return false; } void UsdSurface::doCommitRefs(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); const UsdSurfaceData& paramData = getReadParams(); double worldTimeStep = device->getReadParams().timeStep; // Make sure the references are updated on the Bridge side. if (paramData.geometry) { double geomObjTimeStep = paramData.geometry->getReadParams().timeStep; if(device->getReadParams().outputMaterial && paramData.material) { double matObjTimeStep = paramData.material->getReadParams().timeStep; // The geometry to which a material binds has an effect on attribute reader (geom primvar) names, and output types paramData.material->updateBoundParameters(paramData.geometry->isInstanced(), device); usdBridge->SetGeometryMaterialRef(usdHandle, paramData.geometry->getUsdHandle(), paramData.material->getUsdHandle(), worldTimeStep, selectRefTime(paramData.geometryRefTimeStep, geomObjTimeStep, worldTimeStep), selectRefTime(paramData.materialRefTimeStep, matObjTimeStep, worldTimeStep) ); } else { usdBridge->SetGeometryRef(usdHandle, paramData.geometry->getUsdHandle(), worldTimeStep, selectRefTime(paramData.geometryRefTimeStep, geomObjTimeStep, worldTimeStep) ); usdBridge->DeleteMaterialRef(usdHandle, worldTimeStep); } } else { usdBridge->DeleteGeometryRef(usdHandle, worldTimeStep); if (!paramData.material && device->getReadParams().outputMaterial) { usdBridge->DeleteMaterialRef(usdHandle, worldTimeStep); } } }
NVIDIA-Omniverse/AnariUsdDevice/LICENSE.txt
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
NVIDIA-Omniverse/AnariUsdDevice/UsdCommonMacros.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridge/Common/UsdBridgeMacros.h" //#define OBJECT_LIFETIME_EQUALS_USD_LIFETIME #ifndef NDEBUG // This is now handled in CMake //#define CHECK_MEMLEAKS //asserts at ~UsdDevice() if memleak found #endif
NVIDIA-Omniverse/AnariUsdDevice/UsdVolume.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdVolume.h" #include "UsdAnari.h" #include "UsdDevice.h" #include "UsdSpatialField.h" #include "UsdDataArray.h" DEFINE_PARAMETER_MAP(UsdVolume, REGISTER_PARAMETER_MACRO("name", ANARI_STRING, name) REGISTER_PARAMETER_MACRO("usd::name", ANARI_STRING, usdName) REGISTER_PARAMETER_MACRO("usd::timeVarying", ANARI_INT32, timeVarying) REGISTER_PARAMETER_MACRO("usd::preClassified", ANARI_BOOL, preClassified) REGISTER_PARAMETER_MACRO("usd::time.value", ANARI_FLOAT64, fieldRefTimeStep) REGISTER_PARAMETER_MACRO("value", ANARI_SPATIAL_FIELD, field) REGISTER_PARAMETER_MACRO("color", ANARI_ARRAY, color) REGISTER_PARAMETER_MACRO("opacity", ANARI_ARRAY, opacity) REGISTER_PARAMETER_MACRO("valueRange", ANARI_FLOAT32_BOX1, valueRange) REGISTER_PARAMETER_MACRO("unitDistance", ANARI_FLOAT32, unitDistance) ) constexpr UsdVolume::ComponentPair UsdVolume::componentParamNames[]; // Workaround for C++14's lack of inlining constexpr arrays namespace { void GatherTfData(const UsdVolumeData& paramData, UsdBridgeTfData& tfData) { // Get transfer function data const UsdDataArray* tfColor = paramData.color; const UsdDataArray* tfOpacity = paramData.opacity; UsdBridgeType tfColorType = AnariToUsdBridgeType(tfColor->getType()); UsdBridgeType tfOpacityType = AnariToUsdBridgeType(tfOpacity->getType()); // Write to struct tfData.TfColors = tfColor->getData(); tfData.TfColorsType = tfColorType; tfData.TfNumColors = (int)(tfColor->getLayout().numItems1); tfData.TfOpacities = tfOpacity->getData(); tfData.TfOpacitiesType = tfOpacityType; tfData.TfNumOpacities = (int)(tfOpacity->getLayout().numItems1); tfData.TfValueRange[0] = paramData.valueRange.Data[0]; tfData.TfValueRange[1] = paramData.valueRange.Data[1]; } } UsdVolume::UsdVolume(const char* name, UsdDevice* device) : BridgedBaseObjectType(ANARI_VOLUME, name, device) , usdDevice(device) { usdDevice->addToVolumeList(this); } UsdVolume::~UsdVolume() { usdDevice->removeFromVolumeList(this); #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME // Given that the object is destroyed, none of its references to other objects // has to be updated anymore. if(cachedBridge) cachedBridge->DeleteVolume(usdHandle); #endif } void UsdVolume::remove(UsdDevice* device) { applyRemoveFunc(device, &UsdBridge::DeleteVolume); } bool UsdVolume::CheckTfParams(UsdDevice* device) { const UsdVolumeData& paramData = getReadParams(); const char* debugName = getName(); UsdLogInfo logInfo(device, this, ANARI_VOLUME, debugName); // Only perform data(type) checks, data upload along with field in UsdVolume::commit() const UsdDataArray* tfColor = paramData.color; if (paramData.color == nullptr) { device->reportStatus(this, ANARI_VOLUME, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdVolume '%s' commit failed: transferfunction color array not set.", debugName); return false; } const UsdDataArray* tfOpacity = paramData.opacity; if (tfOpacity == nullptr) { device->reportStatus(this, ANARI_VOLUME, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdVolume '%s' commit failed: transferfunction opacity not set.", debugName); return false; } if (!AssertOneDimensional(tfColor->getLayout(), logInfo, "tfColor")) { device->reportStatus(this, ANARI_VOLUME, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdVolume '%s' commit failed: transferfunction color array not one-dimensional.", debugName); return false; } if (!AssertOneDimensional(tfOpacity->getLayout(), logInfo, "tfOpacity")) { device->reportStatus(this, ANARI_VOLUME, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdVolume '%s' commit failed: transferfunction opacity array not one-dimensional.", debugName); return false; } if (paramData.preClassified && tfColor->getType() != ANARI_FLOAT32_VEC3) { device->reportStatus(this, ANARI_VOLUME, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdVolume '%s' commit failed: transferfunction color array needs to be of type ANARI_FLOAT32_VEC3 when preClassified is set.", debugName); return false; } if (tfOpacity->getType() != ANARI_FLOAT32) { device->reportStatus(this, ANARI_VOLUME, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdVolume '%s' commit failed: transferfunction opacity array needs to be of type ANARI_FLOAT32.", debugName); return false; } if (tfColor->getLayout().numItems1 != tfOpacity->getLayout().numItems1) { device->reportStatus(this, ANARI_VOLUME, ANARI_SEVERITY_WARNING, ANARI_STATUS_INVALID_ARGUMENT, "UsdVolume '%s' commit warning: transferfunction output merges colors and opacities into one array, so they should contain the same number of elements.", debugName); } return true; } bool UsdVolume::UpdateVolume(UsdDevice* device, const char* debugName) { UsdBridge* usdBridge = device->getUsdBridge(); const UsdVolumeData& paramData = getReadParams(); UsdSpatialField* field = paramData.field; if (!CheckTfParams(device)) return false; // Get field data const UsdSpatialFieldData& fieldParams = field->getReadParams(); const UsdDataArray* fieldDataArray = fieldParams.data; if(!fieldDataArray) return false; // Enforced in field commit() const UsdDataLayout& posLayout = fieldDataArray->getLayout(); UsdBridgeType fieldDataType = AnariToUsdBridgeType(fieldDataArray->getType()); //Set bridge volumedata UsdBridgeVolumeData volumeData; volumeData.Data = fieldDataArray->getData(); volumeData.DataType = fieldDataType; size_t* elts = volumeData.NumElements; float* ori = volumeData.Origin; float* celldims = volumeData.CellDimensions; elts[0] = posLayout.numItems1; elts[1] = posLayout.numItems2; elts[2] = posLayout.numItems3; ori[0] = fieldParams.gridOrigin[0]; ori[1] = fieldParams.gridOrigin[1]; ori[2] = fieldParams.gridOrigin[2]; celldims[0] = fieldParams.gridSpacing[0]; celldims[1] = fieldParams.gridSpacing[1]; celldims[2] = fieldParams.gridSpacing[2]; GatherTfData(paramData, volumeData.TfData); // Set whether we want to output source data or preclassified colored volumes volumeData.preClassified = paramData.preClassified; typedef UsdBridgeVolumeData::DataMemberId DMI; volumeData.TimeVarying = DMI::ALL & (field->isTimeVarying(UsdSpatialFieldComponents::DATA) ? DMI::ALL : ~DMI::DATA) & (isTimeVarying(CType::COLOR) ? DMI::ALL : ~DMI::TFCOLORS) & (isTimeVarying(CType::OPACITY) ? DMI::ALL : ~DMI::TFOPACITIES) & (isTimeVarying(CType::VALUERANGE) ? DMI::ALL : ~DMI::TFVALUERANGE); double worldTimeStep = device->getReadParams().timeStep; double fieldTimeStep = selectRefTime(paramData.fieldRefTimeStep, fieldParams.timeStep, worldTimeStep); // use the link time, as there is no such thing as separate field data usdBridge->SetSpatialFieldData(field->getUsdHandle(), volumeData, fieldTimeStep); return true; } bool UsdVolume::deferCommit(UsdDevice* device) { // The spatial field may not yet have been committed, but the volume reads data from its params during commit. So always defer until flushing of commit list. return !device->isFlushingCommitList(); } bool UsdVolume::doCommitData(UsdDevice* device) { const UsdVolumeData& paramData = getReadParams(); UsdBridge* usdBridge = device->getUsdBridge(); bool isNew = false; if (!usdHandle.value) isNew = usdBridge->CreateVolume(getName(), usdHandle); const char* debugName = getName(); if (prevField != paramData.field) { double worldTimeStep = device->getReadParams().timeStep; // Make sure the references are updated on the Bridge side. if (paramData.field) { const UsdSpatialFieldData& fieldParams = paramData.field->getReadParams(); usdBridge->SetSpatialFieldRef(usdHandle, paramData.field->getUsdHandle(), worldTimeStep, selectRefTime(paramData.fieldRefTimeStep, fieldParams.timeStep, worldTimeStep) ); } else { usdBridge->DeleteSpatialFieldRef(usdHandle, worldTimeStep); } prevField = paramData.field; } // Regardless of whether tf param changes, field params or the vol reference itself, UpdateVolume is required. if (paramChanged || paramData.field->paramChanged) { if(paramData.field) { UpdateVolume(device, debugName); paramChanged = false; paramData.field->paramChanged = false; } else { device->reportStatus(this, ANARI_VOLUME, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdVolume '%s' commit failed: field reference missing.", debugName); } } return false; }
NVIDIA-Omniverse/AnariUsdDevice/CMakeLists.txt
## Copyright 2020 The Khronos Group ## SPDX-License-Identifier: Apache-2.0 cmake_minimum_required(VERSION 3.17) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_BUILD_TYPE_INIT "Release") set(CMAKE_INSTALL_RPATH "$ORIGIN") set(CMAKE_POSITION_INDEPENDENT_CODE ON) ## Top-level project ## set(USD_DEVICE_VERSION_MAJOR 0) set(USD_DEVICE_VERSION_MINOR 2) set(USD_DEVICE_VERSION_PATCH 0) set(USD_DEVICE_VERSION ${USD_DEVICE_VERSION_MAJOR}.${USD_DEVICE_VERSION_MINOR}.${USD_DEVICE_VERSION_PATCH}) if(NOT USD_DEVICE_BUILD_VERSION_EXPLICIT) if(EXISTS ${CMAKE_SOURCE_DIR}/.git) find_package(Git REQUIRED) execute_process( COMMAND ${GIT_EXECUTABLE} rev-list --count HEAD WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE "USD_DEVICE_BUILD_VERSION" ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ) else() set(USD_DEVICE_BUILD_VERSION -1) endif() else() set(USD_DEVICE_BUILD_VERSION ${USD_DEVICE_BUILD_VERSION_EXPLICIT}) endif() message(STATUS "DEVICE VERSION: ${USD_DEVICE_VERSION} build ${USD_DEVICE_BUILD_VERSION}") project(AnariUsdDevice VERSION ${USD_DEVICE_VERSION} LANGUAGES C CXX) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) include(GNUInstallDirs) add_subdirectory(thirdparty) ## Dependencies ## if (NOT EXISTS ${ANARI_ROOT_DIR}) find_path(ANARI_ROOT_DIR NAMES include/anari/anari.h DOC "Path to ANARI SDK") endif() set(ANARI_CONFIG_SUBDIR "release") if(CMAKE_BUILD_TYPE MATCHES "Debug") set(ANARI_CONFIG_SUBDIR "debug") endif() if (EXISTS "${ANARI_ROOT_DIR}/${ANARI_CONFIG_SUBDIR}") set(ANARI_ROOT_DIR "${ANARI_ROOT_DIR}/${ANARI_CONFIG_SUBDIR}") endif() if (NOT EXISTS ${ANARI_ROOT_DIR}) message(FATAL_ERROR "No valid ANARI_ROOT_DIR set, or found using CMAKE_PREFIX_PATH: ${ANARI_ROOT_DIR}") else() message(STATUS "Using ANARI_ROOT_DIR: ${ANARI_ROOT_DIR}") endif() # Search in config mode find_package(anari 0.7 REQUIRED PATHS ${ANARI_ROOT_DIR} ) ## Code generation if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.12") list(PREPEND CMAKE_MODULE_PATH ${Python_ROOT_DIR}) find_package(Python REQUIRED COMPONENTS Interpreter Development) list(POP_FRONT CMAKE_MODULE_PATH) add_custom_target(generate_usd_queries COMMAND ${Python3_EXECUTABLE} ${ANARI_CODE_GEN_ROOT}/generate_queries.py --json ${ANARI_CODE_GEN_ROOT} --json ${CMAKE_CURRENT_SOURCE_DIR} --prefix UsdDevice --device ${CMAKE_CURRENT_SOURCE_DIR}/usd_device.json --namespace anari::usd WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS usd_device.json usd_device_features.json khr_geometry_glyph.json ) add_custom_target(generate_all) add_dependencies(generate_all generate_usd_queries) endif() ## Core UsdBridge ## # Compile defs required by all subdirs option(USD_DEVICE_TIME_BASED_OUTPUT "Allow use of timesamples for timevarying properties, but no retiming (so all timesteps are global)" ON) if(USD_DEVICE_TIME_BASED_OUTPUT) list(APPEND USD_DEVICE_TIME_DEFS -DTIME_BASED_CACHING) option(USD_DEVICE_VALUE_CLIP_OUTPUT "Retiming of timesteps through value clips for selected objects, resulting in separate USD files for those objects" ON) if(USD_DEVICE_VALUE_CLIP_OUTPUT) list(APPEND USD_DEVICE_TIME_DEFS -DVALUE_CLIP_RETIMING) option(USD_DEVICE_CLIP_STAGE_OUTPUT "Separate clip stages for each timestep for selected objects, resulting in a single USD file per timestep" ON) if(USD_DEVICE_CLIP_STAGE_OUTPUT) list(APPEND USD_DEVICE_TIME_DEFS -DTIME_CLIP_STAGES) endif() endif() endif() add_subdirectory(UsdBridge) ## Build USD Device ## set(USDModule_SOURCES UsdAnari.cpp UsdBaseObject.cpp UsdDevice.cpp UsdDataArray.cpp UsdGeometry.cpp UsdSurface.cpp UsdGroup.cpp UsdSpatialField.cpp UsdVolume.cpp UsdInstance.cpp UsdLibrary.cpp UsdSampler.cpp UsdMaterial.cpp UsdWorld.cpp UsdRenderer.cpp UsdFrame.cpp UsdLight.cpp UsdCamera.cpp UsdDeviceQueries.cpp) set(USDModule_HEADERS UsdCommonMacros.h UsdAnari.h UsdDeviceUtils.h UsdMultiTypeParameter.h UsdParameterizedObject.h UsdDevice.h UsdBaseObject.h UsdSharedObjects.h UsdBridgedBaseObject.h UsdDataArray.h UsdGeometry.h UsdSurface.h UsdGroup.h UsdSpatialField.h UsdVolume.h UsdInstance.h UsdSampler.h UsdMaterial.h UsdWorld.h UsdRenderer.h UsdFrame.h UsdLight.h UsdCamera.h) add_library(anari_library_usd SHARED ${USDModule_SOURCES} ${USDModule_HEADERS}) target_compile_definitions(anari_library_usd PRIVATE -DDEVICE_VERSION_BUILD=${USD_DEVICE_BUILD_VERSION} -DDEVICE_VERSION_MAJOR=${USD_DEVICE_VERSION_MAJOR} -DDEVICE_VERSION_MINOR=${USD_DEVICE_VERSION_MINOR} -DDEVICE_VERSION_PATCH=${USD_DEVICE_VERSION_PATCH} -DDEVICE_VERSION_NAME="${USD_DEVICE_VERSION}" ${USD_DEVICE_TIME_DEFS}) option(CHECK_OBJECT_REFERENCES "Perform a memory check on the reference count of all objects allocated by a USD device, avoiding memleaks and double deletion." OFF) if(CHECK_OBJECT_REFERENCES) target_compile_definitions(anari_library_usd PRIVATE -DCHECK_MEMLEAKS) endif() target_link_libraries(anari_library_usd PUBLIC anari::anari PRIVATE anari::helium UsdBridge ) option(USD_DEVICE_BUILD_EXAMPLES "Build USD device examples" OFF) if(USD_DEVICE_BUILD_EXAMPLES) add_subdirectory(examples) endif() install(TARGETS anari_library_usd LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ## Install optional pdbs ## install(FILES $<TARGET_PDB_FILE:anari_library_usd> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) option(INSTALL_ANARI_DEPS "Enable install of ANARI SDK dependencies along with USD device" OFF) # Not truly a dependency of the USD Device, generally one wants to build against ANARI source, not just libs if(${INSTALL_ANARI_DEPS}) set(PLATFORM_INSTALL_LIBDIR "$<$<NOT:$<PLATFORM_ID:Windows>>:${CMAKE_INSTALL_LIBDIR}>$<$<PLATFORM_ID:Windows>:${CMAKE_INSTALL_BINDIR}>/") install( DIRECTORY "${ANARI_ROOT_DIR}/lib/" DESTINATION ${PLATFORM_INSTALL_LIBDIR} PATTERN "*${CMAKE_STATIC_LIBRARY_SUFFIX}" EXCLUDE) install( DIRECTORY "${ANARI_ROOT_DIR}/bin/" DESTINATION ${PLATFORM_INSTALL_LIBDIR} FILES_MATCHING PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}*") endif()
NVIDIA-Omniverse/AnariUsdDevice/UsdBridgedBaseObject.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBaseObject.h" #include "UsdBridge/UsdBridge.h" #include "UsdDevice.h" #include "UsdDataArray.h" #include <cmath> #include <utility> enum class UsdEmptyComponents { }; template<typename T, typename D, typename H, typename C = UsdEmptyComponents> class UsdBridgedBaseObject : public UsdParameterizedBaseObject<T, D> { protected: using CType = C; // Timevarying helper functions (classes workaround to allow for partial specialization) template<typename IT, typename ID, typename IH, typename IC> class TimeVaryingClass { public: bool findTimeVarying(const char* name, IC& component) { for(auto& cmpName : IT::componentParamNames) { if(strEquals(name, cmpName.second)) { component = cmpName.first; return true; } } return false; } void setTimeVarying(UsdBridgedBaseObject<IT,ID,IH,IC>* bridgedObj, IC component, bool value) { ID& params = bridgedObj->getWriteParams(); int bit = (1 << static_cast<int>(component)); params.timeVarying = value ? (params.timeVarying | bit) : (params.timeVarying & ~bit); } }; template<typename IT, typename ID, typename IH> class TimeVaryingClass<IT, ID, IH, UsdEmptyComponents> { public: bool findTimeVarying(const char* name, UsdEmptyComponents& component) { return false; } void setTimeVarying(UsdBridgedBaseObject<IT,ID,IH,UsdEmptyComponents>* bridgedObj, UsdEmptyComponents component, bool value) { } }; bool setTimeVaryingParam(const char *name, ANARIDataType type, const void *mem, UsdDevice* device) { static const char* paramName = "usd::timeVarying."; bool value = *(reinterpret_cast<const uint32_t*>(mem)); if (type == ANARI_BOOL) { if (strcmp(name, paramName) > 0) { const char* secondPart = name + strlen(paramName); C component; TimeVaryingClass<T,D,H,C> timevarHelper; if(timevarHelper.findTimeVarying(secondPart, component)) { timevarHelper.setTimeVarying(this, component, value); return true; } } } return false; } bool isTimeVarying(C component) const { const D& params = this->getReadParams(); return params.timeVarying & (1 << static_cast<int>(component)); } bool setRemovePrimParam(const char *name, ANARIDataType type, const void *mem, UsdDevice* device) { if (type == ANARI_BOOL) { if (strcmp(name, "usd::removePrim") == 0) { removePrim = true; return true; } } return false; } public: using ComponentPair = std::pair<C, const char*>; // Used to define a componentParamNames UsdBridgedBaseObject(ANARIDataType t, const char* name, UsdDevice* device) : UsdParameterizedBaseObject<T, D>(t, device) , uniqueName(name) { } H getUsdHandle() const { return usdHandle; } const char* getName() const override { return this->getReadParams().usdName ? this->getReadParams().usdName->c_str() : uniqueName; } void filterSetParam(const char *name, ANARIDataType type, const void *mem, UsdDevice* device) override { if(!this->setTimeVaryingParam(name, type, mem, device)) if (!this->setNameParam(name, type, mem, device)) if(!this->setRemovePrimParam(name, type, mem, device)) this->setParam(name, type, mem, device); } int getProperty(const char *name, ANARIDataType type, void *mem, uint64_t size, UsdDevice* device) override { int nameResult = this->getNameProperty(name, type, mem, size, device); if(!nameResult) { UsdBridge* usdBridge = device->getUsdBridge(); if(!usdBridge) { reportStatusThroughDevice(UsdLogInfo(device, this, ANARI_OBJECT, nullptr), ANARI_SEVERITY_WARNING, ANARI_STATUS_NO_ERROR, "%s parameter '%s' cannot be read with getProperty(); it requires a succesful device parameter commit.", getName(), name); } if (type == ANARI_STRING && strEquals(name, "usd::primPath")) { const char* primPath = usdBridge->GetPrimPath(&usdHandle); snprintf((char*)mem, size, "%s", primPath); return 1; } else if (type == ANARI_UINT64 && strEquals(name, "usd::primPath.size")) { if (Assert64bitStringLengthProperty(size, UsdLogInfo(device, this, ANARI_OBJECT, this->getName()), "usd::primPath.size")) { const char* primPath = usdBridge->GetPrimPath(&usdHandle); uint64_t nameLen = strlen(primPath)+1; memcpy(mem, &nameLen, size); } return 1; } } return nameResult; } virtual void commit(UsdDevice* device) override { #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME cachedBridge = device->getUsdBridge(); #endif UsdParameterizedBaseObject<T, D>::commit(device); } double selectObjTime(double objTimeStep, double worldTimeStep) { return #ifdef VALUE_CLIP_RETIMING !std::isnan(objTimeStep) ? objTimeStep : #endif worldTimeStep; } double selectRefTime(double refTimeStep, double objTimeStep, double worldTimeStep) { return #ifdef VALUE_CLIP_RETIMING !std::isnan(refTimeStep) ? refTimeStep : (!std::isnan(objTimeStep) ? objTimeStep : worldTimeStep); #else worldTimeStep; #endif } bool getRemovePrim() const { return removePrim; } protected: typedef UsdBridgedBaseObject<T,D,H,C> BridgedBaseObjectType; typedef void (UsdBridge::*UsdBridgeMemFn)(H handle); void applyRemoveFunc(UsdDevice* device, UsdBridgeMemFn func) { UsdBridge* usdBridge = device->getUsdBridge(); if(usdBridge && usdHandle.value) (usdBridge->*func)(usdHandle); } const char* uniqueName; H usdHandle; bool removePrim = false; #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME UsdBridge* cachedBridge = nullptr; #endif }; template<typename T, typename D, typename H, typename C> inline bool UsdObjectNotInitialized(const UsdBridgedBaseObject<T,D,H,C>* obj) { return obj && !obj->getUsdHandle().value; } template<typename T> inline bool UsdObjectNotInitialized(UsdDataArray* objects) { if (!objects) return false; bool notInitialized = false; if(anari::isObject(objects->getType())) { const T* const * object = reinterpret_cast<const T* const *>(objects->getData()); uint64_t numObjects = objects->getLayout().numItems1; for(int i = 0; i < numObjects; ++i) { notInitialized = notInitialized || UsdObjectNotInitialized(object[i]); } } return notInitialized; }
NVIDIA-Omniverse/AnariUsdDevice/usd_device.json
{ "info" : { "name" : "usd_device", "type" : "device", "dependencies" : [ "anari_core_1_0", "anari_core_objects_base_1_0", "khr_geometry_cone", "khr_geometry_curve", "khr_geometry_cylinder", "khr_geometry_quad", "khr_geometry_sphere", "khr_geometry_triangle", "khr_geometry_glyph", "khr_camera_perspective", "khr_instance_transform", "khr_material_matte", "khr_material_physically_based", "khr_sampler_image1d", "khr_sampler_image2d", "khr_sampler_image3d", "khr_spatial_field_structured_regular", "khr_volume_transfer_function1d", "usd_device_features" ] } }
NVIDIA-Omniverse/AnariUsdDevice/UsdGroup.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridgedBaseObject.h" #include "UsdBridge.h" class UsdDevice; class UsdDataArray; enum class UsdGroupComponents { SURFACES = 0, VOLUMES }; struct UsdGroupData { UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; int timeVarying = 0xFFFFFFFF; // Bitmask indicating which attributes are time-varying. UsdDataArray* surfaces = nullptr; UsdDataArray* volumes = nullptr; }; class UsdGroup : public UsdBridgedBaseObject<UsdGroup, UsdGroupData, UsdGroupHandle, UsdGroupComponents> { public: UsdGroup(const char* name, UsdDevice* device); ~UsdGroup(); void remove(UsdDevice* device) override; static constexpr ComponentPair componentParamNames[] = { ComponentPair(UsdGroupComponents::SURFACES, "surface"), ComponentPair(UsdGroupComponents::VOLUMES, "volume")}; protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override; std::vector<UsdSurfaceHandle> surfaceHandles; // for convenience std::vector<UsdVolumeHandle> volumeHandles; // for convenience }; typedef void (UsdBridge::*SetRefFunc)(UsdGroupHandle, const UsdSurfaceHandle*, uint64_t, bool, double); template<int ChildAnariTypeEnum, typename ChildAnariType, typename ChildUsdType, typename ParentHandleType, typename ChildHandleType> void ManageRefArray(ParentHandleType parentHandle, UsdDataArray* childArray, bool refsTimeVarying, double timeStep, std::vector<ChildHandleType>& tempChildHandles, void (UsdBridge::*SetRefFunc)(ParentHandleType, const ChildHandleType*, uint64_t, bool, double), void (UsdBridge::*DeleteRefFunc)(ParentHandleType, bool, double), UsdBridge* usdBridge, UsdLogInfo& logInfo, const char* typeErrorMsg) { bool validRefs = AssertArrayType(childArray, ChildAnariTypeEnum, logInfo, typeErrorMsg); if(validRefs) { if (childArray) { const ChildAnariType* children = reinterpret_cast<const ChildAnariType*>(childArray->getData()); uint64_t numChildren = childArray->getLayout().numItems1; tempChildHandles.resize(numChildren); for (uint64_t i = 0; i < numChildren; ++i) { const ChildUsdType* usdChild = reinterpret_cast<const ChildUsdType*>(children[i]); tempChildHandles[i] = usdChild->getUsdHandle(); } (usdBridge->*SetRefFunc)(parentHandle, tempChildHandles.data(), numChildren, refsTimeVarying, timeStep); } else { (usdBridge->*DeleteRefFunc)(parentHandle, refsTimeVarying, timeStep); } } }
NVIDIA-Omniverse/AnariUsdDevice/UsdLibrary.cpp
// Copyright 2023 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdDevice.h" #include "anari/backend/LibraryImpl.h" #ifndef USDDevice_INTERFACE #define USDDevice_INTERFACE #endif namespace anari { namespace usd { const char **query_extensions(); struct UsdLibrary : public anari::LibraryImpl { UsdLibrary(void *lib, ANARIStatusCallback defaultStatusCB, const void *statusCBPtr); ANARIDevice newDevice(const char *subtype) override; const char **getDeviceExtensions(const char *deviceType) override; }; // Definitions //////////////////////////////////////////////////////////////// UsdLibrary::UsdLibrary(void *lib, ANARIStatusCallback defaultStatusCB, const void *statusCBPtr) : anari::LibraryImpl(lib, defaultStatusCB, statusCBPtr) {} ANARIDevice UsdLibrary::newDevice(const char * /*subtype*/) { return (ANARIDevice) new UsdDevice(this_library()); } const char **UsdLibrary::getDeviceExtensions(const char * /*deviceType*/) { return query_extensions(); } } // namespace usd } // namespace anari // Define library entrypoint ////////////////////////////////////////////////// extern "C" USDDevice_INTERFACE ANARI_DEFINE_LIBRARY_ENTRYPOINT(usd, handle, scb, scbPtr) { return (ANARILibrary) new anari::usd::UsdLibrary(handle, scb, scbPtr); }
NVIDIA-Omniverse/AnariUsdDevice/UsdAnari.cpp
#include "UsdAnari.h" #include "UsdDevice.h" #include "UsdDataArray.h" #include "anari/frontend/type_utility.h" UsdBridgeType AnariToUsdBridgeType(ANARIDataType anariType) { switch (anariType) { case ANARI_UINT8: return UsdBridgeType::UCHAR; case ANARI_UINT8_VEC2: return UsdBridgeType::UCHAR2; case ANARI_UINT8_VEC3: return UsdBridgeType::UCHAR3; case ANARI_UINT8_VEC4: return UsdBridgeType::UCHAR4; case ANARI_INT8: return UsdBridgeType::CHAR; case ANARI_INT8_VEC2: return UsdBridgeType::CHAR2; case ANARI_INT8_VEC3: return UsdBridgeType::CHAR3; case ANARI_INT8_VEC4: return UsdBridgeType::CHAR4; case ANARI_UFIXED8: return UsdBridgeType::UCHAR; case ANARI_UFIXED8_VEC2: return UsdBridgeType::UCHAR2; case ANARI_UFIXED8_VEC3: return UsdBridgeType::UCHAR3; case ANARI_UFIXED8_VEC4: return UsdBridgeType::UCHAR4; case ANARI_FIXED8: return UsdBridgeType::CHAR; case ANARI_FIXED8_VEC2: return UsdBridgeType::CHAR2; case ANARI_FIXED8_VEC3: return UsdBridgeType::CHAR3; case ANARI_FIXED8_VEC4: return UsdBridgeType::CHAR4; case ANARI_UFIXED8_R_SRGB: return UsdBridgeType::UCHAR_SRGB_R; case ANARI_UFIXED8_RA_SRGB: return UsdBridgeType::UCHAR_SRGB_RA; case ANARI_UFIXED8_RGB_SRGB: return UsdBridgeType::UCHAR_SRGB_RGB; case ANARI_UFIXED8_RGBA_SRGB: return UsdBridgeType::UCHAR_SRGB_RGBA; case ANARI_UINT16: return UsdBridgeType::USHORT; case ANARI_UINT16_VEC2: return UsdBridgeType::USHORT2; case ANARI_UINT16_VEC3: return UsdBridgeType::USHORT3; case ANARI_UINT16_VEC4: return UsdBridgeType::USHORT4; case ANARI_INT16: return UsdBridgeType::SHORT; case ANARI_INT16_VEC2: return UsdBridgeType::SHORT2; case ANARI_INT16_VEC3: return UsdBridgeType::SHORT3; case ANARI_INT16_VEC4: return UsdBridgeType::SHORT4; case ANARI_UFIXED16: return UsdBridgeType::USHORT; case ANARI_UFIXED16_VEC2: return UsdBridgeType::USHORT2; case ANARI_UFIXED16_VEC3: return UsdBridgeType::USHORT3; case ANARI_UFIXED16_VEC4: return UsdBridgeType::USHORT4; case ANARI_FIXED16: return UsdBridgeType::SHORT; case ANARI_FIXED16_VEC2: return UsdBridgeType::SHORT2; case ANARI_FIXED16_VEC3: return UsdBridgeType::SHORT3; case ANARI_FIXED16_VEC4: return UsdBridgeType::SHORT4; case ANARI_UINT32: return UsdBridgeType::UINT; case ANARI_UINT32_VEC2: return UsdBridgeType::UINT2; case ANARI_UINT32_VEC3: return UsdBridgeType::UINT3; case ANARI_UINT32_VEC4: return UsdBridgeType::UINT4; case ANARI_INT32: return UsdBridgeType::INT; case ANARI_INT32_VEC2: return UsdBridgeType::INT2; case ANARI_INT32_VEC3: return UsdBridgeType::INT3; case ANARI_INT32_VEC4: return UsdBridgeType::INT4; case ANARI_UFIXED32: return UsdBridgeType::UINT; case ANARI_UFIXED32_VEC2: return UsdBridgeType::UINT2; case ANARI_UFIXED32_VEC3: return UsdBridgeType::UINT3; case ANARI_UFIXED32_VEC4: return UsdBridgeType::UINT4; case ANARI_FIXED32: return UsdBridgeType::INT; case ANARI_FIXED32_VEC2: return UsdBridgeType::INT2; case ANARI_FIXED32_VEC3: return UsdBridgeType::INT3; case ANARI_FIXED32_VEC4: return UsdBridgeType::INT4; case ANARI_UINT64: return UsdBridgeType::ULONG; case ANARI_UINT64_VEC2: return UsdBridgeType::ULONG2; case ANARI_UINT64_VEC3: return UsdBridgeType::ULONG3; case ANARI_UINT64_VEC4: return UsdBridgeType::ULONG4; case ANARI_INT64: return UsdBridgeType::LONG; case ANARI_INT64_VEC2: return UsdBridgeType::LONG2; case ANARI_INT64_VEC3: return UsdBridgeType::LONG3; case ANARI_INT64_VEC4: return UsdBridgeType::LONG4; case ANARI_FLOAT32: return UsdBridgeType::FLOAT; case ANARI_FLOAT32_VEC2: return UsdBridgeType::FLOAT2; case ANARI_FLOAT32_VEC3: return UsdBridgeType::FLOAT3; case ANARI_FLOAT32_VEC4: return UsdBridgeType::FLOAT4; case ANARI_FLOAT64: return UsdBridgeType::DOUBLE; case ANARI_FLOAT64_VEC2: return UsdBridgeType::DOUBLE2; case ANARI_FLOAT64_VEC3: return UsdBridgeType::DOUBLE3; case ANARI_FLOAT64_VEC4: return UsdBridgeType::DOUBLE4; case ANARI_INT32_BOX1: return UsdBridgeType::INT_PAIR; case ANARI_INT32_BOX2: return UsdBridgeType::INT_PAIR2; case ANARI_INT32_BOX3: return UsdBridgeType::INT_PAIR3; case ANARI_INT32_BOX4: return UsdBridgeType::INT_PAIR4; case ANARI_FLOAT32_BOX1: return UsdBridgeType::FLOAT_PAIR; case ANARI_FLOAT32_BOX2: return UsdBridgeType::FLOAT_PAIR2; case ANARI_FLOAT32_BOX3: return UsdBridgeType::FLOAT_PAIR3; case ANARI_FLOAT32_BOX4: return UsdBridgeType::FLOAT_PAIR4; case ANARI_UINT64_REGION1: return UsdBridgeType::ULONG_PAIR; case ANARI_UINT64_REGION2: return UsdBridgeType::ULONG_PAIR2; case ANARI_UINT64_REGION3: return UsdBridgeType::ULONG_PAIR3; case ANARI_UINT64_REGION4: return UsdBridgeType::ULONG_PAIR4; case ANARI_FLOAT32_MAT2: return UsdBridgeType::FLOAT_MAT2; case ANARI_FLOAT32_MAT3: return UsdBridgeType::FLOAT_MAT3; case ANARI_FLOAT32_MAT4: return UsdBridgeType::FLOAT_MAT4; case ANARI_FLOAT32_MAT2x3: return UsdBridgeType::FLOAT_MAT2x3; case ANARI_FLOAT32_MAT3x4: return UsdBridgeType::FLOAT_MAT3x4; case ANARI_FLOAT32_QUAT_IJKW: return UsdBridgeType::FLOAT4; default: return UsdBridgeType::UNDEFINED; } } UsdBridgeType AnariToUsdBridgeType_Flattened(ANARIDataType anariType) { switch (anariType) { case ANARI_UINT8: return UsdBridgeType::UCHAR; case ANARI_UINT8_VEC2: return UsdBridgeType::UCHAR; case ANARI_UINT8_VEC3: return UsdBridgeType::UCHAR; case ANARI_UINT8_VEC4: return UsdBridgeType::UCHAR; case ANARI_INT8: return UsdBridgeType::CHAR; case ANARI_INT8_VEC2: return UsdBridgeType::CHAR; case ANARI_INT8_VEC3: return UsdBridgeType::CHAR; case ANARI_INT8_VEC4: return UsdBridgeType::CHAR; case ANARI_UFIXED8: return UsdBridgeType::UCHAR; case ANARI_UFIXED8_VEC2: return UsdBridgeType::UCHAR; case ANARI_UFIXED8_VEC3: return UsdBridgeType::UCHAR; case ANARI_UFIXED8_VEC4: return UsdBridgeType::UCHAR; case ANARI_FIXED8: return UsdBridgeType::CHAR; case ANARI_FIXED8_VEC2: return UsdBridgeType::CHAR; case ANARI_FIXED8_VEC3: return UsdBridgeType::CHAR; case ANARI_FIXED8_VEC4: return UsdBridgeType::CHAR; case ANARI_UFIXED8_R_SRGB: return UsdBridgeType::UCHAR_SRGB_R; case ANARI_UFIXED8_RA_SRGB: return UsdBridgeType::UCHAR_SRGB_R; case ANARI_UFIXED8_RGB_SRGB: return UsdBridgeType::UCHAR_SRGB_R; case ANARI_UFIXED8_RGBA_SRGB: return UsdBridgeType::UCHAR_SRGB_R; case ANARI_UINT16: return UsdBridgeType::USHORT; case ANARI_UINT16_VEC2: return UsdBridgeType::USHORT; case ANARI_UINT16_VEC3: return UsdBridgeType::USHORT; case ANARI_UINT16_VEC4: return UsdBridgeType::USHORT; case ANARI_INT16: return UsdBridgeType::SHORT; case ANARI_INT16_VEC2: return UsdBridgeType::SHORT; case ANARI_INT16_VEC3: return UsdBridgeType::SHORT; case ANARI_INT16_VEC4: return UsdBridgeType::SHORT; case ANARI_UFIXED16: return UsdBridgeType::USHORT; case ANARI_UFIXED16_VEC2: return UsdBridgeType::USHORT; case ANARI_UFIXED16_VEC3: return UsdBridgeType::USHORT; case ANARI_UFIXED16_VEC4: return UsdBridgeType::USHORT; case ANARI_FIXED16: return UsdBridgeType::SHORT; case ANARI_FIXED16_VEC2: return UsdBridgeType::SHORT; case ANARI_FIXED16_VEC3: return UsdBridgeType::SHORT; case ANARI_FIXED16_VEC4: return UsdBridgeType::SHORT; case ANARI_UINT32: return UsdBridgeType::UINT; case ANARI_UINT32_VEC2: return UsdBridgeType::UINT; case ANARI_UINT32_VEC3: return UsdBridgeType::UINT; case ANARI_UINT32_VEC4: return UsdBridgeType::UINT; case ANARI_INT32: return UsdBridgeType::INT; case ANARI_INT32_VEC2: return UsdBridgeType::INT; case ANARI_INT32_VEC3: return UsdBridgeType::INT; case ANARI_INT32_VEC4: return UsdBridgeType::INT; case ANARI_UFIXED32: return UsdBridgeType::UINT; case ANARI_UFIXED32_VEC2: return UsdBridgeType::UINT; case ANARI_UFIXED32_VEC3: return UsdBridgeType::UINT; case ANARI_UFIXED32_VEC4: return UsdBridgeType::UINT; case ANARI_FIXED32: return UsdBridgeType::INT; case ANARI_FIXED32_VEC2: return UsdBridgeType::INT; case ANARI_FIXED32_VEC3: return UsdBridgeType::INT; case ANARI_FIXED32_VEC4: return UsdBridgeType::INT; case ANARI_UINT64: return UsdBridgeType::ULONG; case ANARI_UINT64_VEC2: return UsdBridgeType::ULONG; case ANARI_UINT64_VEC3: return UsdBridgeType::ULONG; case ANARI_UINT64_VEC4: return UsdBridgeType::ULONG; case ANARI_INT64: return UsdBridgeType::LONG; case ANARI_INT64_VEC2: return UsdBridgeType::LONG; case ANARI_INT64_VEC3: return UsdBridgeType::LONG; case ANARI_INT64_VEC4: return UsdBridgeType::LONG; case ANARI_FLOAT32: return UsdBridgeType::FLOAT; case ANARI_FLOAT32_VEC2: return UsdBridgeType::FLOAT; case ANARI_FLOAT32_VEC3: return UsdBridgeType::FLOAT; case ANARI_FLOAT32_VEC4: return UsdBridgeType::FLOAT; case ANARI_FLOAT64: return UsdBridgeType::DOUBLE; case ANARI_FLOAT64_VEC2: return UsdBridgeType::DOUBLE; case ANARI_FLOAT64_VEC3: return UsdBridgeType::DOUBLE; case ANARI_FLOAT64_VEC4: return UsdBridgeType::DOUBLE; case ANARI_INT32_BOX1: return UsdBridgeType::INT; case ANARI_INT32_BOX2: return UsdBridgeType::INT; case ANARI_INT32_BOX3: return UsdBridgeType::INT; case ANARI_INT32_BOX4: return UsdBridgeType::INT; case ANARI_FLOAT32_BOX1: return UsdBridgeType::FLOAT; case ANARI_FLOAT32_BOX2: return UsdBridgeType::FLOAT; case ANARI_FLOAT32_BOX3: return UsdBridgeType::FLOAT; case ANARI_FLOAT32_BOX4: return UsdBridgeType::FLOAT; case ANARI_UINT64_REGION1: return UsdBridgeType::ULONG; case ANARI_UINT64_REGION2: return UsdBridgeType::ULONG; case ANARI_UINT64_REGION3: return UsdBridgeType::ULONG; case ANARI_UINT64_REGION4: return UsdBridgeType::ULONG; case ANARI_FLOAT32_MAT2: return UsdBridgeType::FLOAT; case ANARI_FLOAT32_MAT3: return UsdBridgeType::FLOAT; case ANARI_FLOAT32_MAT4: return UsdBridgeType::FLOAT; case ANARI_FLOAT32_MAT2x3: return UsdBridgeType::FLOAT; case ANARI_FLOAT32_MAT3x4: return UsdBridgeType::FLOAT; default: return UsdBridgeType::UNDEFINED; } } template<int T> struct AnariTypeStringConverter : public anari::ANARITypeProperties<T> { const char* operator()(){ return anari::ANARITypeProperties<T>::enum_name; } }; const char* AnariTypeToString(ANARIDataType anariType) { return anari::anariTypeInvoke<const char*, AnariTypeStringConverter>(anariType); } const char* AnariAttributeToUsdName(const char* param, bool perInstance, const UsdLogInfo& logInfo) { if(strEquals(param, "worldPosition") || strEquals(param, "worldNormal")) { reportStatusThroughDevice(logInfo, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdSampler '%s' inAttribute %s not supported, use inTransform parameter on object-space attribute instead.", logInfo.sourceName, param); } if(strEquals(param, "objectPosition")) { if(perInstance) return "positions"; else return "points"; } else if(strEquals(param, "objectNormal")) { return "normals"; } //else if(!strncmp(param, "attribute", 9)) //{ // return param; //} return param; // The generic case just returns the param itself } UsdBridgeMaterialData::AlphaModes AnariToUsdAlphaMode(const char* alphaMode) { if(alphaMode) { if(strEquals(alphaMode, "blend")) { return UsdBridgeMaterialData::AlphaModes::BLEND; } else if(strEquals(alphaMode, "mask")) { return UsdBridgeMaterialData::AlphaModes::MASK; } } return UsdBridgeMaterialData::AlphaModes::NONE; } ANARIStatusSeverity UsdBridgeLogLevelToAnariSeverity(UsdBridgeLogLevel level) { ANARIStatusSeverity severity = ANARI_SEVERITY_INFO; switch (level) { case UsdBridgeLogLevel::STATUS: severity = ANARI_SEVERITY_INFO; break; case UsdBridgeLogLevel::WARNING: severity = ANARI_SEVERITY_WARNING; break; case UsdBridgeLogLevel::ERR: severity = ANARI_SEVERITY_ERROR; break; default: severity = ANARI_SEVERITY_INFO; break; } return severity; } void reportStatusThroughDevice(const UsdLogInfo& logInfo, ANARIStatusSeverity severity, ANARIStatusCode statusCode, const char *format, const char* firstArg, const char* secondArg) { if(logInfo.device) logInfo.device->reportStatus(logInfo.source, logInfo.sourceType, severity, statusCode, format, firstArg, secondArg); } #ifdef CHECK_MEMLEAKS void logAllocationThroughDevice(UsdDevice* device, const void* ptr, ANARIDataType ptrType) { if(anari::isObject(ptrType)) device->LogObjAllocation((const UsdBaseObject*)ptr); else if(ptrType == ANARI_STRING) device->LogStrAllocation((const UsdSharedString*)ptr); else device->LogRawAllocation(ptr); } void logDeallocationThroughDevice(UsdDevice* device, const void* ptr, ANARIDataType ptrType) { if(anari::isObject(ptrType)) device->LogObjDeallocation((const UsdBaseObject*)ptr); else if(ptrType == ANARI_STRING) device->LogStrDeallocation((const UsdSharedString*)ptr); else device->LogRawDeallocation(ptr); } #endif bool Assert64bitStringLengthProperty(uint64_t size, const UsdLogInfo& logInfo, const char* name) { if (size != sizeof(uint64_t) && logInfo.device) { logInfo.device->reportStatus(logInfo.source, ANARI_OBJECT, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "On object '%s', getProperty() on %s, size parameter differs from sizeof(uint64_t)", logInfo.sourceName, name); return false; } return true; } bool AssertOneDimensional(const UsdDataLayout& layout, const UsdLogInfo& logInfo, const char* arrayName) { if (!layout.isOneDimensional() && logInfo.device) { logInfo.device->reportStatus(logInfo.source, logInfo.sourceType, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "On object '%s', '%s' array has to be 1-dimensional.", logInfo.sourceName, arrayName); return false; } return true; } bool AssertNoStride(const UsdDataLayout& layout, const UsdLogInfo& logInfo, const char* arrayName) { if (!layout.isDense() && logInfo.device) { logInfo.device->reportStatus(logInfo.source, logInfo.sourceType, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "On object '%s', '%s' layout strides should all be 0.", logInfo.sourceName, arrayName); return false; } return true; } bool AssertArrayType(UsdDataArray* dataArray, ANARIDataType dataType, const UsdLogInfo& logInfo, const char* errorMessage) { if (dataArray && dataArray->getType() != dataType && logInfo.device) { logInfo.device->reportStatus(logInfo.source, logInfo.sourceType, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "On object '%s', '%s'", logInfo.sourceName, errorMessage); return false; } return true; }
NVIDIA-Omniverse/AnariUsdDevice/UsdSpatialField.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdSpatialField.h" #include "UsdAnari.h" #include "UsdDataArray.h" #include "UsdDevice.h" #include "UsdVolume.h" #include <algorithm> DEFINE_PARAMETER_MAP(UsdSpatialField, REGISTER_PARAMETER_MACRO("name", ANARI_STRING, name) REGISTER_PARAMETER_MACRO("usd::name", ANARI_STRING, usdName) REGISTER_PARAMETER_MACRO("usd::time", ANARI_FLOAT64, timeStep) REGISTER_PARAMETER_MACRO("usd::timeVarying", ANARI_INT32, timeVarying) REGISTER_PARAMETER_MACRO("data", ANARI_ARRAY, data) REGISTER_PARAMETER_MACRO("spacing", ANARI_FLOAT32_VEC3, gridSpacing) REGISTER_PARAMETER_MACRO("origin", ANARI_FLOAT32_VEC3, gridOrigin) ) // See .h for usage. constexpr UsdSpatialField::ComponentPair UsdSpatialField::componentParamNames[]; // Workaround for C++14's lack of inlining constexpr arrays UsdSpatialField::UsdSpatialField(const char* name, const char* type, UsdDevice* device) : BridgedBaseObjectType(ANARI_SPATIAL_FIELD, name, device) { } UsdSpatialField::~UsdSpatialField() { #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME if(cachedBridge) cachedBridge->DeleteSpatialField(usdHandle); #endif } void UsdSpatialField::remove(UsdDevice* device) { applyRemoveFunc(device, &UsdBridge::DeleteSpatialField); } bool UsdSpatialField::deferCommit(UsdDevice* device) { // Always defer until flushing of commit list, to give parent volumes the possibility to detect which of its child fields have been committed, // such that those volumes with committed children are also automatically committed. return !device->isFlushingCommitList(); } bool UsdSpatialField::doCommitData(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); const UsdSpatialFieldData& paramData = getReadParams(); const char* debugName = getName(); UsdLogInfo logInfo(device, this, ANARI_SPATIAL_FIELD, debugName); bool isNew = false; if(!usdHandle.value) isNew = usdBridge->CreateSpatialField(debugName, usdHandle); // Only perform type checks, actual data gets uploaded during UsdVolume::commit() const UsdDataArray* fieldDataArray = paramData.data; if (!fieldDataArray) { device->reportStatus(this, ANARI_SPATIAL_FIELD, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_OPERATION, "UsdSpatialField '%s' commit failed: data missing.", debugName); return false; } const UsdDataLayout& dataLayout = fieldDataArray->getLayout(); if (!AssertNoStride(dataLayout, logInfo, "data")) return false; switch (fieldDataArray->getType()) { case ANARI_INT8: case ANARI_UINT8: case ANARI_INT16: case ANARI_UINT16: case ANARI_INT32: case ANARI_UINT32: case ANARI_INT64: case ANARI_UINT64: case ANARI_FLOAT32: case ANARI_FLOAT64: break; default: device->reportStatus(this, ANARI_SPATIAL_FIELD, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdSpatialField '%s' commit failed: incompatible data type.", debugName); return false; } // Make sure that parameters are set a first time paramChanged = paramChanged || isNew; return false; }
NVIDIA-Omniverse/AnariUsdDevice/UsdSpatialField.h
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #pragma once #include "UsdBridgedBaseObject.h" class UsdDataArray; class UsdVolume; enum class UsdSpatialFieldComponents { DATA = 0 // includes spacing and origin }; struct UsdSpatialFieldData { UsdSharedString* name = nullptr; UsdSharedString* usdName = nullptr; double timeStep = 0.0; int timeVarying = 0xFFFFFFFF; // Bitmask indicating which attributes are time-varying. const UsdDataArray* data = nullptr; float gridSpacing[3] = {1.0f, 1.0f, 1.0f}; float gridOrigin[3] = {1.0f, 1.0f, 1.0f}; //int filter = 0; //int gradientFilter = 0; }; class UsdSpatialField : public UsdBridgedBaseObject<UsdSpatialField, UsdSpatialFieldData, UsdSpatialFieldHandle, UsdSpatialFieldComponents> { public: UsdSpatialField(const char* name, const char* type, UsdDevice* device); ~UsdSpatialField(); void remove(UsdDevice* device) override; friend class UsdVolume; static constexpr ComponentPair componentParamNames[] = { ComponentPair(UsdSpatialFieldComponents::DATA, "data")}; protected: bool deferCommit(UsdDevice* device) override; bool doCommitData(UsdDevice* device) override; void doCommitRefs(UsdDevice* device) override {} void toBridge(UsdDevice* device, const char* debugName); };
NVIDIA-Omniverse/AnariUsdDevice/UsdSampler.cpp
// Copyright 2020 The Khronos Group // SPDX-License-Identifier: Apache-2.0 #include "UsdSampler.h" #include "UsdAnari.h" #include "UsdDevice.h" #include "UsdDataArray.h" DEFINE_PARAMETER_MAP(UsdSampler, REGISTER_PARAMETER_MACRO("name", ANARI_STRING, name) REGISTER_PARAMETER_MACRO("usd::name", ANARI_STRING, usdName) REGISTER_PARAMETER_MACRO("usd::time", ANARI_FLOAT64, timeStep) REGISTER_PARAMETER_MACRO("usd::timeVarying", ANARI_INT32, timeVarying) REGISTER_PARAMETER_MACRO("usd::imageUrl", ANARI_STRING, imageUrl) REGISTER_PARAMETER_MACRO("inAttribute", ANARI_STRING, inAttribute) REGISTER_PARAMETER_MACRO("image", ANARI_ARRAY, imageData) REGISTER_PARAMETER_MACRO("wrapMode", ANARI_STRING, wrapS) REGISTER_PARAMETER_MACRO("wrapMode1", ANARI_STRING, wrapS) REGISTER_PARAMETER_MACRO("wrapMode2", ANARI_STRING, wrapT) REGISTER_PARAMETER_MACRO("wrapMode3", ANARI_STRING, wrapR) ) constexpr UsdSampler::ComponentPair UsdSampler::componentParamNames[]; // Workaround for C++14's lack of inlining constexpr arrays namespace { UsdBridgeSamplerData::WrapMode ANARIToUsdBridgeWrapMode(const char* anariWrapMode) { UsdBridgeSamplerData::WrapMode usdWrapMode = UsdBridgeSamplerData::WrapMode::BLACK; if(anariWrapMode) { if (strEquals(anariWrapMode, "clampToEdge")) { usdWrapMode = UsdBridgeSamplerData::WrapMode::CLAMP; } else if (strEquals(anariWrapMode, "repeat")) { usdWrapMode = UsdBridgeSamplerData::WrapMode::REPEAT; } else if (strEquals(anariWrapMode, "mirrorRepeat")) { usdWrapMode = UsdBridgeSamplerData::WrapMode::MIRROR; } } return usdWrapMode; } } UsdSampler::UsdSampler(const char* name, const char* type, UsdDevice* device) : BridgedBaseObjectType(ANARI_SAMPLER, name, device) { if (strEquals(type, "image1D")) samplerType = SAMPLER_1D; else if (strEquals(type, "image2D")) samplerType = SAMPLER_2D; else if (strEquals(type, "image3D")) samplerType = SAMPLER_3D; else device->reportStatus(this, ANARI_SAMPLER, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdSampler '%s' construction failed: type %s not supported", getName(), name); } UsdSampler::~UsdSampler() { #ifdef OBJECT_LIFETIME_EQUALS_USD_LIFETIME if(cachedBridge) cachedBridge->DeleteSampler(usdHandle); #endif } void UsdSampler::remove(UsdDevice* device) { applyRemoveFunc(device, &UsdBridge::DeleteSampler); } void UsdSampler::updateBoundParameters(bool boundToInstance, UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); if(!usdHandle.value) return; if(perInstance != boundToInstance) { // Fix up the position attribute const UsdSamplerData& paramData = getReadParams(); const char* inAttribName = UsdSharedString::c_str(paramData.inAttribute); if(inAttribName && strEquals(inAttribName, "objectPosition")) { // In case of a per-instance specific attribute name, there can be only one change of the attribute name. UsdLogInfo logInfo(device, this, ANARI_SAMPLER, getName()); if(instanceAttributeAttached) { reportStatusThroughDevice(logInfo, ANARI_SEVERITY_WARNING, ANARI_STATUS_INVALID_ARGUMENT, "UsdSampler '%s' binds its inAttribute parameter to %s, but is transitively bound to both an instanced geometry (cones, spheres, cylinders) and regular geometry. \ This is incompatible with USD, which demands a differently bound name for those categories. \ Please create two different samplers and bind each to only one of both categories of geometry. \ The inAttribute value will be updated, but may therefore invalidate previous bindings to the objectPosition attribute.", logInfo.sourceName, "'objectPosition'"); } instanceAttributeAttached = true; const char* usdAttribName = AnariAttributeToUsdName(inAttribName, perInstance, logInfo); double worldTimeStep = device->getReadParams().timeStep; double dataTimeStep = selectObjTime(paramData.timeStep, worldTimeStep); UsdBridgeSamplerData::DataMemberId timeVarying; setSamplerTimeVarying(timeVarying); usdBridge->ChangeInAttribute(usdHandle, usdAttribName, dataTimeStep, timeVarying); } perInstance = boundToInstance; } } bool UsdSampler::deferCommit(UsdDevice* device) { return false; } bool UsdSampler::doCommitData(UsdDevice* device) { UsdBridge* usdBridge = device->getUsdBridge(); if(!device->getReadParams().outputMaterial || samplerType == SAMPLER_UNKNOWN) return false; const UsdSamplerData& paramData = getReadParams(); UsdBridgeSamplerData::SamplerType type = (samplerType == SAMPLER_1D ? UsdBridgeSamplerData::SamplerType::SAMPLER_1D : (samplerType == SAMPLER_2D ? UsdBridgeSamplerData::SamplerType::SAMPLER_2D : UsdBridgeSamplerData::SamplerType::SAMPLER_3D ) ); bool isNew = false; if (!usdHandle.value) isNew = usdBridge->CreateSampler(getName(), usdHandle, type); if (paramChanged || isNew) { if (paramData.inAttribute && (std::strlen(UsdSharedString::c_str(paramData.inAttribute)) > 0) && (paramData.imageUrl || paramData.imageData)) { bool supportedImage = true; int numComponents = 0; if(paramData.imageData) { numComponents = static_cast<int>(anari::componentsOf(paramData.imageData->getType())); if(numComponents > 4) device->reportStatus(this, ANARI_SAMPLER, ANARI_SEVERITY_WARNING, ANARI_STATUS_INVALID_ARGUMENT, "UsdSampler '%s' image data has more than 4 components. Anything above the 4th component will be ignored.", paramData.imageData->getName()); } if(supportedImage) { UsdLogInfo logInfo(device, this, ANARI_SAMPLER, getName()); UsdBridgeSamplerData samplerData; samplerData.Type = type; double worldTimeStep = device->getReadParams().timeStep; double dataTimeStep = selectObjTime(paramData.timeStep, worldTimeStep); samplerData.InAttribute = AnariAttributeToUsdName(UsdSharedString::c_str(paramData.inAttribute), perInstance, logInfo); if(paramData.imageUrl) { samplerData.ImageUrl = UsdSharedString::c_str(paramData.imageUrl); } if(paramData.imageData) { samplerData.Data = paramData.imageData->getData(); samplerData.ImageName = paramData.imageData->getName(); samplerData.ImageNumComponents = numComponents; samplerData.DataType = AnariToUsdBridgeType(paramData.imageData->getType()); paramData.imageData->getLayout().copyDims(samplerData.ImageDims); paramData.imageData->getLayout().copyStride(samplerData.ImageStride); } samplerData.WrapS = ANARIToUsdBridgeWrapMode(UsdSharedString::c_str(paramData.wrapS)); samplerData.WrapT = ANARIToUsdBridgeWrapMode(UsdSharedString::c_str(paramData.wrapT)); samplerData.WrapR = ANARIToUsdBridgeWrapMode(UsdSharedString::c_str(paramData.wrapR)); setSamplerTimeVarying(samplerData.TimeVarying); usdBridge->SetSamplerData(usdHandle, samplerData, dataTimeStep); } } else { device->reportStatus(this, ANARI_SAMPLER, ANARI_SEVERITY_ERROR, ANARI_STATUS_INVALID_ARGUMENT, "UsdSampler '%s' commit failed: missing either the 'inAttribute', or both the 'image' and 'usd::imageUrl' parameter", getName()); } paramChanged = false; } return false; } void UsdSampler::setSamplerTimeVarying(UsdBridgeSamplerData::DataMemberId& timeVarying) { typedef UsdBridgeSamplerData::DataMemberId DMI; timeVarying = DMI::ALL & (isTimeVarying(CType::DATA) ? DMI::ALL : ~DMI::DATA) & (isTimeVarying(CType::WRAPS) ? DMI::ALL : ~DMI::WRAPS) & (isTimeVarying(CType::WRAPT) ? DMI::ALL : ~DMI::WRAPT) & (isTimeVarying(CType::WRAPR) ? DMI::ALL : ~DMI::WRAPR); }
NVIDIA-Omniverse/AnariUsdDevice/UsdDeviceQueries.cpp
// Copyright 2021 The Khronos Group // SPDX-License-Identifier: Apache-2.0 // This file was generated by generate_queries.py // Don't make changes to this directly #include <stdint.h> #include <math.h> #include <anari/anari.h> namespace anari { namespace usd { static int subtype_hash(const char *str) { static const uint32_t table[] = {0x7a6f0012u,0x6665002bu,0x0u,0x0u,0x6d6c0032u,0x0u,0x6e6d0037u,0x0u,0x0u,0x0u,0x62610044u,0x0u,0x0u,0x69650049u,0x76750065u,0x0u,0x75700069u,0x73720083u,0x6f6e001du,0x0u,0x0u,0x0u,0x0u,0x0u,0x73720020u,0x0u,0x0u,0x0u,0x6d6c0024u,0x6665001eu,0x100001fu,0x80000000u,0x77760021u,0x66650022u,0x1000023u,0x80000001u,0x6a690025u,0x6f6e0026u,0x65640027u,0x66650028u,0x73720029u,0x100002au,0x80000002u,0x6766002cu,0x6261002du,0x7675002eu,0x6d6c002fu,0x75740030u,0x1000031u,0x80000003u,0x7a790033u,0x71700034u,0x69680035u,0x1000036u,0x80000004u,0x62610038u,0x68670039u,0x6665003au,0x3431003bu,0x4544003eu,0x45440040u,0x45440042u,0x100003fu,0x80000005u,0x1000041u,0x80000006u,0x1000043u,0x80000007u,0x75740045u,0x75740046u,0x66650047u,0x1000048u,0x80000008u,0x7372004du,0x0u,0x0u,0x7a790057u,0x7473004eu,0x7170004fu,0x66650050u,0x64630051u,0x75740052u,0x6a690053u,0x77760054u,0x66650055u,0x1000056u,0x80000009u,0x74730058u,0x6a690059u,0x6463005au,0x6261005bu,0x6d6c005cu,0x6d6c005du,0x7a79005eu,0x4342005fu,0x62610060u,0x74730061u,0x66650062u,0x65640063u,0x1000064u,0x8000000au,0x62610066u,0x65640067u,0x1000068u,0x8000000bu,0x6968006eu,0x0u,0x0u,0x0u,0x73720073u,0x6665006fu,0x73720070u,0x66650071u,0x1000072u,0x8000000cu,0x76750074u,0x64630075u,0x75740076u,0x76750077u,0x73720078u,0x66650079u,0x6564007au,0x5352007bu,0x6665007cu,0x6867007du,0x7675007eu,0x6d6c007fu,0x62610080u,0x73720081u,0x1000082u,0x8000000du,0x6a610084u,0x6f6e008du,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x626100aau,0x7473008eu,0x6766008fu,0x70650090u,0x7372009bu,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x737200a7u,0x4746009cu,0x7675009du,0x6f6e009eu,0x6463009fu,0x757400a0u,0x6a6900a1u,0x706f00a2u,0x6f6e00a3u,0x323100a4u,0x454400a5u,0x10000a6u,0x8000000eu,0x6e6d00a8u,0x10000a9u,0x8000000fu,0x6f6e00abu,0x686700acu,0x6d6c00adu,0x666500aeu,0x10000afu,0x80000010u}; uint32_t cur = 0x75630000u; for(int i = 0;cur!=0;++i) { uint32_t idx = cur&0xFFFFu; uint32_t low = (cur>>16u)&0xFFu; uint32_t high = (cur>>24u)&0xFFu; uint32_t c = (uint32_t)str[i]; if(c>=low && c<high) { cur = table[idx+c-low]; } else { break; } if(cur&0x80000000u) { return cur&0xFFFFu; } if(str[i]==0) { break; } } return -1; } static int param_hash(const char *str) { static const uint32_t table[] = {0x756c0017u,0x62610055u,0x7061005eu,0x6a6100f6u,0x6e6d010au,0x70610112u,0x7365012bu,0x0u,0x736d0144u,0x0u,0x0u,0x6a690263u,0x66610268u,0x7061027bu,0x76630295u,0x736f02dbu,0x0u,0x7061032bu,0x7663034eu,0x73680480u,0x746e04a9u,0x70610840u,0x736f0918u,0x71700020u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x71700038u,0x7574003du,0x69680021u,0x62610022u,0x4e430023u,0x7675002eu,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x706f0034u,0x7574002fu,0x706f0030u,0x67660031u,0x67660032u,0x1000033u,0x80000000u,0x65640035u,0x66650036u,0x1000037u,0x80000001u,0x66650039u,0x6463003au,0x7574003bu,0x100003cu,0x80000002u,0x6665003eu,0x6f6e003fu,0x76750040u,0x62610041u,0x75740042u,0x6a690043u,0x706f0044u,0x6f6e0045u,0x45430046u,0x706f0048u,0x6a69004du,0x6d6c0049u,0x706f004au,0x7372004bu,0x100004cu,0x80000003u,0x7473004eu,0x7574004fu,0x62610050u,0x6f6e0051u,0x64630052u,0x66650053u,0x1000054u,0x80000004u,0x74730056u,0x66650057u,0x44430058u,0x706f0059u,0x6d6c005au,0x706f005bu,0x7372005cu,0x100005du,0x80000005u,0x716d006du,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x62610077u,0x0u,0x0u,0x0u,0x66650089u,0x0u,0x0u,0x6d6c00f2u,0x66650071u,0x0u,0x0u,0x74730075u,0x73720072u,0x62610073u,0x1000074u,0x80000006u,0x1000076u,0x80000007u,0x6f6e0078u,0x6f6e0079u,0x6665007au,0x6d6c007bu,0x2f2e007cu,0x6563007du,0x706f007fu,0x66650084u,0x6d6c0080u,0x706f0081u,0x73720082u,0x1000083u,0x80000008u,0x71700085u,0x75740086u,0x69680087u,0x1000088u,0x80000009u,0x6261008au,0x7372008bu,0x6463008cu,0x706f008du,0x6261008eu,0x7574008fu,0x53000090u,0x8000000au,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x706f00e3u,0x0u,0x0u,0x0u,0x706f00e9u,0x737200e4u,0x6e6d00e5u,0x626100e6u,0x6d6c00e7u,0x10000e8u,0x8000000bu,0x767500eau,0x686700ebu,0x696800ecu,0x6f6e00edu,0x666500eeu,0x747300efu,0x747300f0u,0x10000f1u,0x8000000cu,0x706f00f3u,0x737200f4u,0x10000f5u,0x8000000du,0x757400ffu,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x73720102u,0x62610100u,0x1000101u,0x8000000eu,0x66650103u,0x64630104u,0x75740105u,0x6a690106u,0x706f0107u,0x6f6e0108u,0x1000109u,0x8000000fu,0x6a69010bu,0x7473010cu,0x7473010du,0x6a69010eu,0x7776010fu,0x66650110u,0x1000111u,0x80000010u,0x73720121u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x6d6c0123u,0x0u,0x0u,0x0u,0x0u,0x0u,0x77760128u,0x1000122u,0x80000011u,0x75740124u,0x66650125u,0x73720126u,0x1000127u,0x80000012u,0x7a790129u,0x100012au,0x80000013u,0x706f0139u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x706f0140u,0x6e6d013au,0x6665013bu,0x7574013cu,0x7372013du,0x7a79013eu,0x100013fu,0x80000014u,0x76750141u,0x71700142u,0x1000143u,0x80000015u,0x6261014au,0x744101a6u,0x737201f7u,0x0u,0x0u,0x6a6901f9u,0x6867014bu,0x6665014cu,0x5300014du,0x80000016u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x666501a0u,0x686701a1u,0x6a6901a2u,0x706f01a3u,0x6f6e01a4u,0x10001a5u,0x80000017u,0x757401d9u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x676601e2u,0x0u,0x0u,0x0u,0x0u,0x737201e8u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x757401f1u,0x757401dau,0x737201dbu,0x6a6901dcu,0x636201ddu,0x767501deu,0x757401dfu,0x666501e0u,0x10001e1u,0x80000018u,0x676601e3u,0x747301e4u,0x666501e5u,0x757401e6u,0x10001e7u,0x80000019u,0x626101e9u,0x6f6e01eau,0x747301ebu,0x676601ecu,0x706f01edu,0x737201eeu,0x6e6d01efu,0x10001f0u,0x8000001au,0x626101f2u,0x6f6e01f3u,0x646301f4u,0x666501f5u,0x10001f6u,0x8000001bu,0x10001f8u,0x8000001cu,0x656401fau,0x666501fbu,0x747301fcu,0x646301fdu,0x666501feu,0x6f6e01ffu,0x64630200u,0x66650201u,0x55000202u,0x8000001du,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x706f0257u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x6968025au,0x73720258u,0x1000259u,0x8000001eu,0x6a69025bu,0x6463025cu,0x6c6b025du,0x6f6e025eu,0x6665025fu,0x74730260u,0x74730261u,0x1000262u,0x8000001fu,0x68670264u,0x69680265u,0x75740266u,0x1000267u,0x80000020u,0x7574026du,0x0u,0x0u,0x0u,0x75740274u,0x6665026eu,0x7372026fu,0x6a690270u,0x62610271u,0x6d6c0272u,0x1000273u,0x80000021u,0x62610275u,0x6d6c0276u,0x6d6c0277u,0x6a690278u,0x64630279u,0x100027au,0x80000022u,0x6e6d028au,0x0u,0x0u,0x0u,0x6261028du,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x73720290u,0x6665028bu,0x100028cu,0x80000023u,0x7372028eu,0x100028fu,0x80000024u,0x6e6d0291u,0x62610292u,0x6d6c0293u,0x1000294u,0x80000025u,0x646302a8u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x626102b0u,0x0u,0x6a6902b6u,0x0u,0x0u,0x757402c5u,0x6d6c02a9u,0x767502aau,0x747302abu,0x6a6902acu,0x706f02adu,0x6f6e02aeu,0x10002afu,0x80000026u,0x646302b1u,0x6a6902b2u,0x757402b3u,0x7a7902b4u,0x10002b5u,0x80000027u,0x686502b7u,0x6f6e02bau,0x0u,0x6a6902c2u,0x757402bbu,0x626102bcu,0x757402bdu,0x6a6902beu,0x706f02bfu,0x6f6e02c0u,0x10002c1u,0x80000028u,0x6f6e02c3u,0x10002c4u,0x80000029u,0x554f02c6u,0x676602ccu,0x0u,0x0u,0x0u,0x0u,0x737202d2u,0x676602cdu,0x747302ceu,0x666502cfu,0x757402d0u,0x10002d1u,0x8000002au,0x626102d3u,0x6f6e02d4u,0x747302d5u,0x676602d6u,0x706f02d7u,0x737202d8u,0x6e6d02d9u,0x10002dau,0x8000002bu,0x747302dfu,0x0u,0x0u,0x6a6902e6u,0x6a6902e0u,0x757402e1u,0x6a6902e2u,0x706f02e3u,0x6f6e02e4u,0x10002e5u,0x8000002cu,0x6e6d02e7u,0x6a6902e8u,0x757402e9u,0x6a6902eau,0x777602ebu,0x666502ecu,0x2f2e02edu,0x736102eeu,0x75740300u,0x0u,0x706f0310u,0x0u,0x0u,0x0u,0x0u,0x0u,0x6f640315u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x62610325u,0x75740301u,0x73720302u,0x6a690303u,0x63620304u,0x76750305u,0x75740306u,0x66650307u,0x34300308u,0x100030cu,0x100030du,0x100030eu,0x100030fu,0x8000002du,0x8000002eu,0x8000002fu,0x80000030u,0x6d6c0311u,0x706f0312u,0x73720313u,0x1000314u,0x80000031u,0x1000320u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x65640321u,0x80000032u,0x66650322u,0x79780323u,0x1000324u,0x80000033u,0x65640326u,0x6a690327u,0x76750328u,0x74730329u,0x100032au,0x80000034u,0x6564033au,0x0u,0x0u,0x0u,0x6f6e033fu,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x76750346u,0x6a69033bu,0x7675033cu,0x7473033du,0x100033eu,0x80000035u,0x65640340u,0x66650341u,0x73720342u,0x66650343u,0x73720344u,0x1000345u,0x80000036u,0x68670347u,0x69680348u,0x6f6e0349u,0x6665034au,0x7473034bu,0x7473034cu,0x100034du,0x80000037u,0x62610361u,0x0u,0x0u,0x0u,0x0u,0x66610365u,0x7b7a03b5u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x666103b8u,0x0u,0x0u,0x0u,0x62610410u,0x7372047au,0x6d6c0362u,0x66650363u,0x1000364u,0x80000038u,0x7170036au,0x0u,0x0u,0x0u,0x66650395u,0x6665036bu,0x5547036cu,0x6665037au,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x7a720382u,0x706f037bu,0x6e6d037cu,0x6665037du,0x7574037eu,0x7372037fu,0x7a790380u,0x1000381u,0x80000039u,0x6261038au,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x71700392u,0x6f6e038bu,0x7473038cu,0x6766038du,0x706f038eu,0x7372038fu,0x6e6d0390u,0x1000391u,0x8000003au,0x66650393u,0x1000394u,0x8000003bu,0x6f6e0396u,0x53430397u,0x706f03a7u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x706f03acu,0x6d6c03a8u,0x706f03a9u,0x737203aau,0x10003abu,0x8000003cu,0x767503adu,0x686703aeu,0x696803afu,0x6f6e03b0u,0x666503b1u,0x747303b2u,0x747303b3u,0x10003b4u,0x8000003du,0x666503b6u,0x10003b7u,0x8000003eu,0x646303bdu,0x0u,0x0u,0x0u,0x646303c2u,0x6a6903beu,0x6f6e03bfu,0x686703c0u,0x10003c1u,0x8000003fu,0x767503c3u,0x6d6c03c4u,0x626103c5u,0x737203c6u,0x440003c7u,0x80000040u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x706f040bu,0x6d6c040cu,0x706f040du,0x7372040eu,0x100040fu,0x80000041u,0x75740411u,0x76750412u,0x74730413u,0x44430414u,0x62610415u,0x6d6c0416u,0x6d6c0417u,0x63620418u,0x62610419u,0x6463041au,0x6c6b041bu,0x5600041cu,0x80000042u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x74730472u,0x66650473u,0x73720474u,0x45440475u,0x62610476u,0x75740477u,0x62610478u,0x1000479u,0x80000043u,0x6766047bu,0x6261047cu,0x6463047du,0x6665047eu,0x100047fu,0x80000044u,0x6a69048bu,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x62610493u,0x6463048cu,0x6c6b048du,0x6f6e048eu,0x6665048fu,0x74730490u,0x74730491u,0x1000492u,0x80000045u,0x6f6e0494u,0x74730495u,0x6e660496u,0x706f049eu,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x6a6904a2u,0x7372049fu,0x6e6d04a0u,0x10004a1u,0x80000046u,0x747304a3u,0x747304a4u,0x6a6904a5u,0x706f04a6u,0x6f6e04a7u,0x10004a8u,0x80000047u,0x6a6904afu,0x0u,0x10004bau,0x0u,0x0u,0x656404bbu,0x757404b0u,0x454404b1u,0x6a6904b2u,0x747304b3u,0x757404b4u,0x626104b5u,0x6f6e04b6u,0x646304b7u,0x666504b8u,0x10004b9u,0x80000048u,0x80000049u,0x3b3a04bcu,0x3b3a04bdu,0x786104beu,0x757404d5u,0x0u,0x706f04f9u,0x0u,0x6f6e0510u,0x0u,0x6261051cu,0x0u,0x6e6d052au,0x0u,0x0u,0x0u,0x0u,0x0u,0x76750532u,0x73720563u,0x0u,0x66650570u,0x6663058au,0x6a6905ccu,0x74730823u,0x0u,0x73720833u,0x757404d6u,0x737204d7u,0x6a6904d8u,0x636204d9u,0x767504dau,0x757404dbu,0x666504dcu,0x343004ddu,0x2f2e04e1u,0x2f2e04e7u,0x2f2e04edu,0x2f2e04f3u,0x6f6e04e2u,0x626104e3u,0x6e6d04e4u,0x666504e5u,0x10004e6u,0x8000004au,0x6f6e04e8u,0x626104e9u,0x6e6d04eau,0x666504ebu,0x10004ecu,0x8000004bu,0x6f6e04eeu,0x626104efu,0x6e6d04f0u,0x666504f1u,0x10004f2u,0x8000004cu,0x6f6e04f4u,0x626104f5u,0x6e6d04f6u,0x666504f7u,0x10004f8u,0x8000004du,0x6f6e04fau,0x6f6e04fbu,0x666504fcu,0x646304fdu,0x757404feu,0x6a6904ffu,0x706f0500u,0x6f6e0501u,0x2f2e0502u,0x6d6c0503u,0x706f0504u,0x68670505u,0x57560506u,0x66650507u,0x73720508u,0x63620509u,0x706f050au,0x7473050bu,0x6a69050cu,0x7574050du,0x7a79050eu,0x100050fu,0x8000004eu,0x62610511u,0x63620512u,0x6d6c0513u,0x66650514u,0x54530515u,0x62610516u,0x77760517u,0x6a690518u,0x6f6e0519u,0x6867051au,0x100051bu,0x8000004fu,0x7372051du,0x6362051eu,0x6261051fu,0x68670520u,0x66650521u,0x44430522u,0x706f0523u,0x6d6c0524u,0x6d6c0525u,0x66650526u,0x64630527u,0x75740528u,0x1000529u,0x80000050u,0x6261052bu,0x6867052cu,0x6665052du,0x5655052eu,0x7372052fu,0x6d6c0530u,0x1000531u,0x80000051u,0x75740533u,0x71700534u,0x76750535u,0x75740536u,0x2f2e0537u,0x716d0538u,0x6561053cu,0x0u,0x0u,0x7372054fu,0x75740540u,0x0u,0x0u,0x6d6c0547u,0x66650541u,0x73720542u,0x6a690543u,0x62610544u,0x6d6c0545u,0x1000546u,0x80000052u,0x54530548u,0x69680549u,0x6261054au,0x6564054bu,0x6665054cu,0x7372054du,0x100054eu,0x80000053u,0x66650550u,0x77760551u,0x6a690552u,0x66650553u,0x78770554u,0x54530555u,0x76750556u,0x73720557u,0x67660558u,0x62610559u,0x6463055au,0x6665055bu,0x5453055cu,0x6968055du,0x6261055eu,0x6564055fu,0x66650560u,0x73720561u,0x1000562u,0x80000054u,0x66650564u,0x44430565u,0x6d6c0566u,0x62610567u,0x74730568u,0x74730569u,0x6a69056au,0x6766056bu,0x6a69056cu,0x6665056du,0x6564056eu,0x100056fu,0x80000055u,0x6e6d0571u,0x706f0572u,0x77760573u,0x66650574u,0x56500575u,0x7372057bu,0x0u,0x0u,0x0u,0x0u,0x6f6e057fu,0x6a69057cu,0x6e6d057du,0x100057eu,0x80000056u,0x76750580u,0x74730581u,0x66650582u,0x65640583u,0x4f4e0584u,0x62610585u,0x6e6d0586u,0x66650587u,0x74730588u,0x1000589u,0x80000057u,0x6665058du,0x0u,0x73720596u,0x6f6e058eu,0x6665058fu,0x54530590u,0x75740591u,0x62610592u,0x68670593u,0x66650594u,0x1000595u,0x80000058u,0x6a690597u,0x62610598u,0x6d6c0599u,0x6a69059au,0x7b7a059bu,0x6665059cu,0x2f2e059du,0x7068059eu,0x706f05a6u,0x0u,0x0u,0x0u,0x706f05aeu,0x0u,0x666505b6u,0x767505c0u,0x747305a7u,0x757405a8u,0x4f4e05a9u,0x626105aau,0x6e6d05abu,0x666505acu,0x10005adu,0x80000059u,0x646305afu,0x626105b0u,0x757405b1u,0x6a6905b2u,0x706f05b3u,0x6f6e05b4u,0x10005b5u,0x8000005au,0x787705b7u,0x545305b8u,0x666505b9u,0x747305bau,0x747305bbu,0x6a6905bcu,0x706f05bdu,0x6f6e05beu,0x10005bfu,0x8000005bu,0x757405c1u,0x717005c2u,0x767505c3u,0x757405c4u,0x434205c5u,0x6a6905c6u,0x6f6e05c7u,0x626105c8u,0x737205c9u,0x7a7905cau,0x10005cbu,0x8000005cu,0x6e6d05cdu,0x666505ceu,0x570005cfu,0x8000005du,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x77670626u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x626106a7u,0x66650636u,0x0u,0x0u,0x0u,0x0u,0x0u,0x6261063eu,0x0u,0x0u,0x0u,0x0u,0x0u,0x69610646u,0x0u,0x0u,0x626106a2u,0x706f0637u,0x6e6d0638u,0x66650639u,0x7574063au,0x7372063bu,0x7a79063cu,0x100063du,0x8000005eu,0x7574063fu,0x66650640u,0x73720641u,0x6a690642u,0x62610643u,0x6d6c0644u,0x1000645u,0x8000005fu,0x6e6d064eu,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x62610696u,0x7170064fu,0x6d6c0650u,0x66650651u,0x73720652u,0x2f2e0653u,0x73620654u,0x62610665u,0x706f066eu,0x0u,0x6e6d0673u,0x0u,0x0u,0x0u,0x706f067bu,0x0u,0x0u,0x0u,0x6665067eu,0x0u,0x71700686u,0x0u,0x0u,0x706f068du,0x74730666u,0x66650667u,0x44430668u,0x706f0669u,0x6d6c066au,0x706f066bu,0x7372066cu,0x100066du,0x80000060u,0x6d6c066fu,0x706f0670u,0x73720671u,0x1000672u,0x80000061u,0x6a690674u,0x74730675u,0x74730676u,0x6a690677u,0x77760678u,0x66650679u,0x100067au,0x80000062u,0x7372067cu,0x100067du,0x80000063u,0x7574067fu,0x62610680u,0x6d6c0681u,0x6d6c0682u,0x6a690683u,0x64630684u,0x1000685u,0x80000064u,0x62610687u,0x64630688u,0x6a690689u,0x7574068au,0x7a79068bu,0x100068cu,0x80000065u,0x7675068eu,0x6867068fu,0x69680690u,0x6f6e0691u,0x66650692u,0x74730693u,0x74730694u,0x1000695u,0x80000066u,0x71700697u,0x66650698u,0x48470699u,0x6665069au,0x706f069bu,0x6e6d069cu,0x6665069du,0x7574069eu,0x7372069fu,0x7a7906a0u,0x10006a1u,0x80000067u,0x6d6c06a3u,0x767506a4u,0x666506a5u,0x10006a6u,0x80000068u,0x737206a8u,0x7a7906a9u,0x6a6906aau,0x6f6e06abu,0x686706acu,0x2f0006adu,0x80000069u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x786106dcu,0x757406f3u,0x62610703u,0x706f070cu,0x62610711u,0x6e6d0715u,0x0u,0x7372071du,0x0u,0x70640722u,0x0u,0x0u,0x0u,0x6665074eu,0x706f0756u,0x7370075cu,0x736f076fu,0x0u,0x70610783u,0x7663079fu,0x737207bcu,0x0u,0x706107c5u,0x737207e5u,0x757406f4u,0x737206f5u,0x6a6906f6u,0x636206f7u,0x767506f8u,0x757406f9u,0x666506fau,0x343006fbu,0x10006ffu,0x1000700u,0x1000701u,0x1000702u,0x8000006au,0x8000006bu,0x8000006cu,0x8000006du,0x74730704u,0x66650705u,0x44430706u,0x706f0707u,0x6d6c0708u,0x706f0709u,0x7372070au,0x100070bu,0x8000006eu,0x6d6c070du,0x706f070eu,0x7372070fu,0x1000710u,0x8000006fu,0x75740712u,0x62610713u,0x1000714u,0x80000070u,0x6a690716u,0x74730717u,0x74730718u,0x6a690719u,0x7776071au,0x6665071bu,0x100071cu,0x80000071u,0x706f071eu,0x7675071fu,0x71700720u,0x1000721u,0x80000072u,0x100072eu,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x6261072fu,0x74640733u,0x7372074cu,0x80000073u,0x68670730u,0x66650731u,0x1000732u,0x80000074u,0x66650743u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x75740746u,0x79780744u,0x1000745u,0x80000075u,0x62610747u,0x6f6e0748u,0x64630749u,0x6665074au,0x100074bu,0x80000076u,0x100074du,0x80000077u,0x7574074fu,0x62610750u,0x6d6c0751u,0x6d6c0752u,0x6a690753u,0x64630754u,0x1000755u,0x80000078u,0x73720757u,0x6e6d0758u,0x62610759u,0x6d6c075au,0x100075bu,0x80000079u,0x6261075fu,0x0u,0x6a690765u,0x64630760u,0x6a690761u,0x75740762u,0x7a790763u,0x1000764u,0x8000007au,0x66650766u,0x6f6e0767u,0x75740768u,0x62610769u,0x7574076au,0x6a69076bu,0x706f076cu,0x6f6e076du,0x100076eu,0x8000007bu,0x74730773u,0x0u,0x0u,0x706f077au,0x6a690774u,0x75740775u,0x6a690776u,0x706f0777u,0x6f6e0778u,0x1000779u,0x8000007cu,0x6b6a077bu,0x6665077cu,0x6463077du,0x7574077eu,0x6a69077fu,0x706f0780u,0x6f6e0781u,0x1000782u,0x8000007du,0x65640792u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x76750797u,0x6a690793u,0x76750794u,0x74730795u,0x1000796u,0x8000007eu,0x68670798u,0x69680799u,0x6f6e079au,0x6665079bu,0x7473079cu,0x7473079du,0x100079eu,0x8000007fu,0x626107b2u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x737207b6u,0x6d6c07b3u,0x666507b4u,0x10007b5u,0x80000080u,0x676607b7u,0x626107b8u,0x646307b9u,0x666507bau,0x10007bbu,0x80000081u,0x626107bdu,0x6f6e07beu,0x747307bfu,0x676607c0u,0x706f07c1u,0x737207c2u,0x6e6d07c3u,0x10007c4u,0x80000082u,0x6d6c07d4u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x666507ddu,0x0u,0x0u,0x0u,0x0u,0x0u,0x6d6c07e0u,0x767507d5u,0x666507d6u,0x535207d7u,0x626107d8u,0x6f6e07d9u,0x686707dau,0x666507dbu,0x10007dcu,0x80000083u,0x787707deu,0x10007dfu,0x80000084u,0x767507e1u,0x6e6d07e2u,0x666507e3u,0x10007e4u,0x80000085u,0x626107e6u,0x717007e7u,0x4e4d07e8u,0x706f07e9u,0x656407eau,0x666507ebu,0x340007ecu,0x80000086u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x1000820u,0x1000821u,0x1000822u,0x80000087u,0x80000088u,0x80000089u,0x66650824u,0x56550825u,0x74730826u,0x65640827u,0x48470828u,0x66650829u,0x706f082au,0x6e6d082bu,0x5150082cu,0x706f082du,0x6a69082eu,0x6f6e082fu,0x75740830u,0x74730831u,0x1000832u,0x8000008au,0x6a690834u,0x75740835u,0x66650836u,0x42410837u,0x75740838u,0x44430839u,0x706f083au,0x6e6d083bu,0x6e6d083cu,0x6a69083du,0x7574083eu,0x100083fu,0x8000008bu,0x6d6c084fu,0x0u,0x0u,0x0u,0x737208aau,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x6d6c0913u,0x76750850u,0x66650851u,0x53000852u,0x8000008cu,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x626108a5u,0x6f6e08a6u,0x686708a7u,0x666508a8u,0x10008a9u,0x8000008du,0x757408abu,0x666508acu,0x797808adu,0x2f2e08aeu,0x756108afu,0x757408c3u,0x0u,0x706108d3u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x706f08e8u,0x737208eeu,0x706f08f9u,0x0u,0x62610901u,0x64630907u,0x6261090cu,0x757408c4u,0x737208c5u,0x6a6908c6u,0x636208c7u,0x767508c8u,0x757408c9u,0x666508cau,0x343008cbu,0x10008cfu,0x10008d0u,0x10008d1u,0x10008d2u,0x8000008eu,0x8000008fu,0x80000090u,0x80000091u,0x717008e2u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x6d6c08e4u,0x10008e3u,0x80000092u,0x706f08e5u,0x737208e6u,0x10008e7u,0x80000093u,0x737208e9u,0x6e6d08eau,0x626108ebu,0x6d6c08ecu,0x10008edu,0x80000094u,0x6a6908efu,0x666508f0u,0x6f6e08f1u,0x757408f2u,0x626108f3u,0x757408f4u,0x6a6908f5u,0x706f08f6u,0x6f6e08f7u,0x10008f8u,0x80000095u,0x747308fau,0x6a6908fbu,0x757408fcu,0x6a6908fdu,0x706f08feu,0x6f6e08ffu,0x1000900u,0x80000096u,0x65640902u,0x6a690903u,0x76750904u,0x74730905u,0x1000906u,0x80000097u,0x62610908u,0x6d6c0909u,0x6665090au,0x100090bu,0x80000098u,0x6f6e090du,0x6867090eu,0x6665090fu,0x6f6e0910u,0x75740911u,0x1000912u,0x80000099u,0x76750914u,0x6e6d0915u,0x66650916u,0x1000917u,0x8000009au,0x7372091cu,0x0u,0x0u,0x62610920u,0x6d6c091du,0x6564091eu,0x100091fu,0x8000009bu,0x71700921u,0x4e4d0922u,0x706f0923u,0x65640924u,0x66650925u,0x34310926u,0x1000929u,0x100092au,0x100092bu,0x8000009cu,0x8000009du,0x8000009eu}; uint32_t cur = 0x78610000u; for(int i = 0;cur!=0;++i) { uint32_t idx = cur&0xFFFFu; uint32_t low = (cur>>16u)&0xFFu; uint32_t high = (cur>>24u)&0xFFu; uint32_t c = (uint32_t)str[i]; if(c>=low && c<high) { cur = table[idx+c-low]; } else { break; } if(cur&0x80000000u) { return cur&0xFFFFu; } if(str[i]==0) { break; } } return -1; } static int info_hash(const char *str) { static const uint32_t table[] = {0x69680014u,0x6665001bu,0x796c0038u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x6a610057u,0x0u,0x0u,0x6261006cu,0x0u,0x66650075u,0x706f007du,0x0u,0x7473008cu,0x6261008fu,0x62610015u,0x6f6e0016u,0x6f6e0017u,0x66650018u,0x6d6c0019u,0x100001au,0x8000000au,0x7466001cu,0x6261002au,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x6463002fu,0x7675002bu,0x6d6c002cu,0x7574002du,0x100002eu,0x80000001u,0x73720030u,0x6a690031u,0x71700032u,0x75740033u,0x6a690034u,0x706f0035u,0x6f6e0036u,0x1000037u,0x80000004u,0x66650045u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x7574004fu,0x6e6d0046u,0x66650047u,0x6f6e0048u,0x75740049u,0x5554004au,0x7a79004bu,0x7170004cu,0x6665004du,0x100004eu,0x80000005u,0x66650050u,0x6f6e0051u,0x74730052u,0x6a690053u,0x706f0054u,0x6f6e0055u,0x1000056u,0x80000008u,0x79780060u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x0u,0x6f6e0066u,0x6a690061u,0x6e6d0062u,0x76750063u,0x6e6d0064u,0x1000065u,0x80000003u,0x6a690067u,0x6e6d0068u,0x76750069u,0x6e6d006au,0x100006bu,0x80000002u,0x7372006du,0x6261006eu,0x6e6d006fu,0x66650070u,0x75740071u,0x66650072u,0x73720073u,0x1000074u,0x80000009u,0x72710076u,0x76750077u,0x6a690078u,0x73720079u,0x6665007au,0x6564007bu,0x100007cu,0x80000000u,0x7675007eu,0x7372007fu,0x64630080u,0x66650081u,0x46450082u,0x79780083u,0x75740084u,0x66650085u,0x6f6e0086u,0x74730087u,0x6a690088u,0x706f0089u,0x6f6e008au,0x100008bu,0x80000007u,0x6665008du,0x100008eu,0x8000000bu,0x6d6c0090u,0x76750091u,0x66650092u,0x1000093u,0x80000006u}; uint32_t cur = 0x77630000u; for(int i = 0;cur!=0;++i) { uint32_t idx = cur&0xFFFFu; uint32_t low = (cur>>16u)&0xFFu; uint32_t high = (cur>>24u)&0xFFu; uint32_t c = (uint32_t)str[i]; if(c>=low && c<high) { cur = table[idx+c-low]; } else { break; } if(cur&0x80000000u) { return cur&0xFFFFu; } if(str[i]==0) { break; } } return -1; } static const int32_t anari_true = 1; static const int32_t anari_false = 0; const char ** query_extensions() { static const char *extensions[] = { "ANARI_KHR_GEOMETRY_CONE", "ANARI_KHR_GEOMETRY_CURVE", "ANARI_KHR_GEOMETRY_CYLINDER", "ANARI_KHR_GEOMETRY_QUAD", "ANARI_KHR_GEOMETRY_SPHERE", "ANARI_KHR_GEOMETRY_TRIANGLE", "ANARI_KHR_GEOMETRY_GLYPH", "ANARI_KHR_CAMERA_PERSPECTIVE", "ANARI_KHR_INSTANCE_TRANSFORM", "ANARI_KHR_MATERIAL_MATTE", "ANARI_KHR_MATERIAL_PHYSICALLY_BASED", "ANARI_KHR_SAMPLER_IMAGE1D", "ANARI_KHR_SAMPLER_IMAGE2D", "ANARI_KHR_SAMPLER_IMAGE3D", "ANARI_KHR_SPATIAL_FIELD_STRUCTURED_REGULAR", "ANARI_KHR_VOLUME_TRANSFER_FUNCTION1D", "ANARI_USD_DEVICE", 0 }; return extensions; } const char ** query_object_types(ANARIDataType type) { switch(type) { case ANARI_RENDERER: { static const char *ANARI_RENDERER_subtypes[] = {"default", 0}; return ANARI_RENDERER_subtypes; } case ANARI_GEOMETRY: { static const char *ANARI_GEOMETRY_subtypes[] = {"cone", "curve", "cylinder", "quad", "sphere", "triangle", "glyph", 0}; return ANARI_GEOMETRY_subtypes; } case ANARI_CAMERA: { static const char *ANARI_CAMERA_subtypes[] = {"perspective", 0}; return ANARI_CAMERA_subtypes; } case ANARI_INSTANCE: { static const char *ANARI_INSTANCE_subtypes[] = {"transform", 0}; return ANARI_INSTANCE_subtypes; } case ANARI_MATERIAL: { static const char *ANARI_MATERIAL_subtypes[] = {"matte", "physicallyBased", 0}; return ANARI_MATERIAL_subtypes; } case ANARI_SAMPLER: { static const char *ANARI_SAMPLER_subtypes[] = {"image1D", "image2D", "image3D", 0}; return ANARI_SAMPLER_subtypes; } case ANARI_SPATIAL_FIELD: { static const char *ANARI_SPATIAL_FIELD_subtypes[] = {"structuredRegular", 0}; return ANARI_SPATIAL_FIELD_subtypes; } case ANARI_VOLUME: { static const char *ANARI_VOLUME_subtypes[] = {"transferFunction1D", 0}; return ANARI_VOLUME_subtypes; } default: { static const char *none_subtypes[] = {0}; return none_subtypes; } } } static const void * ANARI_DEVICE_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } default: return nullptr; } } static const void * ANARI_DEVICE_statusCallback_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "callback used to report information to the application"; return description; } default: return nullptr; } } static const void * ANARI_DEVICE_statusCallbackUserData_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional pointer passed as the first argument of the status callback"; return description; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__serialize_hostName_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Nucleus server name. If not present, output will be routed to local disk."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__serialize_location_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "./"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "USD output path"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__serialize_newSession_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Is a new session directory created on device commit, or the last (ie. highest numbered) one reused."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__serialize_outputBinary_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Enable binary .usd output, or ascii-based .usda"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Global scene timestep"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__writeAtCommit_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "(Experimental) Output USD as much as possible at commit of objects instead of anariRenderFrame"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__output_material_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Output material objects."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__output_previewSurfaceShader_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Output materials according to the USD preview surface schema"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__output_mdlShader_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Output materials according to the Omniverse MDL schema"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__garbageCollect_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Instruct the USD device to remove USD output of objects that are not referenced within USD by other objects"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__removeUnusedNames_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Clean up the name cache for object name generation and uniqueness checks"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__connection_logVerbosity_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_INT32 && infoType == ANARI_INT32) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 2: // minimum if(paramType == ANARI_INT32 && infoType == ANARI_INT32) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 3: // maximum if(paramType == ANARI_INT32 && infoType == ANARI_INT32) { static const int32_t default_value[1] = {INT32_C(4)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Verbosity of logging information from the Nucleus connection, with the highest value being the loudest, similar to debug."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__sceneStage_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "USD stage pointer"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_usd__enableSaving_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Allows the USD output to be written out, or just updated in memory if disabled. Useful in conjunction with usd::sceneStage."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_DEVICE_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_DEVICE_name_info(paramType, infoName, infoType); case 66: return ANARI_DEVICE_statusCallback_info(paramType, infoName, infoType); case 67: return ANARI_DEVICE_statusCallbackUserData_info(paramType, infoName, infoType); case 89: return ANARI_DEVICE_usd__serialize_hostName_info(paramType, infoName, infoType); case 90: return ANARI_DEVICE_usd__serialize_location_info(paramType, infoName, infoType); case 91: return ANARI_DEVICE_usd__serialize_newSession_info(paramType, infoName, infoType); case 92: return ANARI_DEVICE_usd__serialize_outputBinary_info(paramType, infoName, infoType); case 93: return ANARI_DEVICE_usd__time_info(paramType, infoName, infoType); case 139: return ANARI_DEVICE_usd__writeAtCommit_info(paramType, infoName, infoType); case 82: return ANARI_DEVICE_usd__output_material_info(paramType, infoName, infoType); case 84: return ANARI_DEVICE_usd__output_previewSurfaceShader_info(paramType, infoName, infoType); case 83: return ANARI_DEVICE_usd__output_mdlShader_info(paramType, infoName, infoType); case 80: return ANARI_DEVICE_usd__garbageCollect_info(paramType, infoName, infoType); case 87: return ANARI_DEVICE_usd__removeUnusedNames_info(paramType, infoName, infoType); case 78: return ANARI_DEVICE_usd__connection_logVerbosity_info(paramType, infoName, infoType); case 88: return ANARI_DEVICE_usd__sceneStage_info(paramType, infoName, infoType); case 79: return ANARI_DEVICE_usd__enableSaving_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_ARRAY1D_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } default: return nullptr; } } static const void * ANARI_ARRAY1D_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_ARRAY1D_name_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_ARRAY2D_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } default: return nullptr; } } static const void * ANARI_ARRAY2D_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_ARRAY2D_name_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_ARRAY3D_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } default: return nullptr; } } static const void * ANARI_ARRAY3D_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_ARRAY3D_name_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_FRAME_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } default: return nullptr; } } static const void * ANARI_FRAME_world_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "world to be rendererd"; return description; } default: return nullptr; } } static const void * ANARI_FRAME_renderer_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "renderer which renders the frame"; return description; } default: return nullptr; } } static const void * ANARI_FRAME_camera_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "camera used to render the world"; return description; } default: return nullptr; } } static const void * ANARI_FRAME_size_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "size of the frame in pixels (width, height)"; return description; } default: return nullptr; } } static const void * ANARI_FRAME_channel_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "enables mapping the color channel as the type specified"; return description; } case 6: // value if(paramType == ANARI_DATA_TYPE && infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8_VEC4, ANARI_UFIXED8_RGBA_SRGB, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_FRAME_channel_depth_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "enables mapping the color channel as the type specified"; return description; } case 6: // value if(paramType == ANARI_DATA_TYPE && infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_UNKNOWN}; return values; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_FRAME_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_FRAME_name_info(paramType, infoName, infoType); case 155: return ANARI_FRAME_world_info(paramType, infoName, infoType); case 54: return ANARI_FRAME_renderer_info(paramType, infoName, infoType); case 6: return ANARI_FRAME_camera_info(paramType, infoName, infoType); case 62: return ANARI_FRAME_size_info(paramType, infoName, infoType); case 8: return ANARI_FRAME_channel_color_info(paramType, infoName, infoType); case 9: return ANARI_FRAME_channel_depth_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_GROUP_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } default: return nullptr; } } static const void * ANARI_GROUP_surface_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "array of surface objects"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_SURFACE, ANARI_UNKNOWN}; return values; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_GROUP_volume_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "array of volume objects"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_VOLUME, ANARI_UNKNOWN}; return values; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_GROUP_light_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "array of light objects"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_LIGHT, ANARI_UNKNOWN}; return values; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_GROUP_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GROUP_usd__timeVarying_surface_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying surface bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GROUP_usd__timeVarying_volume_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying volume bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GROUP_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GROUP_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_GROUP_name_info(paramType, infoName, infoType); case 68: return ANARI_GROUP_surface_info(paramType, infoName, infoType); case 154: return ANARI_GROUP_volume_info(paramType, infoName, infoType); case 32: return ANARI_GROUP_light_info(paramType, infoName, infoType); case 105: return ANARI_GROUP_usd__timeVarying_info(paramType, infoName, infoType); case 129: return ANARI_GROUP_usd__timeVarying_surface_info(paramType, infoName, infoType); case 133: return ANARI_GROUP_usd__timeVarying_volume_info(paramType, infoName, infoType); case 86: return ANARI_GROUP_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_WORLD_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } default: return nullptr; } } static const void * ANARI_WORLD_instance_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "array of instance objects in the world"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_INSTANCE, ANARI_UNKNOWN}; return values; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_WORLD_surface_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "array of non-instanced surface objects in the world"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_SURFACE, ANARI_UNKNOWN}; return values; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_WORLD_volume_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "array of non-instanced volume objects in the world"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_LIGHT, ANARI_UNKNOWN}; return values; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_WORLD_light_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "array of non-instanced light objects in the world"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_LIGHT, ANARI_UNKNOWN}; return values; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_WORLD_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_WORLD_usd__timeVarying_instance_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying instance bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_WORLD_usd__timeVarying_surface_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying surface bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_WORLD_usd__timeVarying_volume_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying volume bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_WORLD_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_WORLD_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_WORLD_name_info(paramType, infoName, infoType); case 27: return ANARI_WORLD_instance_info(paramType, infoName, infoType); case 68: return ANARI_WORLD_surface_info(paramType, infoName, infoType); case 154: return ANARI_WORLD_volume_info(paramType, infoName, infoType); case 32: return ANARI_WORLD_light_info(paramType, infoName, infoType); case 105: return ANARI_WORLD_usd__timeVarying_info(paramType, infoName, infoType); case 118: return ANARI_WORLD_usd__timeVarying_instance_info(paramType, infoName, infoType); case 129: return ANARI_WORLD_usd__timeVarying_surface_info(paramType, infoName, infoType); case 133: return ANARI_WORLD_usd__timeVarying_volume_info(paramType, infoName, infoType); case 86: return ANARI_WORLD_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_RENDERER_default_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } default: return nullptr; } } static const void * ANARI_RENDERER_default_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_RENDERER_default_name_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_SURFACE_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } default: return nullptr; } } static const void * ANARI_SURFACE_geometry_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "geometry object defining the surface geometry"; return description; } default: return nullptr; } } static const void * ANARI_SURFACE_material_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "material object defining the surface appearance"; return description; } default: return nullptr; } } static const void * ANARI_SURFACE_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SURFACE_usd__time_geometry_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the object attached to the geometry parameter of the surface, at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SURFACE_usd__time_material_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the object attached to the material parameter of the surface, at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SURFACE_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SURFACE_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_SURFACE_name_info(paramType, infoName, infoType); case 20: return ANARI_SURFACE_geometry_info(paramType, infoName, infoType); case 33: return ANARI_SURFACE_material_info(paramType, infoName, infoType); case 105: return ANARI_SURFACE_usd__timeVarying_info(paramType, infoName, infoType); case 94: return ANARI_SURFACE_usd__time_geometry_info(paramType, infoName, infoType); case 95: return ANARI_SURFACE_usd__time_material_info(paramType, infoName, infoType); case 86: return ANARI_SURFACE_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_primitive_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_primitive_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_primitive_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_primitive_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_primitive_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_primitive_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "primitive id"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32, ANARI_UINT64, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_vertex_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "vertex position"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_VEC3, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_vertex_radius_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex radius"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_vertex_cap_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex cap type"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT8, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_vertex_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_vertex_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_vertex_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_vertex_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_vertex_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_primitive_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "index array"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32_VEC2, ANARI_UINT64_VEC2, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_caps_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "none"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "global cap type"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"none", "first", "second", "both", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 0; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the geometry object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__timeVarying_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying position bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__timeVarying_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying color bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__timeVarying_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying index bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__timeVarying_radius_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying radius bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__timeVarying_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying id bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__timeVarying_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute0 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__timeVarying_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute1 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__timeVarying_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute2 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__timeVarying_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute3 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_GEOMETRY_cone_name_info(paramType, infoName, infoType); case 49: return ANARI_GEOMETRY_cone_primitive_color_info(paramType, infoName, infoType); case 45: return ANARI_GEOMETRY_cone_primitive_attribute0_info(paramType, infoName, infoType); case 46: return ANARI_GEOMETRY_cone_primitive_attribute1_info(paramType, infoName, infoType); case 47: return ANARI_GEOMETRY_cone_primitive_attribute2_info(paramType, infoName, infoType); case 48: return ANARI_GEOMETRY_cone_primitive_attribute3_info(paramType, infoName, infoType); case 50: return ANARI_GEOMETRY_cone_primitive_id_info(paramType, infoName, infoType); case 150: return ANARI_GEOMETRY_cone_vertex_position_info(paramType, infoName, infoType); case 151: return ANARI_GEOMETRY_cone_vertex_radius_info(paramType, infoName, infoType); case 146: return ANARI_GEOMETRY_cone_vertex_cap_info(paramType, infoName, infoType); case 147: return ANARI_GEOMETRY_cone_vertex_color_info(paramType, infoName, infoType); case 142: return ANARI_GEOMETRY_cone_vertex_attribute0_info(paramType, infoName, infoType); case 143: return ANARI_GEOMETRY_cone_vertex_attribute1_info(paramType, infoName, infoType); case 144: return ANARI_GEOMETRY_cone_vertex_attribute2_info(paramType, infoName, infoType); case 145: return ANARI_GEOMETRY_cone_vertex_attribute3_info(paramType, infoName, infoType); case 51: return ANARI_GEOMETRY_cone_primitive_index_info(paramType, infoName, infoType); case 7: return ANARI_GEOMETRY_cone_caps_info(paramType, infoName, infoType); case 93: return ANARI_GEOMETRY_cone_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_GEOMETRY_cone_usd__timeVarying_info(paramType, infoName, infoType); case 124: return ANARI_GEOMETRY_cone_usd__timeVarying_position_info(paramType, infoName, infoType); case 111: return ANARI_GEOMETRY_cone_usd__timeVarying_color_info(paramType, infoName, infoType); case 117: return ANARI_GEOMETRY_cone_usd__timeVarying_index_info(paramType, infoName, infoType); case 126: return ANARI_GEOMETRY_cone_usd__timeVarying_radius_info(paramType, infoName, infoType); case 115: return ANARI_GEOMETRY_cone_usd__timeVarying_id_info(paramType, infoName, infoType); case 106: return ANARI_GEOMETRY_cone_usd__timeVarying_attribute0_info(paramType, infoName, infoType); case 107: return ANARI_GEOMETRY_cone_usd__timeVarying_attribute1_info(paramType, infoName, infoType); case 108: return ANARI_GEOMETRY_cone_usd__timeVarying_attribute2_info(paramType, infoName, infoType); case 109: return ANARI_GEOMETRY_cone_usd__timeVarying_attribute3_info(paramType, infoName, infoType); case 86: return ANARI_GEOMETRY_cone_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_primitive_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_primitive_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_primitive_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_primitive_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_primitive_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_primitive_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "primitive id"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32, ANARI_UINT64, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_vertex_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "vertex position"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_VEC3, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_vertex_radius_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex radius"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_vertex_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_vertex_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_vertex_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_vertex_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_vertex_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_primitive_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "index array"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32, ANARI_UINT64, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_radius_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "global radius"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 1; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the geometry object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__timeVarying_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying position bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__timeVarying_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying color bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__timeVarying_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying index bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__timeVarying_radius_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying radius bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__timeVarying_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying id bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__timeVarying_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute0 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__timeVarying_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute1 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__timeVarying_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute2 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__timeVarying_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute3 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_GEOMETRY_curve_name_info(paramType, infoName, infoType); case 49: return ANARI_GEOMETRY_curve_primitive_color_info(paramType, infoName, infoType); case 45: return ANARI_GEOMETRY_curve_primitive_attribute0_info(paramType, infoName, infoType); case 46: return ANARI_GEOMETRY_curve_primitive_attribute1_info(paramType, infoName, infoType); case 47: return ANARI_GEOMETRY_curve_primitive_attribute2_info(paramType, infoName, infoType); case 48: return ANARI_GEOMETRY_curve_primitive_attribute3_info(paramType, infoName, infoType); case 50: return ANARI_GEOMETRY_curve_primitive_id_info(paramType, infoName, infoType); case 150: return ANARI_GEOMETRY_curve_vertex_position_info(paramType, infoName, infoType); case 151: return ANARI_GEOMETRY_curve_vertex_radius_info(paramType, infoName, infoType); case 147: return ANARI_GEOMETRY_curve_vertex_color_info(paramType, infoName, infoType); case 142: return ANARI_GEOMETRY_curve_vertex_attribute0_info(paramType, infoName, infoType); case 143: return ANARI_GEOMETRY_curve_vertex_attribute1_info(paramType, infoName, infoType); case 144: return ANARI_GEOMETRY_curve_vertex_attribute2_info(paramType, infoName, infoType); case 145: return ANARI_GEOMETRY_curve_vertex_attribute3_info(paramType, infoName, infoType); case 51: return ANARI_GEOMETRY_curve_primitive_index_info(paramType, infoName, infoType); case 53: return ANARI_GEOMETRY_curve_radius_info(paramType, infoName, infoType); case 93: return ANARI_GEOMETRY_curve_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_GEOMETRY_curve_usd__timeVarying_info(paramType, infoName, infoType); case 124: return ANARI_GEOMETRY_curve_usd__timeVarying_position_info(paramType, infoName, infoType); case 111: return ANARI_GEOMETRY_curve_usd__timeVarying_color_info(paramType, infoName, infoType); case 117: return ANARI_GEOMETRY_curve_usd__timeVarying_index_info(paramType, infoName, infoType); case 126: return ANARI_GEOMETRY_curve_usd__timeVarying_radius_info(paramType, infoName, infoType); case 115: return ANARI_GEOMETRY_curve_usd__timeVarying_id_info(paramType, infoName, infoType); case 106: return ANARI_GEOMETRY_curve_usd__timeVarying_attribute0_info(paramType, infoName, infoType); case 107: return ANARI_GEOMETRY_curve_usd__timeVarying_attribute1_info(paramType, infoName, infoType); case 108: return ANARI_GEOMETRY_curve_usd__timeVarying_attribute2_info(paramType, infoName, infoType); case 109: return ANARI_GEOMETRY_curve_usd__timeVarying_attribute3_info(paramType, infoName, infoType); case 86: return ANARI_GEOMETRY_curve_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_primitive_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_primitive_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_primitive_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_primitive_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_primitive_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_primitive_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "primitive id"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32, ANARI_UINT64, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_vertex_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "vertex position"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_VEC3, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_vertex_cap_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "cylinder cap type"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT8, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_vertex_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_vertex_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_vertex_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_vertex_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_vertex_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_primitive_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "index array"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32_VEC2, ANARI_UINT64_VEC2, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_primitive_radius_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "cylinder radius"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_radius_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "global cylinder radius"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_caps_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "none"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "global cylinder cap type"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"none", "first", "second", "both", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 2; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the geometry object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__timeVarying_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying position bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__timeVarying_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying color bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__timeVarying_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying index bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__timeVarying_radius_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying radius bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__timeVarying_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying id bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__timeVarying_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute0 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__timeVarying_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute1 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__timeVarying_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute2 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__timeVarying_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute3 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_GEOMETRY_cylinder_name_info(paramType, infoName, infoType); case 49: return ANARI_GEOMETRY_cylinder_primitive_color_info(paramType, infoName, infoType); case 45: return ANARI_GEOMETRY_cylinder_primitive_attribute0_info(paramType, infoName, infoType); case 46: return ANARI_GEOMETRY_cylinder_primitive_attribute1_info(paramType, infoName, infoType); case 47: return ANARI_GEOMETRY_cylinder_primitive_attribute2_info(paramType, infoName, infoType); case 48: return ANARI_GEOMETRY_cylinder_primitive_attribute3_info(paramType, infoName, infoType); case 50: return ANARI_GEOMETRY_cylinder_primitive_id_info(paramType, infoName, infoType); case 150: return ANARI_GEOMETRY_cylinder_vertex_position_info(paramType, infoName, infoType); case 146: return ANARI_GEOMETRY_cylinder_vertex_cap_info(paramType, infoName, infoType); case 147: return ANARI_GEOMETRY_cylinder_vertex_color_info(paramType, infoName, infoType); case 142: return ANARI_GEOMETRY_cylinder_vertex_attribute0_info(paramType, infoName, infoType); case 143: return ANARI_GEOMETRY_cylinder_vertex_attribute1_info(paramType, infoName, infoType); case 144: return ANARI_GEOMETRY_cylinder_vertex_attribute2_info(paramType, infoName, infoType); case 145: return ANARI_GEOMETRY_cylinder_vertex_attribute3_info(paramType, infoName, infoType); case 51: return ANARI_GEOMETRY_cylinder_primitive_index_info(paramType, infoName, infoType); case 52: return ANARI_GEOMETRY_cylinder_primitive_radius_info(paramType, infoName, infoType); case 53: return ANARI_GEOMETRY_cylinder_radius_info(paramType, infoName, infoType); case 7: return ANARI_GEOMETRY_cylinder_caps_info(paramType, infoName, infoType); case 93: return ANARI_GEOMETRY_cylinder_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_GEOMETRY_cylinder_usd__timeVarying_info(paramType, infoName, infoType); case 124: return ANARI_GEOMETRY_cylinder_usd__timeVarying_position_info(paramType, infoName, infoType); case 111: return ANARI_GEOMETRY_cylinder_usd__timeVarying_color_info(paramType, infoName, infoType); case 117: return ANARI_GEOMETRY_cylinder_usd__timeVarying_index_info(paramType, infoName, infoType); case 126: return ANARI_GEOMETRY_cylinder_usd__timeVarying_radius_info(paramType, infoName, infoType); case 115: return ANARI_GEOMETRY_cylinder_usd__timeVarying_id_info(paramType, infoName, infoType); case 106: return ANARI_GEOMETRY_cylinder_usd__timeVarying_attribute0_info(paramType, infoName, infoType); case 107: return ANARI_GEOMETRY_cylinder_usd__timeVarying_attribute1_info(paramType, infoName, infoType); case 108: return ANARI_GEOMETRY_cylinder_usd__timeVarying_attribute2_info(paramType, infoName, infoType); case 109: return ANARI_GEOMETRY_cylinder_usd__timeVarying_attribute3_info(paramType, infoName, infoType); case 86: return ANARI_GEOMETRY_cylinder_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_primitive_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_primitive_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_primitive_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_primitive_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_primitive_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_primitive_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "primitive id"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32, ANARI_UINT64, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_vertex_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "vertex position"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_VEC3, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_vertex_normal_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex normal"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_VEC3, ANARI_FIXED16_VEC3, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_vertex_tangent_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex normal"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_VEC3, ANARI_FIXED16_VEC3, ANARI_FLOAT32_VEC4, ANARI_FIXED16_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_vertex_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_vertex_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_vertex_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_vertex_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_vertex_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_primitive_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "index array"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32_VEC4, ANARI_UINT64_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 3; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the geometry object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__timeVarying_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying position bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__timeVarying_normal_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying normal bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__timeVarying_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying color bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__timeVarying_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying index bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__timeVarying_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying id bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__timeVarying_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute0 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__timeVarying_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute1 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__timeVarying_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute2 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__timeVarying_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute3 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_GEOMETRY_quad_name_info(paramType, infoName, infoType); case 49: return ANARI_GEOMETRY_quad_primitive_color_info(paramType, infoName, infoType); case 45: return ANARI_GEOMETRY_quad_primitive_attribute0_info(paramType, infoName, infoType); case 46: return ANARI_GEOMETRY_quad_primitive_attribute1_info(paramType, infoName, infoType); case 47: return ANARI_GEOMETRY_quad_primitive_attribute2_info(paramType, infoName, infoType); case 48: return ANARI_GEOMETRY_quad_primitive_attribute3_info(paramType, infoName, infoType); case 50: return ANARI_GEOMETRY_quad_primitive_id_info(paramType, infoName, infoType); case 150: return ANARI_GEOMETRY_quad_vertex_position_info(paramType, infoName, infoType); case 148: return ANARI_GEOMETRY_quad_vertex_normal_info(paramType, infoName, infoType); case 153: return ANARI_GEOMETRY_quad_vertex_tangent_info(paramType, infoName, infoType); case 147: return ANARI_GEOMETRY_quad_vertex_color_info(paramType, infoName, infoType); case 142: return ANARI_GEOMETRY_quad_vertex_attribute0_info(paramType, infoName, infoType); case 143: return ANARI_GEOMETRY_quad_vertex_attribute1_info(paramType, infoName, infoType); case 144: return ANARI_GEOMETRY_quad_vertex_attribute2_info(paramType, infoName, infoType); case 145: return ANARI_GEOMETRY_quad_vertex_attribute3_info(paramType, infoName, infoType); case 51: return ANARI_GEOMETRY_quad_primitive_index_info(paramType, infoName, infoType); case 93: return ANARI_GEOMETRY_quad_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_GEOMETRY_quad_usd__timeVarying_info(paramType, infoName, infoType); case 124: return ANARI_GEOMETRY_quad_usd__timeVarying_position_info(paramType, infoName, infoType); case 121: return ANARI_GEOMETRY_quad_usd__timeVarying_normal_info(paramType, infoName, infoType); case 111: return ANARI_GEOMETRY_quad_usd__timeVarying_color_info(paramType, infoName, infoType); case 117: return ANARI_GEOMETRY_quad_usd__timeVarying_index_info(paramType, infoName, infoType); case 115: return ANARI_GEOMETRY_quad_usd__timeVarying_id_info(paramType, infoName, infoType); case 106: return ANARI_GEOMETRY_quad_usd__timeVarying_attribute0_info(paramType, infoName, infoType); case 107: return ANARI_GEOMETRY_quad_usd__timeVarying_attribute1_info(paramType, infoName, infoType); case 108: return ANARI_GEOMETRY_quad_usd__timeVarying_attribute2_info(paramType, infoName, infoType); case 109: return ANARI_GEOMETRY_quad_usd__timeVarying_attribute3_info(paramType, infoName, infoType); case 86: return ANARI_GEOMETRY_quad_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_primitive_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_primitive_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_primitive_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_primitive_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_primitive_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_primitive_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "primitive id"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32, ANARI_UINT64, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_vertex_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "sphere position"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_VEC3, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_vertex_radius_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "sphere radius"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_vertex_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_vertex_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_vertex_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_vertex_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_vertex_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_primitive_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "index array"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32, ANARI_UINT64, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_radius_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "global sphere radius"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 4; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the geometry object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__timeVarying_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying position bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__timeVarying_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying color bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__timeVarying_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying index bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__timeVarying_radius_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying radius bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__timeVarying_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying id bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__timeVarying_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute0 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__timeVarying_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute1 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__timeVarying_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute2 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__timeVarying_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute3 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__useUsdGeomPoints_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "For sphere geometries, use UsdGeomPoints instead of UsdGeomPointInstancer to represent the spheres. Cannot be changed after the first commit."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_GEOMETRY_sphere_name_info(paramType, infoName, infoType); case 49: return ANARI_GEOMETRY_sphere_primitive_color_info(paramType, infoName, infoType); case 45: return ANARI_GEOMETRY_sphere_primitive_attribute0_info(paramType, infoName, infoType); case 46: return ANARI_GEOMETRY_sphere_primitive_attribute1_info(paramType, infoName, infoType); case 47: return ANARI_GEOMETRY_sphere_primitive_attribute2_info(paramType, infoName, infoType); case 48: return ANARI_GEOMETRY_sphere_primitive_attribute3_info(paramType, infoName, infoType); case 50: return ANARI_GEOMETRY_sphere_primitive_id_info(paramType, infoName, infoType); case 150: return ANARI_GEOMETRY_sphere_vertex_position_info(paramType, infoName, infoType); case 151: return ANARI_GEOMETRY_sphere_vertex_radius_info(paramType, infoName, infoType); case 147: return ANARI_GEOMETRY_sphere_vertex_color_info(paramType, infoName, infoType); case 142: return ANARI_GEOMETRY_sphere_vertex_attribute0_info(paramType, infoName, infoType); case 143: return ANARI_GEOMETRY_sphere_vertex_attribute1_info(paramType, infoName, infoType); case 144: return ANARI_GEOMETRY_sphere_vertex_attribute2_info(paramType, infoName, infoType); case 145: return ANARI_GEOMETRY_sphere_vertex_attribute3_info(paramType, infoName, infoType); case 51: return ANARI_GEOMETRY_sphere_primitive_index_info(paramType, infoName, infoType); case 53: return ANARI_GEOMETRY_sphere_radius_info(paramType, infoName, infoType); case 93: return ANARI_GEOMETRY_sphere_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_GEOMETRY_sphere_usd__timeVarying_info(paramType, infoName, infoType); case 124: return ANARI_GEOMETRY_sphere_usd__timeVarying_position_info(paramType, infoName, infoType); case 111: return ANARI_GEOMETRY_sphere_usd__timeVarying_color_info(paramType, infoName, infoType); case 117: return ANARI_GEOMETRY_sphere_usd__timeVarying_index_info(paramType, infoName, infoType); case 126: return ANARI_GEOMETRY_sphere_usd__timeVarying_radius_info(paramType, infoName, infoType); case 115: return ANARI_GEOMETRY_sphere_usd__timeVarying_id_info(paramType, infoName, infoType); case 106: return ANARI_GEOMETRY_sphere_usd__timeVarying_attribute0_info(paramType, infoName, infoType); case 107: return ANARI_GEOMETRY_sphere_usd__timeVarying_attribute1_info(paramType, infoName, infoType); case 108: return ANARI_GEOMETRY_sphere_usd__timeVarying_attribute2_info(paramType, infoName, infoType); case 109: return ANARI_GEOMETRY_sphere_usd__timeVarying_attribute3_info(paramType, infoName, infoType); case 138: return ANARI_GEOMETRY_sphere_usd__useUsdGeomPoints_info(paramType, infoName, infoType); case 86: return ANARI_GEOMETRY_sphere_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_primitive_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_primitive_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_primitive_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_primitive_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_primitive_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_primitive_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "primitive id"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32, ANARI_UINT64, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_vertex_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "vertex position"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_VEC3, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_vertex_normal_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex normal"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_VEC3, ANARI_FIXED16_VEC3, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_vertex_tangent_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex normal"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_VEC3, ANARI_FIXED16_VEC3, ANARI_FLOAT32_VEC4, ANARI_FIXED16_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_vertex_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_vertex_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_vertex_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_vertex_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_vertex_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_primitive_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "index array"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32_VEC3, ANARI_UINT64_VEC3, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 5; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the geometry object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__timeVarying_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying position bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__timeVarying_normal_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying normal bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__timeVarying_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying color bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__timeVarying_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying index bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__timeVarying_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying id bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__timeVarying_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute0 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__timeVarying_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute1 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__timeVarying_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute2 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__timeVarying_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute3 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__attribute0_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Alternative name for attribute0 primvar output"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__attribute1_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Alternative name for attribute1 primvar output"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__attribute2_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Alternative name for attribute2 primvar output"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__attribute3_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Alternative name for attribute3 primvar output"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_GEOMETRY_triangle_name_info(paramType, infoName, infoType); case 49: return ANARI_GEOMETRY_triangle_primitive_color_info(paramType, infoName, infoType); case 45: return ANARI_GEOMETRY_triangle_primitive_attribute0_info(paramType, infoName, infoType); case 46: return ANARI_GEOMETRY_triangle_primitive_attribute1_info(paramType, infoName, infoType); case 47: return ANARI_GEOMETRY_triangle_primitive_attribute2_info(paramType, infoName, infoType); case 48: return ANARI_GEOMETRY_triangle_primitive_attribute3_info(paramType, infoName, infoType); case 50: return ANARI_GEOMETRY_triangle_primitive_id_info(paramType, infoName, infoType); case 150: return ANARI_GEOMETRY_triangle_vertex_position_info(paramType, infoName, infoType); case 148: return ANARI_GEOMETRY_triangle_vertex_normal_info(paramType, infoName, infoType); case 153: return ANARI_GEOMETRY_triangle_vertex_tangent_info(paramType, infoName, infoType); case 147: return ANARI_GEOMETRY_triangle_vertex_color_info(paramType, infoName, infoType); case 142: return ANARI_GEOMETRY_triangle_vertex_attribute0_info(paramType, infoName, infoType); case 143: return ANARI_GEOMETRY_triangle_vertex_attribute1_info(paramType, infoName, infoType); case 144: return ANARI_GEOMETRY_triangle_vertex_attribute2_info(paramType, infoName, infoType); case 145: return ANARI_GEOMETRY_triangle_vertex_attribute3_info(paramType, infoName, infoType); case 51: return ANARI_GEOMETRY_triangle_primitive_index_info(paramType, infoName, infoType); case 93: return ANARI_GEOMETRY_triangle_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_GEOMETRY_triangle_usd__timeVarying_info(paramType, infoName, infoType); case 124: return ANARI_GEOMETRY_triangle_usd__timeVarying_position_info(paramType, infoName, infoType); case 121: return ANARI_GEOMETRY_triangle_usd__timeVarying_normal_info(paramType, infoName, infoType); case 111: return ANARI_GEOMETRY_triangle_usd__timeVarying_color_info(paramType, infoName, infoType); case 117: return ANARI_GEOMETRY_triangle_usd__timeVarying_index_info(paramType, infoName, infoType); case 115: return ANARI_GEOMETRY_triangle_usd__timeVarying_id_info(paramType, infoName, infoType); case 106: return ANARI_GEOMETRY_triangle_usd__timeVarying_attribute0_info(paramType, infoName, infoType); case 107: return ANARI_GEOMETRY_triangle_usd__timeVarying_attribute1_info(paramType, infoName, infoType); case 108: return ANARI_GEOMETRY_triangle_usd__timeVarying_attribute2_info(paramType, infoName, infoType); case 109: return ANARI_GEOMETRY_triangle_usd__timeVarying_attribute3_info(paramType, infoName, infoType); case 74: return ANARI_GEOMETRY_triangle_usd__attribute0_name_info(paramType, infoName, infoType); case 75: return ANARI_GEOMETRY_triangle_usd__attribute1_name_info(paramType, infoName, infoType); case 76: return ANARI_GEOMETRY_triangle_usd__attribute2_name_info(paramType, infoName, infoType); case 77: return ANARI_GEOMETRY_triangle_usd__attribute3_name_info(paramType, infoName, infoType); case 86: return ANARI_GEOMETRY_triangle_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_primitive_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_primitive_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_primitive_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_primitive_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_primitive_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "per primitive attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_primitive_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "primitive id"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32, ANARI_UINT64, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_vertex_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "glyph position"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_VEC3, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_vertex_scale_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "glyph scale"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC3, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_vertex_orientation_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "glyph orientation"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32_QUAT_IJKW, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_vertex_cap_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "glyph cap type for cylinders and cones"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT8, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_vertex_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_vertex_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute0"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_vertex_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute1"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_vertex_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute2"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_vertex_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "vertex attribute3"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_primitive_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "index array"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT32, ANARI_UINT64, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_scale_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "global glyph scale"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_orientation_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "global glyph orientation"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_caps_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "none"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "global cap type for cylinders and cones"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"none", "first", "second", "both", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_shapeType_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "glyph shape geometry type"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_shapeGeometry_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "glyph shape geometry"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_shapeTransform_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "glyph shape transform"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 6; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the geometry object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__timeVarying_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying position bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__timeVarying_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying color bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__timeVarying_index_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying index bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__timeVarying_scale_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying scale bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__timeVarying_orientation_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying orientation bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__timeVarying_id_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying id bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__timeVarying_attribute0_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute0 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__timeVarying_attribute1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute1 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__timeVarying_attribute2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute2 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__timeVarying_attribute3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying attribute3 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__time_shapeGeometry_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the object attached to the shapeGeometry parameter of the glyph geometry, at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_GEOMETRY_glyph_name_info(paramType, infoName, infoType); case 49: return ANARI_GEOMETRY_glyph_primitive_color_info(paramType, infoName, infoType); case 45: return ANARI_GEOMETRY_glyph_primitive_attribute0_info(paramType, infoName, infoType); case 46: return ANARI_GEOMETRY_glyph_primitive_attribute1_info(paramType, infoName, infoType); case 47: return ANARI_GEOMETRY_glyph_primitive_attribute2_info(paramType, infoName, infoType); case 48: return ANARI_GEOMETRY_glyph_primitive_attribute3_info(paramType, infoName, infoType); case 50: return ANARI_GEOMETRY_glyph_primitive_id_info(paramType, infoName, infoType); case 150: return ANARI_GEOMETRY_glyph_vertex_position_info(paramType, infoName, infoType); case 152: return ANARI_GEOMETRY_glyph_vertex_scale_info(paramType, infoName, infoType); case 149: return ANARI_GEOMETRY_glyph_vertex_orientation_info(paramType, infoName, infoType); case 146: return ANARI_GEOMETRY_glyph_vertex_cap_info(paramType, infoName, infoType); case 147: return ANARI_GEOMETRY_glyph_vertex_color_info(paramType, infoName, infoType); case 142: return ANARI_GEOMETRY_glyph_vertex_attribute0_info(paramType, infoName, infoType); case 143: return ANARI_GEOMETRY_glyph_vertex_attribute1_info(paramType, infoName, infoType); case 144: return ANARI_GEOMETRY_glyph_vertex_attribute2_info(paramType, infoName, infoType); case 145: return ANARI_GEOMETRY_glyph_vertex_attribute3_info(paramType, infoName, infoType); case 51: return ANARI_GEOMETRY_glyph_primitive_index_info(paramType, infoName, infoType); case 56: return ANARI_GEOMETRY_glyph_scale_info(paramType, infoName, infoType); case 40: return ANARI_GEOMETRY_glyph_orientation_info(paramType, infoName, infoType); case 7: return ANARI_GEOMETRY_glyph_caps_info(paramType, infoName, infoType); case 59: return ANARI_GEOMETRY_glyph_shapeType_info(paramType, infoName, infoType); case 57: return ANARI_GEOMETRY_glyph_shapeGeometry_info(paramType, infoName, infoType); case 58: return ANARI_GEOMETRY_glyph_shapeTransform_info(paramType, infoName, infoType); case 93: return ANARI_GEOMETRY_glyph_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_GEOMETRY_glyph_usd__timeVarying_info(paramType, infoName, infoType); case 124: return ANARI_GEOMETRY_glyph_usd__timeVarying_position_info(paramType, infoName, infoType); case 111: return ANARI_GEOMETRY_glyph_usd__timeVarying_color_info(paramType, infoName, infoType); case 117: return ANARI_GEOMETRY_glyph_usd__timeVarying_index_info(paramType, infoName, infoType); case 128: return ANARI_GEOMETRY_glyph_usd__timeVarying_scale_info(paramType, infoName, infoType); case 123: return ANARI_GEOMETRY_glyph_usd__timeVarying_orientation_info(paramType, infoName, infoType); case 115: return ANARI_GEOMETRY_glyph_usd__timeVarying_id_info(paramType, infoName, infoType); case 106: return ANARI_GEOMETRY_glyph_usd__timeVarying_attribute0_info(paramType, infoName, infoType); case 107: return ANARI_GEOMETRY_glyph_usd__timeVarying_attribute1_info(paramType, infoName, infoType); case 108: return ANARI_GEOMETRY_glyph_usd__timeVarying_attribute2_info(paramType, infoName, infoType); case 109: return ANARI_GEOMETRY_glyph_usd__timeVarying_attribute3_info(paramType, infoName, infoType); case 103: return ANARI_GEOMETRY_glyph_usd__time_shapeGeometry_info(paramType, infoName, infoType); case 86: return ANARI_GEOMETRY_glyph_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_CAMERA_perspective_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_CAMERA_PERSPECTIVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 7; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_position_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) { static const float default_value[3] = {0.000000f, 0.000000f, 0.000000f}; return default_value; } else { return nullptr; } case 11: // use if(infoType == ANARI_STRING) { return "point"; } else { return nullptr; } case 4: // description { static const char *description = "camera position"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_CAMERA_PERSPECTIVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 7; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_direction_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) { static const float default_value[3] = {0.000000f, 0.000000f, -1.000000f}; return default_value; } else { return nullptr; } case 11: // use if(infoType == ANARI_STRING) { return "direction"; } else { return nullptr; } case 4: // description { static const char *description = "main viewing direction"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_CAMERA_PERSPECTIVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 7; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_up_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) { static const float default_value[3] = {0.000000f, 1.000000f, 0.000000f}; return default_value; } else { return nullptr; } case 11: // use if(infoType == ANARI_STRING) { return "direction"; } else { return nullptr; } case 4: // description { static const char *description = "camera up direction"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_CAMERA_PERSPECTIVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 7; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_imageRegion_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_BOX2 && infoType == ANARI_FLOAT32_BOX2) { static const float default_value[4] = {0.000000f, 0.000000f, 1.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "region mapped to the frame"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_CAMERA_PERSPECTIVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 7; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_fovy_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {1.047198f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "vertical field of view in radians"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_CAMERA_PERSPECTIVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 7; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_aspect_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "aspect ratio"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_CAMERA_PERSPECTIVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 7; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_near_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "near plane clip distance"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_CAMERA_PERSPECTIVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 7; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_far_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "far plane clip distance"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_CAMERA_PERSPECTIVE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 7; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_usd__timeVarying_view_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying view matrix bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_usd__timeVarying_projection_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying projection matrix bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_CAMERA_perspective_name_info(paramType, infoName, infoType); case 44: return ANARI_CAMERA_perspective_position_info(paramType, infoName, infoType); case 15: return ANARI_CAMERA_perspective_direction_info(paramType, infoName, infoType); case 73: return ANARI_CAMERA_perspective_up_info(paramType, infoName, infoType); case 23: return ANARI_CAMERA_perspective_imageRegion_info(paramType, infoName, infoType); case 19: return ANARI_CAMERA_perspective_fovy_info(paramType, infoName, infoType); case 2: return ANARI_CAMERA_perspective_aspect_info(paramType, infoName, infoType); case 36: return ANARI_CAMERA_perspective_near_info(paramType, infoName, infoType); case 17: return ANARI_CAMERA_perspective_far_info(paramType, infoName, infoType); case 105: return ANARI_CAMERA_perspective_usd__timeVarying_info(paramType, infoName, infoType); case 132: return ANARI_CAMERA_perspective_usd__timeVarying_view_info(paramType, infoName, infoType); case 125: return ANARI_CAMERA_perspective_usd__timeVarying_projection_info(paramType, infoName, infoType); case 86: return ANARI_CAMERA_perspective_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_INSTANCE_transform_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_INSTANCE_TRANSFORM"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 8; return &value; } default: return nullptr; } } static const void * ANARI_INSTANCE_transform_transform_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) { static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "transform applied to objects in the instance"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_INSTANCE_TRANSFORM"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 8; return &value; } default: return nullptr; } } static const void * ANARI_INSTANCE_transform_group_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "group object being instanced"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_INSTANCE_TRANSFORM"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 8; return &value; } default: return nullptr; } } static const void * ANARI_INSTANCE_transform_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_INSTANCE_transform_usd__timeVarying_group_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying group bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_INSTANCE_transform_usd__timeVarying_transform_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying transform bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_INSTANCE_transform_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_INSTANCE_transform_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_INSTANCE_transform_name_info(paramType, infoName, infoType); case 70: return ANARI_INSTANCE_transform_transform_info(paramType, infoName, infoType); case 21: return ANARI_INSTANCE_transform_group_info(paramType, infoName, infoType); case 105: return ANARI_INSTANCE_transform_usd__timeVarying_info(paramType, infoName, infoType); case 114: return ANARI_INSTANCE_transform_usd__timeVarying_group_info(paramType, infoName, infoType); case 130: return ANARI_INSTANCE_transform_usd__timeVarying_transform_info(paramType, infoName, infoType); case 86: return ANARI_INSTANCE_transform_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_MATERIAL_matte_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_MATTE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 9; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) { static const float default_value[3] = {0.800000f, 0.800000f, 0.800000f}; return default_value; } else { return nullptr; } case 11: // use if(infoType == ANARI_STRING) { return "color"; } else { return nullptr; } case 4: // description { static const char *description = "diffuse color"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_MATTE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 9; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_opacity_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "opacity"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_MATTE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 9; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_alphaMode_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "opaque"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "alpha mode"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"opaque", "blend", "mask", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_MATTE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 9; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_alphaCutoff_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {0.500000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "cutoff for alpha mask mode"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_MATTE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 9; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the material object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_usd__timeVarying_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying color bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_usd__time_sampler_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the sampler object attached to the color parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_usd__time_sampler_opacity_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the sampler object attached to the opacity parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_MATERIAL_matte_name_info(paramType, infoName, infoType); case 13: return ANARI_MATERIAL_matte_color_info(paramType, infoName, infoType); case 39: return ANARI_MATERIAL_matte_opacity_info(paramType, infoName, infoType); case 1: return ANARI_MATERIAL_matte_alphaMode_info(paramType, infoName, infoType); case 0: return ANARI_MATERIAL_matte_alphaCutoff_info(paramType, infoName, infoType); case 93: return ANARI_MATERIAL_matte_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_MATERIAL_matte_usd__timeVarying_info(paramType, infoName, infoType); case 111: return ANARI_MATERIAL_matte_usd__timeVarying_color_info(paramType, infoName, infoType); case 97: return ANARI_MATERIAL_matte_usd__time_sampler_color_info(paramType, infoName, infoType); case 101: return ANARI_MATERIAL_matte_usd__time_sampler_opacity_info(paramType, infoName, infoType); case 86: return ANARI_MATERIAL_matte_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_baseColor_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) { static const float default_value[3] = {1.000000f, 1.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 11: // use if(infoType == ANARI_STRING) { return "color"; } else { return nullptr; } case 4: // description { static const char *description = "base color"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_opacity_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "opacity"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_metallic_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "metallic factor"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_roughness_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "roughness factor"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_normal_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "normal map"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_emissive_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) { static const float default_value[3] = {0.000000f, 0.000000f, 0.000000f}; return default_value; } else { return nullptr; } case 11: // use if(infoType == ANARI_STRING) { return "color"; } else { return nullptr; } case 4: // description { static const char *description = "emissive factor"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_occlusion_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "precomputed occlusion"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_alphaMode_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "opaque"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "alpha mode"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"opaque", "blend", "mask", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_alphaCutoff_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {0.500000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "cutoff for alpha mask mode"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_specular_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "specular factor"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_specularColor_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) { static const float default_value[3] = {1.000000f, 1.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 11: // use if(infoType == ANARI_STRING) { return "color"; } else { return nullptr; } case 4: // description { static const char *description = "specular color"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_clearcoat_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "clearcoat factor"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_clearcoatRoughness_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "clearcoat roughness"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_clearcoatNormal_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "clearcoat normal map"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_transmission_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "transmission factor"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_ior_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {1.500000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "index of refraction"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_thickness_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "wall thickness"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_attenuationDistance_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {INFINITY}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "attenuation distance"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_attenuationColor_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) { static const float default_value[3] = {1.000000f, 1.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 11: // use if(infoType == ANARI_STRING) { return "color"; } else { return nullptr; } case 4: // description { static const char *description = "attenuation color"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_sheenColor_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) { static const float default_value[3] = {0.000000f, 0.000000f, 0.000000f}; return default_value; } else { return nullptr; } case 11: // use if(infoType == ANARI_STRING) { return "color"; } else { return nullptr; } case 4: // description { static const char *description = "sheen color"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_sheenRoughness_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "sheen roughness"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_iridescence_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "iridescence factor"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_iridescenceIor_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {1.300000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "iridescence index of refraction"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_iridescenceThickness_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "iridescence thicknness"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 10; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the material object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__timeVarying_baseColor_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying baseColor bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__timeVarying_opacity_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying opacity bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__timeVarying_emissive_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying emissive bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__timeVarying_roughness_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying roughness bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__timeVarying_metallic_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying metallic bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__timeVarying_ior_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying ior bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__time_sampler_baseColor_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the sampler object attached to the baseColor parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__time_sampler_opacity_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the sampler object attached to the opacity parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__time_sampler_emissive_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the sampler object attached to the emissive parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__time_sampler_roughness_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the sampler object attached to the roughness parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__time_sampler_metallic_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the sampler object attached to the metallic parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__time_sampler_ior_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the sampler object attached to the ior parameter of the material (if so), at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_MATERIAL_physicallyBased_name_info(paramType, infoName, infoType); case 5: return ANARI_MATERIAL_physicallyBased_baseColor_info(paramType, infoName, infoType); case 39: return ANARI_MATERIAL_physicallyBased_opacity_info(paramType, infoName, infoType); case 34: return ANARI_MATERIAL_physicallyBased_metallic_info(paramType, infoName, infoType); case 55: return ANARI_MATERIAL_physicallyBased_roughness_info(paramType, infoName, infoType); case 37: return ANARI_MATERIAL_physicallyBased_normal_info(paramType, infoName, infoType); case 16: return ANARI_MATERIAL_physicallyBased_emissive_info(paramType, infoName, infoType); case 38: return ANARI_MATERIAL_physicallyBased_occlusion_info(paramType, infoName, infoType); case 1: return ANARI_MATERIAL_physicallyBased_alphaMode_info(paramType, infoName, infoType); case 0: return ANARI_MATERIAL_physicallyBased_alphaCutoff_info(paramType, infoName, infoType); case 64: return ANARI_MATERIAL_physicallyBased_specular_info(paramType, infoName, infoType); case 65: return ANARI_MATERIAL_physicallyBased_specularColor_info(paramType, infoName, infoType); case 10: return ANARI_MATERIAL_physicallyBased_clearcoat_info(paramType, infoName, infoType); case 12: return ANARI_MATERIAL_physicallyBased_clearcoatRoughness_info(paramType, infoName, infoType); case 11: return ANARI_MATERIAL_physicallyBased_clearcoatNormal_info(paramType, infoName, infoType); case 71: return ANARI_MATERIAL_physicallyBased_transmission_info(paramType, infoName, infoType); case 28: return ANARI_MATERIAL_physicallyBased_ior_info(paramType, infoName, infoType); case 69: return ANARI_MATERIAL_physicallyBased_thickness_info(paramType, infoName, infoType); case 4: return ANARI_MATERIAL_physicallyBased_attenuationDistance_info(paramType, infoName, infoType); case 3: return ANARI_MATERIAL_physicallyBased_attenuationColor_info(paramType, infoName, infoType); case 60: return ANARI_MATERIAL_physicallyBased_sheenColor_info(paramType, infoName, infoType); case 61: return ANARI_MATERIAL_physicallyBased_sheenRoughness_info(paramType, infoName, infoType); case 29: return ANARI_MATERIAL_physicallyBased_iridescence_info(paramType, infoName, infoType); case 30: return ANARI_MATERIAL_physicallyBased_iridescenceIor_info(paramType, infoName, infoType); case 31: return ANARI_MATERIAL_physicallyBased_iridescenceThickness_info(paramType, infoName, infoType); case 93: return ANARI_MATERIAL_physicallyBased_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_MATERIAL_physicallyBased_usd__timeVarying_info(paramType, infoName, infoType); case 110: return ANARI_MATERIAL_physicallyBased_usd__timeVarying_baseColor_info(paramType, infoName, infoType); case 122: return ANARI_MATERIAL_physicallyBased_usd__timeVarying_opacity_info(paramType, infoName, infoType); case 113: return ANARI_MATERIAL_physicallyBased_usd__timeVarying_emissive_info(paramType, infoName, infoType); case 127: return ANARI_MATERIAL_physicallyBased_usd__timeVarying_roughness_info(paramType, infoName, infoType); case 120: return ANARI_MATERIAL_physicallyBased_usd__timeVarying_metallic_info(paramType, infoName, infoType); case 119: return ANARI_MATERIAL_physicallyBased_usd__timeVarying_ior_info(paramType, infoName, infoType); case 96: return ANARI_MATERIAL_physicallyBased_usd__time_sampler_baseColor_info(paramType, infoName, infoType); case 101: return ANARI_MATERIAL_physicallyBased_usd__time_sampler_opacity_info(paramType, infoName, infoType); case 98: return ANARI_MATERIAL_physicallyBased_usd__time_sampler_emissive_info(paramType, infoName, infoType); case 102: return ANARI_MATERIAL_physicallyBased_usd__time_sampler_roughness_info(paramType, infoName, infoType); case 100: return ANARI_MATERIAL_physicallyBased_usd__time_sampler_metallic_info(paramType, infoName, infoType); case 99: return ANARI_MATERIAL_physicallyBased_usd__time_sampler_ior_info(paramType, infoName, infoType); case 86: return ANARI_MATERIAL_physicallyBased_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 11; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_image_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "array backing the sampler"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 11; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_inAttribute_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "attribute0"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "input surface attribute (texture coordinate)"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 11; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_filter_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "nearest"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "filter mode"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"nearest", "linear", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 11; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_wrapMode1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "clampToEdge"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "wrap mode for the 1st dimension"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"clampToEdge", "repeat", "mirrorRepeat", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 11; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_inTransform_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) { static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "transform applied to the input attribute before sampling"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 11; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_inOffset_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC4 && infoType == ANARI_FLOAT32_VEC4) { static const float default_value[4] = {0.000000f, 0.000000f, 0.000000f, 0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "offset added to output inTransform result"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 11; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_outTransform_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) { static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "transform applied to the sampled values"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 11; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_outOffset_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC4 && infoType == ANARI_FLOAT32_VEC4) { static const float default_value[4] = {0.000000f, 0.000000f, 0.000000f, 0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "offset added to output outTransform result"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 11; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the sampler object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_usd__timeVarying_image_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying image/imageUrl bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_usd__timeVarying_wrapMode_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying wrapMode bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_usd__imageUrl_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Location of an image which will directly be written into the USD sampler"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_SAMPLER_image1D_name_info(paramType, infoName, infoType); case 22: return ANARI_SAMPLER_image1D_image_info(paramType, infoName, infoType); case 24: return ANARI_SAMPLER_image1D_inAttribute_info(paramType, infoName, infoType); case 18: return ANARI_SAMPLER_image1D_filter_info(paramType, infoName, infoType); case 156: return ANARI_SAMPLER_image1D_wrapMode1_info(paramType, infoName, infoType); case 26: return ANARI_SAMPLER_image1D_inTransform_info(paramType, infoName, infoType); case 25: return ANARI_SAMPLER_image1D_inOffset_info(paramType, infoName, infoType); case 43: return ANARI_SAMPLER_image1D_outTransform_info(paramType, infoName, infoType); case 42: return ANARI_SAMPLER_image1D_outOffset_info(paramType, infoName, infoType); case 93: return ANARI_SAMPLER_image1D_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_SAMPLER_image1D_usd__timeVarying_info(paramType, infoName, infoType); case 116: return ANARI_SAMPLER_image1D_usd__timeVarying_image_info(paramType, infoName, infoType); case 134: return ANARI_SAMPLER_image1D_usd__timeVarying_wrapMode_info(paramType, infoName, infoType); case 81: return ANARI_SAMPLER_image1D_usd__imageUrl_info(paramType, infoName, infoType); case 86: return ANARI_SAMPLER_image1D_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE2D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 12; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_image_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "array backing the sampler"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE2D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 12; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_inAttribute_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "attribute0"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "input surface attribute (texture coordinate)"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE2D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 12; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_filter_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "nearest"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "filter mode"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"nearest", "linear", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE2D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 12; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_wrapMode1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "clampToEdge"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "wrap mode for the 1st dimension"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"clampToEdge", "repeat", "mirrorRepeat", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE2D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 12; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_wrapMode2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "clampToEdge"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "wrap mode for the 2nd dimension"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"clampToEdge", "repeat", "mirrorRepeat", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE2D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 12; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_inTransform_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) { static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "transform applied to the input attribute before sampling"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE2D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 12; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_inOffset_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC4 && infoType == ANARI_FLOAT32_VEC4) { static const float default_value[4] = {0.000000f, 0.000000f, 0.000000f, 0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "offset added to output inTransform result"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE2D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 12; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_outTransform_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) { static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "transform applied to the sampled values"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE2D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 12; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_outOffset_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC4 && infoType == ANARI_FLOAT32_VEC4) { static const float default_value[4] = {0.000000f, 0.000000f, 0.000000f, 0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "offset added to output outTransform result"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE2D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 12; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the sampler object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_usd__timeVarying_image_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying image/imageUrl bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_usd__timeVarying_wrapMode1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying wrapMode1 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_usd__timeVarying_wrapMode2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying wrapMode2 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_usd__imageUrl_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Location of an image which will directly be written into the USD sampler"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_SAMPLER_image2D_name_info(paramType, infoName, infoType); case 22: return ANARI_SAMPLER_image2D_image_info(paramType, infoName, infoType); case 24: return ANARI_SAMPLER_image2D_inAttribute_info(paramType, infoName, infoType); case 18: return ANARI_SAMPLER_image2D_filter_info(paramType, infoName, infoType); case 156: return ANARI_SAMPLER_image2D_wrapMode1_info(paramType, infoName, infoType); case 157: return ANARI_SAMPLER_image2D_wrapMode2_info(paramType, infoName, infoType); case 26: return ANARI_SAMPLER_image2D_inTransform_info(paramType, infoName, infoType); case 25: return ANARI_SAMPLER_image2D_inOffset_info(paramType, infoName, infoType); case 43: return ANARI_SAMPLER_image2D_outTransform_info(paramType, infoName, infoType); case 42: return ANARI_SAMPLER_image2D_outOffset_info(paramType, infoName, infoType); case 93: return ANARI_SAMPLER_image2D_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_SAMPLER_image2D_usd__timeVarying_info(paramType, infoName, infoType); case 116: return ANARI_SAMPLER_image2D_usd__timeVarying_image_info(paramType, infoName, infoType); case 135: return ANARI_SAMPLER_image2D_usd__timeVarying_wrapMode1_info(paramType, infoName, infoType); case 136: return ANARI_SAMPLER_image2D_usd__timeVarying_wrapMode2_info(paramType, infoName, infoType); case 81: return ANARI_SAMPLER_image2D_usd__imageUrl_info(paramType, infoName, infoType); case 86: return ANARI_SAMPLER_image2D_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 13; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_image_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "array backing the sampler"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 13; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_inAttribute_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "attribute0"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "input surface attribute (texture coordinate)"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"color", "worldPosition", "worldNormal", "objectPosition", "objectNormal", "attribute0", "attribute1", "attribute2", "attribute3", "primitiveId", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 13; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_filter_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "nearest"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "filter mode"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"nearest", "linear", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 13; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_wrapMode1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "clampToEdge"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "wrap mode for the 1st dimension"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"clampToEdge", "repeat", "mirrorRepeat", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 13; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_wrapMode2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "clampToEdge"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "wrap mode for the 2nd dimension"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"clampToEdge", "repeat", "mirrorRepeat", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 13; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_wrapMode3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "clampToEdge"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "wrap mode for the 3rd dimension"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"clampToEdge", "repeat", "mirrorRepeat", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 13; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_inTransform_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) { static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "transform applied to the input attribute before sampling"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 13; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_inOffset_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC4 && infoType == ANARI_FLOAT32_VEC4) { static const float default_value[4] = {0.000000f, 0.000000f, 0.000000f, 0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "offset added to output inTransform result"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 13; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_outTransform_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) { static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "transform applied to the sampled values"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 13; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_outOffset_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC4 && infoType == ANARI_FLOAT32_VEC4) { static const float default_value[4] = {0.000000f, 0.000000f, 0.000000f, 0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "offset added to output outTransform result"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 13; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the sampler object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_usd__timeVarying_image_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying image/imageUrl bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_usd__timeVarying_wrapMode1_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying wrapMode1 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_usd__timeVarying_wrapMode2_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying wrapMode2 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_usd__timeVarying_wrapMode3_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying wrapMode3 bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_usd__imageUrl_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Location of an image which will directly be written into the USD sampler"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_SAMPLER_image3D_name_info(paramType, infoName, infoType); case 22: return ANARI_SAMPLER_image3D_image_info(paramType, infoName, infoType); case 24: return ANARI_SAMPLER_image3D_inAttribute_info(paramType, infoName, infoType); case 18: return ANARI_SAMPLER_image3D_filter_info(paramType, infoName, infoType); case 156: return ANARI_SAMPLER_image3D_wrapMode1_info(paramType, infoName, infoType); case 157: return ANARI_SAMPLER_image3D_wrapMode2_info(paramType, infoName, infoType); case 158: return ANARI_SAMPLER_image3D_wrapMode3_info(paramType, infoName, infoType); case 26: return ANARI_SAMPLER_image3D_inTransform_info(paramType, infoName, infoType); case 25: return ANARI_SAMPLER_image3D_inOffset_info(paramType, infoName, infoType); case 43: return ANARI_SAMPLER_image3D_outTransform_info(paramType, infoName, infoType); case 42: return ANARI_SAMPLER_image3D_outOffset_info(paramType, infoName, infoType); case 93: return ANARI_SAMPLER_image3D_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_SAMPLER_image3D_usd__timeVarying_info(paramType, infoName, infoType); case 116: return ANARI_SAMPLER_image3D_usd__timeVarying_image_info(paramType, infoName, infoType); case 135: return ANARI_SAMPLER_image3D_usd__timeVarying_wrapMode1_info(paramType, infoName, infoType); case 136: return ANARI_SAMPLER_image3D_usd__timeVarying_wrapMode2_info(paramType, infoName, infoType); case 137: return ANARI_SAMPLER_image3D_usd__timeVarying_wrapMode3_info(paramType, infoName, infoType); case 81: return ANARI_SAMPLER_image3D_usd__imageUrl_info(paramType, infoName, infoType); case 86: return ANARI_SAMPLER_image3D_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_structuredRegular_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SPATIAL_FIELD_STRUCTURED_REGULAR"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 14; return &value; } default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_structuredRegular_data_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "array of vertex centered scalar values"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UINT8, ANARI_INT16, ANARI_UINT16, ANARI_FLOAT32, ANARI_FLOAT64, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SPATIAL_FIELD_STRUCTURED_REGULAR"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 14; return &value; } default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_structuredRegular_origin_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) { static const float default_value[3] = {0.000000f, 0.000000f, 0.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "origin of the grid in object-space"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SPATIAL_FIELD_STRUCTURED_REGULAR"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 14; return &value; } default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_structuredRegular_spacing_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) { static const float default_value[3] = {1.000000f, 1.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "size of the grid cells in object-space"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SPATIAL_FIELD_STRUCTURED_REGULAR"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 14; return &value; } default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_structuredRegular_filter_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_STRING && infoType == ANARI_STRING) { static const char *default_value = "linear"; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "filter mode used to interpolate the grid"; return description; } case 6: // value if(paramType == ANARI_STRING && infoType == ANARI_STRING_LIST) { static const char *values[] = {"nearest", "linear", nullptr}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SPATIAL_FIELD_STRUCTURED_REGULAR"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 14; return &value; } default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_structuredRegular_usd__time_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT64 && infoType == ANARI_FLOAT64) { static const double default_value[1] = {0.000000}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Timestep of the spatialfield object"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_structuredRegular_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_structuredRegular_usd__timeVarying_data_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying data bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_structuredRegular_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_structuredRegular_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_SPATIAL_FIELD_structuredRegular_name_info(paramType, infoName, infoType); case 14: return ANARI_SPATIAL_FIELD_structuredRegular_data_info(paramType, infoName, infoType); case 41: return ANARI_SPATIAL_FIELD_structuredRegular_origin_info(paramType, infoName, infoType); case 63: return ANARI_SPATIAL_FIELD_structuredRegular_spacing_info(paramType, infoName, infoType); case 18: return ANARI_SPATIAL_FIELD_structuredRegular_filter_info(paramType, infoName, infoType); case 93: return ANARI_SPATIAL_FIELD_structuredRegular_usd__time_info(paramType, infoName, infoType); case 105: return ANARI_SPATIAL_FIELD_structuredRegular_usd__timeVarying_info(paramType, infoName, infoType); case 112: return ANARI_SPATIAL_FIELD_structuredRegular_usd__timeVarying_data_info(paramType, infoName, infoType); case 86: return ANARI_SPATIAL_FIELD_structuredRegular_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_name_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "optional object name"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_VOLUME_TRANSFER_FUNCTION1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 15; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_value_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "spatial field used for the field values of the volume"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_VOLUME_TRANSFER_FUNCTION1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 15; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_valueRange_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32_BOX1 && infoType == ANARI_FLOAT32_BOX1) { static const float default_value[2] = {0.000000f, 1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "sampled values of field are clamped to this range"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_VOLUME_TRANSFER_FUNCTION1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 15; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "sampled color"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_UFIXED8, ANARI_UFIXED8_VEC2, ANARI_UFIXED8_VEC3, ANARI_UFIXED8_VEC4, ANARI_UFIXED8_R_SRGB, ANARI_UFIXED8_RA_SRGB, ANARI_UFIXED8_RGB_SRGB, ANARI_UFIXED8_RGBA_SRGB, ANARI_UFIXED16, ANARI_UFIXED16_VEC2, ANARI_UFIXED16_VEC3, ANARI_UFIXED16_VEC4, ANARI_UFIXED32, ANARI_UFIXED32_VEC2, ANARI_UFIXED32_VEC3, ANARI_UFIXED32_VEC4, ANARI_FLOAT32, ANARI_FLOAT32_VEC2, ANARI_FLOAT32_VEC3, ANARI_FLOAT32_VEC4, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_VOLUME_TRANSFER_FUNCTION1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 15; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_opacity_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_true; } else { return nullptr; } case 4: // description { static const char *description = "sampled opacity"; return description; } case 5: // elementType if(infoType == ANARI_DATA_TYPE_LIST) { static const ANARIDataType values[] = {ANARI_FLOAT32, ANARI_UNKNOWN}; return values; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_VOLUME_TRANSFER_FUNCTION1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 15; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_unitDistance_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) { static const float default_value[1] = {1.000000f}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "makes volumes uniformly thinner or thicker"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_VOLUME_TRANSFER_FUNCTION1D"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 15; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_usd__timeVarying_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "Time varying bitfield"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_usd__timeVarying_color_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying color bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_usd__timeVarying_opacity_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying opacity bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_usd__timeVarying_valueRange_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(1)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Time varying valueRange bit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_usd__preClassified_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Use preclassification to produce a VDB grid with a color and opacity field, instead of a density field"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_usd__time_value_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 4: // description { static const char *description = "The timestep of the object attached to the value parameter of the volume, at the timestep of the device/scene for the next commit. The default value is the object's time parameter, or otherwise the device value if left unset."; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_usd__removePrim_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) { (void)paramType; switch(infoName) { case 0: // required if(infoType == ANARI_BOOL) { return &anari_false; } else { return nullptr; } case 1: // default if(paramType == ANARI_BOOL && infoType == ANARI_BOOL) { static const int32_t default_value[1] = {INT32_C(0)}; return default_value; } else { return nullptr; } case 4: // description { static const char *description = "Explicitly delete prim from USD output after commit"; return description; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "USD_DEVICE"; return extension; } else if(infoType == ANARI_INT32) { static const int32_t value = 16; return &value; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(param_hash(paramName)) { case 35: return ANARI_VOLUME_transferFunction1D_name_info(paramType, infoName, infoType); case 140: return ANARI_VOLUME_transferFunction1D_value_info(paramType, infoName, infoType); case 141: return ANARI_VOLUME_transferFunction1D_valueRange_info(paramType, infoName, infoType); case 13: return ANARI_VOLUME_transferFunction1D_color_info(paramType, infoName, infoType); case 39: return ANARI_VOLUME_transferFunction1D_opacity_info(paramType, infoName, infoType); case 72: return ANARI_VOLUME_transferFunction1D_unitDistance_info(paramType, infoName, infoType); case 105: return ANARI_VOLUME_transferFunction1D_usd__timeVarying_info(paramType, infoName, infoType); case 111: return ANARI_VOLUME_transferFunction1D_usd__timeVarying_color_info(paramType, infoName, infoType); case 122: return ANARI_VOLUME_transferFunction1D_usd__timeVarying_opacity_info(paramType, infoName, infoType); case 131: return ANARI_VOLUME_transferFunction1D_usd__timeVarying_valueRange_info(paramType, infoName, infoType); case 85: return ANARI_VOLUME_transferFunction1D_usd__preClassified_info(paramType, infoName, infoType); case 104: return ANARI_VOLUME_transferFunction1D_usd__time_value_info(paramType, infoName, infoType); case 86: return ANARI_VOLUME_transferFunction1D_usd__removePrim_info(paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_CAMERA_param_info(const char *subtype, const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 9: return ANARI_CAMERA_perspective_param_info(paramName, paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_GEOMETRY_param_info(const char *subtype, const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 0: return ANARI_GEOMETRY_cone_param_info(paramName, paramType, infoName, infoType); case 1: return ANARI_GEOMETRY_curve_param_info(paramName, paramType, infoName, infoType); case 2: return ANARI_GEOMETRY_cylinder_param_info(paramName, paramType, infoName, infoType); case 11: return ANARI_GEOMETRY_quad_param_info(paramName, paramType, infoName, infoType); case 12: return ANARI_GEOMETRY_sphere_param_info(paramName, paramType, infoName, infoType); case 16: return ANARI_GEOMETRY_triangle_param_info(paramName, paramType, infoName, infoType); case 4: return ANARI_GEOMETRY_glyph_param_info(paramName, paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_INSTANCE_param_info(const char *subtype, const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 15: return ANARI_INSTANCE_transform_param_info(paramName, paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_MATERIAL_param_info(const char *subtype, const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 8: return ANARI_MATERIAL_matte_param_info(paramName, paramType, infoName, infoType); case 10: return ANARI_MATERIAL_physicallyBased_param_info(paramName, paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_RENDERER_param_info(const char *subtype, const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 3: return ANARI_RENDERER_default_param_info(paramName, paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_SAMPLER_param_info(const char *subtype, const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 5: return ANARI_SAMPLER_image1D_param_info(paramName, paramType, infoName, infoType); case 6: return ANARI_SAMPLER_image2D_param_info(paramName, paramType, infoName, infoType); case 7: return ANARI_SAMPLER_image3D_param_info(paramName, paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_param_info(const char *subtype, const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 13: return ANARI_SPATIAL_FIELD_structuredRegular_param_info(paramName, paramType, infoName, infoType); default: return nullptr; } } static const void * ANARI_VOLUME_param_info(const char *subtype, const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 14: return ANARI_VOLUME_transferFunction1D_param_info(paramName, paramType, infoName, infoType); default: return nullptr; } } const void * query_param_info_enum(ANARIDataType type, const char *subtype, const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) { switch(type) { case ANARI_CAMERA: return ANARI_CAMERA_param_info(subtype, paramName, paramType, infoName, infoType); case ANARI_GEOMETRY: return ANARI_GEOMETRY_param_info(subtype, paramName, paramType, infoName, infoType); case ANARI_INSTANCE: return ANARI_INSTANCE_param_info(subtype, paramName, paramType, infoName, infoType); case ANARI_MATERIAL: return ANARI_MATERIAL_param_info(subtype, paramName, paramType, infoName, infoType); case ANARI_RENDERER: return ANARI_RENDERER_param_info(subtype, paramName, paramType, infoName, infoType); case ANARI_SAMPLER: return ANARI_SAMPLER_param_info(subtype, paramName, paramType, infoName, infoType); case ANARI_SPATIAL_FIELD: return ANARI_SPATIAL_FIELD_param_info(subtype, paramName, paramType, infoName, infoType); case ANARI_VOLUME: return ANARI_VOLUME_param_info(subtype, paramName, paramType, infoName, infoType); case ANARI_DEVICE: return ANARI_DEVICE_param_info(paramName, paramType, infoName, infoType); case ANARI_ARRAY1D: return ANARI_ARRAY1D_param_info(paramName, paramType, infoName, infoType); case ANARI_ARRAY2D: return ANARI_ARRAY2D_param_info(paramName, paramType, infoName, infoType); case ANARI_ARRAY3D: return ANARI_ARRAY3D_param_info(paramName, paramType, infoName, infoType); case ANARI_FRAME: return ANARI_FRAME_param_info(paramName, paramType, infoName, infoType); case ANARI_GROUP: return ANARI_GROUP_param_info(paramName, paramType, infoName, infoType); case ANARI_WORLD: return ANARI_WORLD_param_info(paramName, paramType, infoName, infoType); case ANARI_SURFACE: return ANARI_SURFACE_param_info(paramName, paramType, infoName, infoType); default: return nullptr; } } const void * query_param_info(ANARIDataType type, const char *subtype, const char *paramName, ANARIDataType paramType, const char *infoNameString, ANARIDataType infoType) { int infoName = info_hash(infoNameString); return query_param_info_enum(type, subtype, paramName, paramType, infoName, infoType); } static const void * ANARI_DEVICE_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "device object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"statusCallback", ANARI_STATUS_CALLBACK}, {"statusCallbackUserData", ANARI_VOID_POINTER}, {"usd::serialize.hostName", ANARI_STRING}, {"usd::serialize.location", ANARI_STRING}, {"usd::serialize.newSession", ANARI_BOOL}, {"usd::serialize.outputBinary", ANARI_BOOL}, {"usd::time", ANARI_FLOAT64}, {"usd::writeAtCommit", ANARI_BOOL}, {"usd::output.material", ANARI_BOOL}, {"usd::output.previewSurfaceShader", ANARI_BOOL}, {"usd::output.mdlShader", ANARI_BOOL}, {"usd::connection.logVerbosity", ANARI_INT32}, {"usd::sceneStage", ANARI_VOID_POINTER}, {"usd::enableSaving", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 8: // extension if(infoType == ANARI_STRING_LIST) { static const char *extensions[] = { "ANARI_KHR_GEOMETRY_CONE", "ANARI_KHR_GEOMETRY_CURVE", "ANARI_KHR_GEOMETRY_CYLINDER", "ANARI_KHR_GEOMETRY_QUAD", "ANARI_KHR_GEOMETRY_SPHERE", "ANARI_KHR_GEOMETRY_TRIANGLE", "ANARI_KHR_GEOMETRY_GLYPH", "ANARI_KHR_CAMERA_PERSPECTIVE", "ANARI_KHR_INSTANCE_TRANSFORM", "ANARI_KHR_MATERIAL_MATTE", "ANARI_KHR_MATERIAL_PHYSICALLY_BASED", "ANARI_KHR_SAMPLER_IMAGE1D", "ANARI_KHR_SAMPLER_IMAGE2D", "ANARI_KHR_SAMPLER_IMAGE3D", "ANARI_KHR_SPATIAL_FIELD_STRUCTURED_REGULAR", "ANARI_KHR_VOLUME_TRANSFER_FUNCTION1D", "ANARI_USD_DEVICE", 0 }; return extensions; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_ARRAY1D_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "one dimensional array object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_ARRAY2D_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "two dimensional array object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_ARRAY3D_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "three dimensional array object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_FRAME_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "frame object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"world", ANARI_WORLD}, {"renderer", ANARI_RENDERER}, {"camera", ANARI_CAMERA}, {"size", ANARI_UINT32_VEC2}, {"channel.color", ANARI_DATA_TYPE}, {"channel.depth", ANARI_DATA_TYPE}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 10: // channel if(infoType == ANARI_STRING_LIST) { static const char *channel[] = { "channel.color", "channel.depth", 0 }; return channel; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_GROUP_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "group object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"surface", ANARI_ARRAY1D}, {"volume", ANARI_ARRAY1D}, {"light", ANARI_ARRAY1D}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.surface", ANARI_BOOL}, {"usd::timeVarying.volume", ANARI_BOOL}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_WORLD_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "world object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"instance", ANARI_ARRAY1D}, {"surface", ANARI_ARRAY1D}, {"volume", ANARI_ARRAY1D}, {"light", ANARI_ARRAY1D}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.instance", ANARI_BOOL}, {"usd::timeVarying.surface", ANARI_BOOL}, {"usd::timeVarying.volume", ANARI_BOOL}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_RENDERER_default_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "default renderer"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 8: // extension if(infoType == ANARI_STRING_LIST) { static const char *extensions[] = { "ANARI_KHR_GEOMETRY_CONE", "ANARI_KHR_GEOMETRY_CURVE", "ANARI_KHR_GEOMETRY_CYLINDER", "ANARI_KHR_GEOMETRY_QUAD", "ANARI_KHR_GEOMETRY_SPHERE", "ANARI_KHR_GEOMETRY_TRIANGLE", "ANARI_KHR_GEOMETRY_GLYPH", "ANARI_KHR_CAMERA_PERSPECTIVE", "ANARI_KHR_INSTANCE_TRANSFORM", "ANARI_KHR_MATERIAL_MATTE", "ANARI_KHR_MATERIAL_PHYSICALLY_BASED", "ANARI_KHR_SAMPLER_IMAGE1D", "ANARI_KHR_SAMPLER_IMAGE2D", "ANARI_KHR_SAMPLER_IMAGE3D", "ANARI_KHR_SPATIAL_FIELD_STRUCTURED_REGULAR", "ANARI_KHR_VOLUME_TRANSFER_FUNCTION1D", "ANARI_USD_DEVICE", 0 }; return extensions; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_SURFACE_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "surface object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"geometry", ANARI_GEOMETRY}, {"material", ANARI_MATERIAL}, {"usd::timeVarying", ANARI_INT32}, {"usd::time.geometry", ANARI_FLOAT64}, {"usd::time.material", ANARI_FLOAT64}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cone_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "cone geometry object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"primitive.color", ANARI_ARRAY1D}, {"primitive.attribute0", ANARI_ARRAY1D}, {"primitive.attribute1", ANARI_ARRAY1D}, {"primitive.attribute2", ANARI_ARRAY1D}, {"primitive.attribute3", ANARI_ARRAY1D}, {"primitive.id", ANARI_ARRAY1D}, {"vertex.position", ANARI_ARRAY1D}, {"vertex.radius", ANARI_ARRAY1D}, {"vertex.cap", ANARI_ARRAY1D}, {"vertex.color", ANARI_ARRAY1D}, {"vertex.attribute0", ANARI_ARRAY1D}, {"vertex.attribute1", ANARI_ARRAY1D}, {"vertex.attribute2", ANARI_ARRAY1D}, {"vertex.attribute3", ANARI_ARRAY1D}, {"primitive.index", ANARI_ARRAY1D}, {"caps", ANARI_STRING}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.position", ANARI_BOOL}, {"usd::timeVarying.color", ANARI_BOOL}, {"usd::timeVarying.index", ANARI_BOOL}, {"usd::timeVarying.radius", ANARI_BOOL}, {"usd::timeVarying.id", ANARI_BOOL}, {"usd::timeVarying.attribute0", ANARI_BOOL}, {"usd::timeVarying.attribute1", ANARI_BOOL}, {"usd::timeVarying.attribute2", ANARI_BOOL}, {"usd::timeVarying.attribute3", ANARI_BOOL}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CONE"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 0; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_GEOMETRY_curve_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "curve geometry object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"primitive.color", ANARI_ARRAY1D}, {"primitive.attribute0", ANARI_ARRAY1D}, {"primitive.attribute1", ANARI_ARRAY1D}, {"primitive.attribute2", ANARI_ARRAY1D}, {"primitive.attribute3", ANARI_ARRAY1D}, {"primitive.id", ANARI_ARRAY1D}, {"vertex.position", ANARI_ARRAY1D}, {"vertex.radius", ANARI_ARRAY1D}, {"vertex.color", ANARI_ARRAY1D}, {"vertex.attribute0", ANARI_ARRAY1D}, {"vertex.attribute1", ANARI_ARRAY1D}, {"vertex.attribute2", ANARI_ARRAY1D}, {"vertex.attribute3", ANARI_ARRAY1D}, {"primitive.index", ANARI_ARRAY1D}, {"radius", ANARI_FLOAT32}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.position", ANARI_BOOL}, {"usd::timeVarying.color", ANARI_BOOL}, {"usd::timeVarying.index", ANARI_BOOL}, {"usd::timeVarying.radius", ANARI_BOOL}, {"usd::timeVarying.id", ANARI_BOOL}, {"usd::timeVarying.attribute0", ANARI_BOOL}, {"usd::timeVarying.attribute1", ANARI_BOOL}, {"usd::timeVarying.attribute2", ANARI_BOOL}, {"usd::timeVarying.attribute3", ANARI_BOOL}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CURVE"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 1; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_GEOMETRY_cylinder_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "cylinder geometry object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"primitive.color", ANARI_ARRAY1D}, {"primitive.attribute0", ANARI_ARRAY1D}, {"primitive.attribute1", ANARI_ARRAY1D}, {"primitive.attribute2", ANARI_ARRAY1D}, {"primitive.attribute3", ANARI_ARRAY1D}, {"primitive.id", ANARI_ARRAY1D}, {"vertex.position", ANARI_ARRAY1D}, {"vertex.cap", ANARI_ARRAY1D}, {"vertex.color", ANARI_ARRAY1D}, {"vertex.attribute0", ANARI_ARRAY1D}, {"vertex.attribute1", ANARI_ARRAY1D}, {"vertex.attribute2", ANARI_ARRAY1D}, {"vertex.attribute3", ANARI_ARRAY1D}, {"primitive.index", ANARI_ARRAY1D}, {"primitive.radius", ANARI_ARRAY1D}, {"radius", ANARI_FLOAT32}, {"caps", ANARI_STRING}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.position", ANARI_BOOL}, {"usd::timeVarying.color", ANARI_BOOL}, {"usd::timeVarying.index", ANARI_BOOL}, {"usd::timeVarying.radius", ANARI_BOOL}, {"usd::timeVarying.id", ANARI_BOOL}, {"usd::timeVarying.attribute0", ANARI_BOOL}, {"usd::timeVarying.attribute1", ANARI_BOOL}, {"usd::timeVarying.attribute2", ANARI_BOOL}, {"usd::timeVarying.attribute3", ANARI_BOOL}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_CYLINDER"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 2; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_GEOMETRY_quad_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "quad geometry object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"primitive.color", ANARI_ARRAY1D}, {"primitive.attribute0", ANARI_ARRAY1D}, {"primitive.attribute1", ANARI_ARRAY1D}, {"primitive.attribute2", ANARI_ARRAY1D}, {"primitive.attribute3", ANARI_ARRAY1D}, {"primitive.id", ANARI_ARRAY1D}, {"vertex.position", ANARI_ARRAY1D}, {"vertex.normal", ANARI_ARRAY1D}, {"vertex.tangent", ANARI_ARRAY1D}, {"vertex.color", ANARI_ARRAY1D}, {"vertex.attribute0", ANARI_ARRAY1D}, {"vertex.attribute1", ANARI_ARRAY1D}, {"vertex.attribute2", ANARI_ARRAY1D}, {"vertex.attribute3", ANARI_ARRAY1D}, {"primitive.index", ANARI_ARRAY1D}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.position", ANARI_BOOL}, {"usd::timeVarying.normal", ANARI_BOOL}, {"usd::timeVarying.color", ANARI_BOOL}, {"usd::timeVarying.index", ANARI_BOOL}, {"usd::timeVarying.id", ANARI_BOOL}, {"usd::timeVarying.attribute0", ANARI_BOOL}, {"usd::timeVarying.attribute1", ANARI_BOOL}, {"usd::timeVarying.attribute2", ANARI_BOOL}, {"usd::timeVarying.attribute3", ANARI_BOOL}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_QUAD"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 3; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_GEOMETRY_sphere_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "sphere geometry object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"primitive.color", ANARI_ARRAY1D}, {"primitive.attribute0", ANARI_ARRAY1D}, {"primitive.attribute1", ANARI_ARRAY1D}, {"primitive.attribute2", ANARI_ARRAY1D}, {"primitive.attribute3", ANARI_ARRAY1D}, {"primitive.id", ANARI_ARRAY1D}, {"vertex.position", ANARI_ARRAY1D}, {"vertex.radius", ANARI_ARRAY1D}, {"vertex.color", ANARI_ARRAY1D}, {"vertex.attribute0", ANARI_ARRAY1D}, {"vertex.attribute1", ANARI_ARRAY1D}, {"vertex.attribute2", ANARI_ARRAY1D}, {"vertex.attribute3", ANARI_ARRAY1D}, {"primitive.index", ANARI_ARRAY1D}, {"radius", ANARI_FLOAT32}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.position", ANARI_BOOL}, {"usd::timeVarying.color", ANARI_BOOL}, {"usd::timeVarying.index", ANARI_BOOL}, {"usd::timeVarying.radius", ANARI_BOOL}, {"usd::timeVarying.id", ANARI_BOOL}, {"usd::timeVarying.attribute0", ANARI_BOOL}, {"usd::timeVarying.attribute1", ANARI_BOOL}, {"usd::timeVarying.attribute2", ANARI_BOOL}, {"usd::timeVarying.attribute3", ANARI_BOOL}, {"usd::useUsdGeomPoints", ANARI_BOOL}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_SPHERE"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 4; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_GEOMETRY_triangle_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "triangle geometry object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"primitive.color", ANARI_ARRAY1D}, {"primitive.attribute0", ANARI_ARRAY1D}, {"primitive.attribute1", ANARI_ARRAY1D}, {"primitive.attribute2", ANARI_ARRAY1D}, {"primitive.attribute3", ANARI_ARRAY1D}, {"primitive.id", ANARI_ARRAY1D}, {"vertex.position", ANARI_ARRAY1D}, {"vertex.normal", ANARI_ARRAY1D}, {"vertex.tangent", ANARI_ARRAY1D}, {"vertex.color", ANARI_ARRAY1D}, {"vertex.attribute0", ANARI_ARRAY1D}, {"vertex.attribute1", ANARI_ARRAY1D}, {"vertex.attribute2", ANARI_ARRAY1D}, {"vertex.attribute3", ANARI_ARRAY1D}, {"primitive.index", ANARI_ARRAY1D}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.position", ANARI_BOOL}, {"usd::timeVarying.normal", ANARI_BOOL}, {"usd::timeVarying.color", ANARI_BOOL}, {"usd::timeVarying.index", ANARI_BOOL}, {"usd::timeVarying.id", ANARI_BOOL}, {"usd::timeVarying.attribute0", ANARI_BOOL}, {"usd::timeVarying.attribute1", ANARI_BOOL}, {"usd::timeVarying.attribute2", ANARI_BOOL}, {"usd::timeVarying.attribute3", ANARI_BOOL}, {"usd::attribute0.name", ANARI_STRING}, {"usd::attribute1.name", ANARI_STRING}, {"usd::attribute2.name", ANARI_STRING}, {"usd::attribute3.name", ANARI_STRING}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_TRIANGLE"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 5; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_GEOMETRY_glyph_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "glyph geometry object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"primitive.color", ANARI_ARRAY1D}, {"primitive.attribute0", ANARI_ARRAY1D}, {"primitive.attribute1", ANARI_ARRAY1D}, {"primitive.attribute2", ANARI_ARRAY1D}, {"primitive.attribute3", ANARI_ARRAY1D}, {"primitive.id", ANARI_ARRAY1D}, {"vertex.position", ANARI_ARRAY1D}, {"vertex.scale", ANARI_ARRAY1D}, {"vertex.orientation", ANARI_ARRAY1D}, {"vertex.cap", ANARI_ARRAY1D}, {"vertex.color", ANARI_ARRAY1D}, {"vertex.attribute0", ANARI_ARRAY1D}, {"vertex.attribute1", ANARI_ARRAY1D}, {"vertex.attribute2", ANARI_ARRAY1D}, {"vertex.attribute3", ANARI_ARRAY1D}, {"primitive.index", ANARI_ARRAY1D}, {"scale", ANARI_FLOAT32_VEC3}, {"orientation", ANARI_FLOAT32_QUAT_IJKW}, {"caps", ANARI_STRING}, {"shapeType", ANARI_STRING}, {"shapeGeometry", ANARI_GEOMETRY}, {"shapeTransform", ANARI_FLOAT32_MAT4}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.position", ANARI_BOOL}, {"usd::timeVarying.color", ANARI_BOOL}, {"usd::timeVarying.index", ANARI_BOOL}, {"usd::timeVarying.scale", ANARI_BOOL}, {"usd::timeVarying.orientation", ANARI_BOOL}, {"usd::timeVarying.id", ANARI_BOOL}, {"usd::timeVarying.attribute0", ANARI_BOOL}, {"usd::timeVarying.attribute1", ANARI_BOOL}, {"usd::timeVarying.attribute2", ANARI_BOOL}, {"usd::timeVarying.attribute3", ANARI_BOOL}, {"usd::time.shapeGeometry", ANARI_INT32}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_GEOMETRY_GLYPH"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 6; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_CAMERA_perspective_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "perspective camera object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"position", ANARI_FLOAT32_VEC3}, {"direction", ANARI_FLOAT32_VEC3}, {"up", ANARI_FLOAT32_VEC3}, {"imageRegion", ANARI_FLOAT32_BOX2}, {"fovy", ANARI_FLOAT32}, {"aspect", ANARI_FLOAT32}, {"near", ANARI_FLOAT32}, {"far", ANARI_FLOAT32}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.view", ANARI_BOOL}, {"usd::timeVarying.projection", ANARI_BOOL}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_CAMERA_PERSPECTIVE"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 7; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_INSTANCE_transform_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "instance object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"transform", ANARI_FLOAT32_MAT4}, {"group", ANARI_GROUP}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.group", ANARI_BOOL}, {"usd::timeVarying.transform", ANARI_BOOL}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_INSTANCE_TRANSFORM"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 8; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_MATERIAL_matte_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "matte material object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"color", ANARI_FLOAT32_VEC3}, {"color", ANARI_SAMPLER}, {"color", ANARI_STRING}, {"opacity", ANARI_FLOAT32}, {"opacity", ANARI_SAMPLER}, {"opacity", ANARI_STRING}, {"alphaMode", ANARI_STRING}, {"alphaCutoff", ANARI_FLOAT32}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.color", ANARI_BOOL}, {"usd::time.sampler.color", ANARI_FLOAT64}, {"usd::time.sampler.opacity", ANARI_FLOAT64}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_MATTE"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 9; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_MATERIAL_physicallyBased_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "physically based material object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"baseColor", ANARI_FLOAT32_VEC3}, {"baseColor", ANARI_SAMPLER}, {"baseColor", ANARI_STRING}, {"opacity", ANARI_FLOAT32}, {"opacity", ANARI_SAMPLER}, {"opacity", ANARI_STRING}, {"metallic", ANARI_FLOAT32}, {"metallic", ANARI_SAMPLER}, {"metallic", ANARI_STRING}, {"roughness", ANARI_FLOAT32}, {"roughness", ANARI_SAMPLER}, {"roughness", ANARI_STRING}, {"normal", ANARI_SAMPLER}, {"emissive", ANARI_FLOAT32_VEC3}, {"emissive", ANARI_SAMPLER}, {"emissive", ANARI_STRING}, {"occlusion", ANARI_SAMPLER}, {"alphaMode", ANARI_STRING}, {"alphaCutoff", ANARI_FLOAT32}, {"specular", ANARI_FLOAT32}, {"specular", ANARI_SAMPLER}, {"specular", ANARI_STRING}, {"specularColor", ANARI_FLOAT32_VEC3}, {"specularColor", ANARI_SAMPLER}, {"specularColor", ANARI_STRING}, {"clearcoat", ANARI_FLOAT32}, {"clearcoat", ANARI_SAMPLER}, {"clearcoat", ANARI_STRING}, {"clearcoatRoughness", ANARI_FLOAT32}, {"clearcoatRoughness", ANARI_SAMPLER}, {"clearcoatRoughness", ANARI_STRING}, {"clearcoatNormal", ANARI_SAMPLER}, {"transmission", ANARI_FLOAT32}, {"transmission", ANARI_SAMPLER}, {"transmission", ANARI_STRING}, {"ior", ANARI_FLOAT32}, {"ior", ANARI_SAMPLER}, {"ior", ANARI_STRING}, {"thickness", ANARI_FLOAT32}, {"thickness", ANARI_SAMPLER}, {"thickness", ANARI_STRING}, {"attenuationDistance", ANARI_FLOAT32}, {"attenuationColor", ANARI_FLOAT32_VEC3}, {"sheenColor", ANARI_FLOAT32_VEC3}, {"sheenColor", ANARI_SAMPLER}, {"sheenColor", ANARI_STRING}, {"sheenRoughness", ANARI_FLOAT32}, {"sheenRoughness", ANARI_SAMPLER}, {"sheenRoughness", ANARI_STRING}, {"iridescence", ANARI_FLOAT32}, {"iridescence", ANARI_SAMPLER}, {"iridescence", ANARI_STRING}, {"iridescenceIor", ANARI_FLOAT32}, {"iridescenceThickness", ANARI_FLOAT32}, {"iridescenceThickness", ANARI_SAMPLER}, {"iridescenceThickness", ANARI_STRING}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.baseColor", ANARI_BOOL}, {"usd::timeVarying.opacity", ANARI_BOOL}, {"usd::timeVarying.emissive", ANARI_BOOL}, {"usd::timeVarying.roughness", ANARI_BOOL}, {"usd::timeVarying.metallic", ANARI_BOOL}, {"usd::timeVarying.ior", ANARI_BOOL}, {"usd::time.sampler.baseColor", ANARI_FLOAT64}, {"usd::time.sampler.opacity", ANARI_FLOAT64}, {"usd::time.sampler.emissive", ANARI_FLOAT64}, {"usd::time.sampler.roughness", ANARI_FLOAT64}, {"usd::time.sampler.metallic", ANARI_FLOAT64}, {"usd::time.sampler.ior", ANARI_FLOAT64}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_MATERIAL_PHYSICALLY_BASED"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 10; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_SAMPLER_image1D_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "image1D object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"image", ANARI_ARRAY1D}, {"inAttribute", ANARI_STRING}, {"filter", ANARI_STRING}, {"wrapMode1", ANARI_STRING}, {"inTransform", ANARI_FLOAT32_MAT4}, {"inOffset", ANARI_FLOAT32_VEC4}, {"outTransform", ANARI_FLOAT32_MAT4}, {"outOffset", ANARI_FLOAT32_VEC4}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.image", ANARI_BOOL}, {"usd::timeVarying.wrapMode", ANARI_BOOL}, {"usd::imageUrl", ANARI_STRING}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE1D"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 11; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_SAMPLER_image2D_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "image2D object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"image", ANARI_ARRAY2D}, {"inAttribute", ANARI_STRING}, {"filter", ANARI_STRING}, {"wrapMode1", ANARI_STRING}, {"wrapMode2", ANARI_STRING}, {"inTransform", ANARI_FLOAT32_MAT4}, {"inOffset", ANARI_FLOAT32_VEC4}, {"outTransform", ANARI_FLOAT32_MAT4}, {"outOffset", ANARI_FLOAT32_VEC4}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.image", ANARI_BOOL}, {"usd::timeVarying.wrapMode1", ANARI_BOOL}, {"usd::timeVarying.wrapMode2", ANARI_BOOL}, {"usd::imageUrl", ANARI_STRING}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE2D"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 12; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_SAMPLER_image3D_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "image3D object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"image", ANARI_ARRAY3D}, {"inAttribute", ANARI_STRING}, {"filter", ANARI_STRING}, {"wrapMode1", ANARI_STRING}, {"wrapMode2", ANARI_STRING}, {"wrapMode3", ANARI_STRING}, {"inTransform", ANARI_FLOAT32_MAT4}, {"inOffset", ANARI_FLOAT32_VEC4}, {"outTransform", ANARI_FLOAT32_MAT4}, {"outOffset", ANARI_FLOAT32_VEC4}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.image", ANARI_BOOL}, {"usd::timeVarying.wrapMode1", ANARI_BOOL}, {"usd::timeVarying.wrapMode2", ANARI_BOOL}, {"usd::timeVarying.wrapMode3", ANARI_BOOL}, {"usd::imageUrl", ANARI_STRING}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SAMPLER_IMAGE3D"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 13; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_structuredRegular_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "structured regular spatial field object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"data", ANARI_ARRAY3D}, {"origin", ANARI_FLOAT32_VEC3}, {"spacing", ANARI_FLOAT32_VEC3}, {"filter", ANARI_STRING}, {"usd::time", ANARI_FLOAT64}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.data", ANARI_BOOL}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_SPATIAL_FIELD_STRUCTURED_REGULAR"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 14; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_VOLUME_transferFunction1D_info(int infoName, ANARIDataType infoType) { switch(infoName) { case 4: // description { static const char *description = "transferFunction1D volume object"; return description; } case 9: // parameter if(infoType == ANARI_PARAMETER_LIST) { static const ANARIParameter parameters[] = { {"name", ANARI_STRING}, {"value", ANARI_SPATIAL_FIELD}, {"valueRange", ANARI_FLOAT32_BOX1}, {"valueRange", ANARI_FLOAT64_BOX1}, {"color", ANARI_FLOAT32_VEC4}, {"color", ANARI_FLOAT32_VEC3}, {"color", ANARI_ARRAY1D}, {"opacity", ANARI_FLOAT32}, {"opacity", ANARI_ARRAY1D}, {"unitDistance", ANARI_FLOAT32}, {"usd::timeVarying", ANARI_INT32}, {"usd::timeVarying.color", ANARI_BOOL}, {"usd::timeVarying.opacity", ANARI_BOOL}, {"usd::timeVarying.valueRange", ANARI_BOOL}, {"usd::preClassified", ANARI_BOOL}, {"usd::time.value", ANARI_FLOAT64}, {"usd::removePrim", ANARI_BOOL}, {0, ANARI_UNKNOWN} }; return parameters; } else { return nullptr; } case 7: // sourceExtension if(infoType == ANARI_STRING) { static const char *extension = "KHR_VOLUME_TRANSFER_FUNCTION1D"; return extension; } else if(infoType == ANARI_INT32) { static const int value = 15; return &value; } else { return nullptr; } default: return nullptr; } } static const void * ANARI_CAMERA_info(const char *subtype, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 9: return ANARI_CAMERA_perspective_info(infoName, infoType); default: return nullptr; } } static const void * ANARI_GEOMETRY_info(const char *subtype, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 0: return ANARI_GEOMETRY_cone_info(infoName, infoType); case 1: return ANARI_GEOMETRY_curve_info(infoName, infoType); case 2: return ANARI_GEOMETRY_cylinder_info(infoName, infoType); case 11: return ANARI_GEOMETRY_quad_info(infoName, infoType); case 12: return ANARI_GEOMETRY_sphere_info(infoName, infoType); case 16: return ANARI_GEOMETRY_triangle_info(infoName, infoType); case 4: return ANARI_GEOMETRY_glyph_info(infoName, infoType); default: return nullptr; } } static const void * ANARI_INSTANCE_info(const char *subtype, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 15: return ANARI_INSTANCE_transform_info(infoName, infoType); default: return nullptr; } } static const void * ANARI_MATERIAL_info(const char *subtype, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 8: return ANARI_MATERIAL_matte_info(infoName, infoType); case 10: return ANARI_MATERIAL_physicallyBased_info(infoName, infoType); default: return nullptr; } } static const void * ANARI_RENDERER_info(const char *subtype, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 3: return ANARI_RENDERER_default_info(infoName, infoType); default: return nullptr; } } static const void * ANARI_SAMPLER_info(const char *subtype, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 5: return ANARI_SAMPLER_image1D_info(infoName, infoType); case 6: return ANARI_SAMPLER_image2D_info(infoName, infoType); case 7: return ANARI_SAMPLER_image3D_info(infoName, infoType); default: return nullptr; } } static const void * ANARI_SPATIAL_FIELD_info(const char *subtype, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 13: return ANARI_SPATIAL_FIELD_structuredRegular_info(infoName, infoType); default: return nullptr; } } static const void * ANARI_VOLUME_info(const char *subtype, int infoName, ANARIDataType infoType) { switch(subtype_hash(subtype)) { case 14: return ANARI_VOLUME_transferFunction1D_info(infoName, infoType); default: return nullptr; } } const void * query_object_info_enum(ANARIDataType type, const char *subtype, int infoName, ANARIDataType infoType) { switch(type) { case ANARI_CAMERA: return ANARI_CAMERA_info(subtype, infoName, infoType); case ANARI_GEOMETRY: return ANARI_GEOMETRY_info(subtype, infoName, infoType); case ANARI_INSTANCE: return ANARI_INSTANCE_info(subtype, infoName, infoType); case ANARI_MATERIAL: return ANARI_MATERIAL_info(subtype, infoName, infoType); case ANARI_RENDERER: return ANARI_RENDERER_info(subtype, infoName, infoType); case ANARI_SAMPLER: return ANARI_SAMPLER_info(subtype, infoName, infoType); case ANARI_SPATIAL_FIELD: return ANARI_SPATIAL_FIELD_info(subtype, infoName, infoType); case ANARI_VOLUME: return ANARI_VOLUME_info(subtype, infoName, infoType); case ANARI_DEVICE: return ANARI_DEVICE_info(infoName, infoType); case ANARI_ARRAY1D: return ANARI_ARRAY1D_info(infoName, infoType); case ANARI_ARRAY2D: return ANARI_ARRAY2D_info(infoName, infoType); case ANARI_ARRAY3D: return ANARI_ARRAY3D_info(infoName, infoType); case ANARI_FRAME: return ANARI_FRAME_info(infoName, infoType); case ANARI_GROUP: return ANARI_GROUP_info(infoName, infoType); case ANARI_WORLD: return ANARI_WORLD_info(infoName, infoType); case ANARI_SURFACE: return ANARI_SURFACE_info(infoName, infoType); default: return nullptr; } } const void * query_object_info(ANARIDataType type, const char *subtype, const char *infoNameString, ANARIDataType infoType) { int infoName = info_hash(infoNameString); return query_object_info_enum(type, subtype, infoName, infoType);} } }