Develop
Develop
Select your platform

Importing Scene Entity Meshes (deprecated)

Updated: Sep 4, 2024
OculusXRSceneActor Deprecation
As of v65, OculusXRSceneActor is deprecated. New features will be delivered through MR Utility Kit.
Refer to the following as guidance on which APIs to use:
New projects:
Existing projects:

Introduction

Note: This page is not relevant if you are using MR Utility Kit.
When using the Scene Actor it is essential to properly orient and position meshes if you will use them to represent scene entities. Refer to the Scene sample to see how you should lay out scene entity meshes.
Importing Scene Entity Meshes
Unreal can modify the orientations and translations of imported meshes (https://docs.unrealengine.com/4.27/en-US/WorkingWithContent/Types/StaticMeshes/HowTo/Importing/). You can use this functionality instead of manually reauthoring mesh assets.
Mesh Transformations

Bounded 2D Meshes

Bounded 2D meshes must be planar (no depth), oriented along the YZ plane with the normal of the plane facing the -X-axis, and centered at the origin.
Wall Mesh
Scene sample’s Wall mesh from a perspective projection. Note that the planar face’s normal points towards -X.
Wall Mesh
Scene sample’s Wall mesh from a back orthographic projection. Note the mesh’s origin is at the center of the plane’s face.

Bounded 3D Meshes

The origin must be at the top of the mesh. In addition, the mesh should be facing the XY plane. For example, using the engine’s “SM_MatPreviewMesh_01” asset:
Bounded 3D Mesh
If you are going to use this mesh with Scene, you must import it like so:
Bounded 3D Mesh
Scene sample’s Bounded 3D mesh from a perspective projection. Note that the mesh is oriented to face the XY plane.
Bounded 3D Mesh
Scene sample’s Bounded 3D mesh from a bottom orthographic projection. Note that the origin is at the top of the mesh.
Note: The scale of the imported mesh is irrelevant. The Scene Actor will properly rescale the spawned scene entity actors, so their sizes match their physical representations.

Configuring the Behavior of the Scene Actor

The Scene Actor exposes various other settings that dictate its behavior.
Behavioral default settings of the Scene Actor:
  • Ensure Room Is Valid: Won’t populate a Scene Model unless you have captured a “valid” room layout in Scene Capture. A valid room must have at least four walls, a ceiling, and a floor. This setting can be disabled if a room layout isn’t necessary. The system will still spawn any other scene entities you created.
  • Launch Scene Capture when Missing Scene: This determines whether the system should automatically launch Scene Capture when a captured Scene Model is not detected or is invalid (e.g., if Ensure Room Is Valid is toggled on). You can set this setting to “never,” “once,” or “always.”
  • Max Queries: The maximum number of queries you can make when checking for captured scene entities.
  • Verbose Log: This will generate more logs. It may help debug the behavior of the Scene Actor.
  • Populate Scene on Begin Play: Whether the Scene Actor should try to populate the scene when you call its BeginPlay() function.

Notes

  • At the moment, the user can only clear an active Scene Model by resetting the boundary through the Quest’s settings menu.
  • Anytime the Scene Actor launches Scene Capture, the system will attempt to populate the Scene Actor once you exit Scene Capture to return to the Unreal application.
Unless “Launch Scene Capture when Missing Scene” is set to “never,” both the “Ensure Room Is Valid” and “Launch Scene Capture when Missing Scene” settings dictate when the system will automatically launch Scene Capture.
The following diagram shows the logical flow when “Ensure Room Is Valid” is set to false:
Flowchart When Ensure Room is Valid is False
The following diagram shows the logical flow when Ensure Room Is Valid is set to true:
Flowchart When Ensure Room is Valid is True
Did you find this page helpful?
Thumbs up icon
Thumbs down icon