microsoft / Microsoft-OpenXR-Unreal

An Unreal Engine game plugin providing additional features available on Microsoft's Mixed Reality devices like the HoloLens 2 when using OpenXR.
MIT License
160 stars 51 forks source link

Spatial mapping/Scene Understanding cannot generate collision for Mesh Data #91

Open shukenmg opened 1 year ago

shukenmg commented 1 year ago

image

As shown in #68 enabling that option results in a crash with this call stack:

Assertion failed: CurrentCookHelper == nullptr [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\PhysicsEngine\BodySetup.cpp] [Line: 619]

UnrealEditor_Engine!UBodySetup::CreatePhysicsMeshesAsync() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\PhysicsEngine\BodySetup.cpp:619]
UnrealEditor_MRMesh!UMRMeshComponent::SendBrickData_Internal() [D:\build\++UE5\Sync\Engine\Source\Runtime\MRMesh\Private\MRMeshComponent.cpp:768]
UnrealEditor_MRMesh!UMRMeshComponent::UpdateMesh() [D:\build\++UE5\Sync\Engine\Source\Runtime\MRMesh\Private\MRMeshComponent.cpp:1101]
UnrealEditor_AugmentedReality!UARPlaneComponent::UpdateVisualization_Implementation() [D:\build\++UE5\Sync\Engine\Source\Runtime\AugmentedReality\Private\ARComponent.cpp:418]
UnrealEditor_CoreUObject!UFunction::Invoke() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:5912]
UnrealEditor_CoreUObject!UObject::ProcessEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2003]
UnrealEditor_AugmentedReality!UARPlaneComponent::OnRep_Payload() [D:\build\++UE5\Sync\Engine\Source\Runtime\AugmentedReality\Private\ARComponent.cpp:175]
UnrealEditor_AugmentedReality!UARPlaneComponent::execServerUpdatePayload() [D:\build\++UE5\Sync\Engine\Intermediate\Build\Win64\UnrealEditor\Inc\AugmentedReality\ARComponent.gen.cpp:1606]
UnrealEditor_CoreUObject!UFunction::Invoke() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:5912]
UnrealEditor_CoreUObject!UObject::ProcessEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2003]
UnrealEditor_AugmentedReality!UARPlaneComponent::ServerUpdatePayload() [D:\build\++UE5\Sync\Engine\Intermediate\Build\Win64\UnrealEditor\Inc\AugmentedReality\ARComponent.gen.cpp:1651]
UnrealEditor_AugmentedReality!UARPlaneComponent::Update() [D:\build\++UE5\Sync\Engine\Source\Runtime\AugmentedReality\Private\ARComponent.cpp:175]
UnrealEditor_OpenXRAR!FOpenXRARSystem::OnObjectUpdated_GameThread() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\OpenXR\Source\OpenXRAR\Private\OpenXRAR.cpp:744]
UnrealEditor_OpenXRAR!TBaseSPMethodDelegateInstance<0,FOpenXRARSystem,1,void __cdecl(void),FDefaultDelegateUserPolicy,TSharedPtr<FOpenXRARTrackedGeometryData,1> >::ExecuteIfSafe() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:307]
UnrealEditor_OpenXRAR!TGraphTask<FSimpleDelegateGraphTask>::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:975]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksNamedThread() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:753]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksUntilQuit() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:642]
UnrealEditor_Core!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:2169]
UnrealEditor_Engine!FTickTaskSequencer::ReleaseTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:550]
UnrealEditor_Engine!FTickTaskManager::RunTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:1592]
UnrealEditor_Engine!UWorld::RunTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:790]
UnrealEditor_Engine!UWorld::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1531]
UnrealEditor_UnrealEd!UEditorEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:1777]
UnrealEditor_UnrealEd!UUnrealEdEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:474]
UnrealEditor!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5215]
UnrealEditor!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:183]
UnrealEditor!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:147]
UnrealEditor!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:283]
UnrealEditor!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:330]
UnrealEditor!__scrt_common_main_seh() [d:\a01\_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll

This option is needed because UE needs collision in order to generate navmesh data. Is it possible to fix this? Thanks!

Info: Remoting UE 5.0.3 Microsoft OpenXR Plugin v1.1.14

fieldsJacksonG commented 1 year ago

I have a bug open with Epic on this - tentatively scheduled for a 5.1.1 fix.

This is caused from the switch to Epic's Chaos physics engine (from PhysX) Chaos is not aborting in-flight physics cooking, which causes this crash when a mesh is updated before the previous attempt finishes cooking.

shukenmg commented 1 year ago

Cool! Thank you for the info, is a quick source code fix available or do we need to wait for the official fix?

fieldsJacksonG commented 1 year ago

I haven't tested it yet, but the fix is staged for 5.1.1 now: https://github.com/EpicGames/UnrealEngine/commit/bdde51145cf9b7c447552d6f92744ffda3fbe419