A Fusion360 add-in for generating SteamVR Tracking JSON files from 3D CAD Data
- Autodesk Fusion360
- Clone this repository or download .zip and extract to: C:\Users<your user name>\AppData\Roaming\Autodesk\Autodesk Fusion 360\API\AddIns\
- If Fusion360 is open, close the software
- Launch Fusion360
- A new command should appear in the "Model" Panel under "ADD-INS" called "Generate SteamVR JSON (Triad Semiconductor)"
This script will generate a steamVR sensor definintion JSON file based on ConstructionPoints and ConstructionAxes that are added to a solid model.
For example, consider the following 3D model for the HTC Vive Tracker:
If we wanted to generate a JSON file for one sensor location, we would do the following:
- Select CONSTRUCT>Point at Center of Circle/Sphere/Torus
- Select the Sensor Aperture circle where the center point should be placed
- A point will appear in the center of the circle (yellow arrow), you will also see a new entry in the heirarchy Browser (green arrow)
Note: In this example, the point is called "Point1", this point will correlate to sensor 0 in the json channel map
- Select CONSTRUCT>Axis Through Cylinder/Cone/Torus
- Select the Cone surronding the Sensor Aperture
- An Axis will appear in the center of the cone (yellow arrow), you will also see a new entry in the heirarchy Browser (green arrow)
Note: In this example, the axis is called "Axis1", this vector will correlate to sensor 0 in the json channel map
- The sensor location is now specified by the point in Step 3 and the normal vector is specified by the Axis created in step 6, we may now test this by genearting a JSON file, to do this, select ADD-INS>Generate SteamVR JSON (Triad Semiconductor)
- The Script will automatically detect each construction point and axis, match them based on index and generate a JSON file where each pair is mapped to a channel of index-1
- To add more sensors to the JSON file, repeat step 1 through step 6 for each sensor in the channel map
- After doing this N more times for each sensor, your model may look like this:
- If we regenerate the JSON per step 7, the following file is generated:
- When you are satisfied with your JSON file, you may File>Save As in your text editor