Based on your detailed analysis, the issue is related to physics mesh generation in the Unreal Engine Editor, which is a known problem with the Spine UE4 runtime.
The Problem
The UBodySetup::CreatePhysicsMeshes function being called repeatedly and causing the WaitUntilTasksComplete bottleneck indicates that collision mesh generation is still happening, despite your attempts to disable it. This is a performance issue specific to the Unreal Engine Editor environment.
The Solution
You need to manually disable collision mesh generation in the Spine plugin source code:
Navigate to your project's Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp
Find line 181 (approximately) in the file - it should be in a function related to mesh generation
Change the last parameter from true to false to disable collision mesh generation
Important: After making this change, you must do a clean rebuild:
- Close all running Unreal Engine Editor instances
- In Visual Studio, right-click the solution in the solution explorer
- Click "Clean Solution"
- Rebuild the project
Simply rebuilding without cleaning may not work, as the code might not be completely recompiled.
Why This Happens
The Unreal Engine Editor generates collision meshes by default for Spine skeletal meshes, which causes severe performance degradation. This primarily affects the editor viewport and PIE mode, which explains why your shipping builds work fine (they don't generate these collision meshes at runtime in the same way).
Additional Notes
- This is a limitation of how Unreal Engine handles mesh collision generation, not something that can be fully worked around through component settings alone
- The manual code change is currently the only reliable way to prevent this performance issue in the editor
- Make sure you're copying the latest
spine-cpp folder to your plugin directory if you update the runtime in the future, as you'll need to reapply this change