oculus-samples / Unreal-MRUtilityKitSample

MRUK ("Mixed Reality Utility Kit") provides a rich set of utilities/tools on top of Scene API to perform common operations when building spatially-aware apps in Unreal. The Oculus SDK and other supporting material is subject to the Oculus proprietary license.
Other
9 stars 2 forks source link

How to get Cut Hole Labels to work? #5

Open gabryelx opened 2 weeks ago

gabryelx commented 2 weeks ago

I can't find any documentation or samples yet on how Cut Hole Labels work inside the MRUKAnchorActorSpawner to cut a hole in the wall mesh for a door or window. My attempts so far have been unsuccessful. Any guidance on this or is this a bug in it's functionality? Thanks

gabryelx commented 2 weeks ago

Adding a comment, the Cut Holes only seems to work if it generates a procedural mesh, if I populate the WALL_FACE Spawn group with a custom BP that contains a simple plane, the cut out function does not work. Also if the Actor array is populated but empty the app crashes

felixweilbach commented 2 weeks ago

Hi @gabryelx,

Cutting holes is only supported for procedural (plane) meshes as you mentioned. You can assign a material to a procedural mesh. See the Core sample. Does this work for you? What is your use case?

Edit: That crash you are mentioning should be resolved in the next release.

gabryelx commented 2 weeks ago

Thank you, appreciate the response. I am trying to use the pokeahole material to create pass through walls, but use a cut hole label to create a virtual window so to speak inside your MR room. I've had some partial success applying materials to the procedurally generated walls but I get inconsistent results, but I will take a closer look at the core sample.

I am not sure if this is related but usually I will get artifact planes generated, possibly from cruft data from the room scan, I am not sure. For example I will scan the room and it make generate a passthrough plane in the middle of the room, or a pass through plane just beyond the wall of the room or one of the walls just won't be there. It will stay in that place until I rescan to which point it would create something different, sort of like there could be an issue writing the data the JSON file.

felixweilbach commented 1 week ago

There are multiple approaches to achieve what you want, but I think the MRUK walls with holes cutting should work in your case. Just make sure you use procedurally generated walls like discussed. You can assign the procedural walls the poke a hole material.

There shouldn't be any artifact planes generated. If your version is v68 or below make sure to apply that fix https://github.com/Oculus-VR/UnrealEngine/pull/490 because there was a bug with anchor loading that could lead to walls being misplaced.