Step 1: Setup the SDK plugin in Unreal¶
If you have not already done so, please install the plugin as explained here Get Started.
Step 2: Install Blender¶
Blender is used to reduce the geometry of the scene. This can dramatically reduce the load time of your scene at SceneExplorer.com. Blender is free and open source.
Simplygon is another tool to reduce your scene's geometry, but we do not automate and support this at this time.
Step 3: Export the scene¶
This process and interface will change in upcoming patches.
Open Project Settings... and scroll to the cognitiveVR settings near the bottom.
Use this popup will tell Unreal where the Blender.exe is located. If Blender was installed into Program Files, this may be completed automatically.
Select Export Meshes¶
Press this button to select all static mesh objects. There are options above, but the defaults should be fine for most projects.
- Min Polygons sets the lower threshold for meshes with few than this many faces. By default, meshes with <500 polygons are not reduced
- Max Polygons sets the upper threshold for meshes with more than this many faces. By default, meshes with >20000 polygons are reduced to 10%. Between these two thresholds is a linear scale of the amount the meshes will be reduced
- Static Only selects only non-movable actors. This is usually the correct behaviour
- Increase the Minimum Size option to ignore any small detail meshes you might have
- Maximum Size allows you to ignore any massive meshes you have, such as skyboxes
- Texture Resize Factor reduces the resolution of your textures. 2 reduces the resolution to half. 4 reduces the resolution to a quarter. This should be a power of two greater than zero.
Select any other meshes you wish to export. Text meshes are known to not work. See Troubleshooting if you need to export Geometry Brushes (BSP).
Change the export option to .obj and select a new empty folder. Press YES to export materials.
This will run a python script within Blender to reduce the geometry. This will output a smaller version of the obj.
This will also run a python script in Blender. It will downsize textures and save them as pngs.
Step 4: Upload the Scene¶
After the above steps have been completed, select all the files in the root directory. From the example above, it is these 4 files. Your scene will likely have more pngs.
- CubeMaterial_ CubeMaterial_D.pngs
Drag all the files into uploader at SceneExplorer.com.
Step 5: Set SceneID¶
When the files have finished uploading, take the SceneID from the popup.
Open Project Settings... from the Edit menu in Unreal and scroll to cognitiveVR settings near the bottom.
Add a new entry in the Scene Keys array. The SceneName should be the exact name of the scene in the content browser. The SceneID should be the unique ID from SceneExplorer.
Step 6: Attach Player Tracker¶
The Player Tracker records where the HMD is positioned and the point the HMD is looking towards.
- Add the PlayerTracker component as a child actor to your character's camera
Step 7: Send Data¶
At the moment, sending player data must be done manually.
The Flush Events blueprint node and Send Player Data blueprint node will upload saved player data to SceneExplorer.
This example shows how to Send Player Data then Open a new Level 10 seconds after the level has begun.
To send the collected player data using C++, use this code: