JSON Conversion#
The JSON conversion sample script is used to convert the CSV data into JSON format so it is consumable for web development.
Open the JSON conversion sample script[LINK:JSONsample].
Modify the options_csv, packages_csv and json_output paths at the bottom of the script (in the if __name__ == ‘__main__’ block) as needed.
Execute the script.
Here is an example of one Package entry from the resulting JSON file:
"Blanco": {
"display_name": "Blanco",
"options": [
{
"prim_path": "/World/Looks",
"variant_set": "Carpaint",
"option": "Carpaint",
"variant": "Blanco",
"display_name": "Blanco"
},
{
"prim_path": "/World/Looks/Wheel_Mats",
"variant_set": "Wheel_Colors",
"option": "Wheel_Colors",
"variant": "WhiteGlow",
"display_name": "WhiteGlow"
}
{
"prim_path": "/World/Looks/lightStripAMat",
"variant_set": "Light_strip_color",
"option": "Light_strip_color",
"variant": "White",
"display_name": "White"
},
{
"prim_path": "/World/Looks/Leather_Pattern_01",
"variant_set": "Int_leather",
"option": "Int_leather",
"variant": "Cloud",
"display_name": "Cloud"
},
{
"prim_path": "/World/Looks/Leather_Grain_04",
"variant_set": "Int_leather_dash",
"option": "Int_leather_dash",
"variant": "Cloud",
"display_name": "Cloud"
},
{
"prim_path": "/World/Looks/Int_Trims",
"variant_set": "Int_Trim_Color",
"option": "Int_Trim_Color",
"variant": "Cloud",
"display_name": "Cloud"
},
{
"prim_path": "/World/Looks/stitchesMat",
"variant_set": "Stitch_Color",
"option": "Stitch_Color",
"variant": "Black",
"display_name": "Black"
},
{
"prim_path": "/World/Looks/interiorScreenMat_01",
"variant_set": "Screen_Color",
"option": "Screen_Color",
"variant": "White",
"display_name": "White"
}
]
}
This can now be utilized by a web developer for a front end website. The JSON file is leveraged to send message events from web interaction to the content running in an omniverse application.