Setup the SDK plugin in Unreal¶
If you have not already done so, please install the plugin as explained Here.
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.
Open Project Settings... and scroll to the Cognitive3D settings near the bottom. Log in and expand the Scene Upload section
Step 1: Export Settings¶
Use this popup will tell Unreal where the Blender.exe is located. If Blender was installed into C:/Program Files, this will be completed automatically.
Use the options to quickly select the static content of the scene you wish to export
- Exclude Meshes skips all actors that match one of these entries. Multiple entries are separated with a comma.
- Static Only selects only non-movable actors.
- 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.
- Select Export Meshes sets the selection in Unreal to match these settings. You can manually add or remove meshes from your selection before you export in Step 2. 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).
Step 2: Export¶
It is important that you export your scene as a .obj
Either select Export Selected Scene Actors or Export All Scene Actors. Press YES to export materials. Exporting all scene actors may include unexpected meshes, such as cameras.
You should have a folder containing a .obj, .mtl and one or more folders of images.
Step 3: Optimize Files¶
Select Export Directory¶
This should be set automatically to the directory you selected in Step 2. You can set it manually here if you have previously exported the scene meshes.
These settings will reduce mesh complexity and convert texture files.
- Export Transparent Textures will export any transparent textures used in the scene. This is optional.
- Min Polygons sets the lower threshold for reducing polygon count. Objects with fewer than this number of polygons will not have any polygons removed.
- Max Polygons sets the higher threshold for reducing polygon count. Objects with more than this number of polygons will have many polygons removed. Objects with more polygons than Min and fewer than Max will have some polygons removed.
- Reduce Mesh Topology applies the Min and Max settings to the exported model. This may take a minute.
- Texture Resize Factor reduces the resolution of your textures. 2 reduces the resolution to half. 4 reduces the resolution to a quarter. This value should be a power of two greater than zero.
- Convert Textures applies the Texture Resize Factor to the resolution. It also converts the textures from .bmp to .png
Step 4: Upload¶
Upload Files for Scene Name¶
This uploads the scene files from the Export Directory to SceneExplorer. This will only be visible if there is a settings.json file and no .bmp files in the Export Directory and you are logged in.
After the upload is complete, the response will write data to your defaultengine.ini file.
After you have uploaded your scene, you can select a .png to upload to your dashboard. Press F9 in Unreal to take a screenshot. This is saved in the project's /Saved/Screenshots directory.
Step 5: Scene Explorer¶
Open the scene in your web browser. If everything looks fine, you should restart Unreal to reload the defaultengine.ini config file.
Tracking the Player¶
To record the player's position and gaze to SceneExplorer, add a PlayerTracker component as a child of your player's camera. You can adjust how frequently the position and gaze are recorded - by default it is 10 times a second.
Sending other Data¶
Transactions, Gaze, Dynamics and Sensor data will automatically be sent to SceneExplorer when enough 'snapshots' have been collected. In the CognitiveVR Settings you can adjust the threshold of snapshots to send.
Sending player data to SceneExplorer can also be done manually using Flush Events. This is recommended before loading a new scene and when closing your application.
The Flush Events blueprint node will upload any outstanding player data to SceneExplorer.
This example shows how to send the player's data to SceneExplorer 10 seconds after the level has begun.
To send the collected player data using C++, use this code:
#include "CognitiveVR.h" //... TSharedPtr<FAnalyticsProviderCognitiveVR> cognitive = FAnalyticsCognitiveVR::Get().GetCognitiveVRProvider(); cognitive->FlushEvents();