Closed HydrogenC closed 1 week ago
It seems that the issue is caused by EMotionFX Actors not accepting models with only blendshapes but no skin weights. Having no skin weights causes several assertion failures.
Copied from what I have published in the Discord sig-content section.
The crash was directly caused by a couple of assertion failures.
In the function ModelLod::GetStreamsForMesh
:
https://github.com/o3de/o3de/blob/5dbc1edb86aab66082bee6d298b902cf0a73b5f5/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp#L340-L344
layoutOut
only get assigned if success is true, but a actor without skinning weights will be false for lack of certain buffers.
https://github.com/o3de/o3de/blob/5dbc1edb86aab66082bee6d298b902cf0a73b5f5/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp#L311-L315
So that layoutOut
won't be assigned for actors without skinning and thus trigger a size mismatch assertion failure.
https://github.com/o3de/o3de/blob/e8570f9d635c0abbf3d733d0524a3c0ae75d726c/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshInputBuffers.cpp#L239-L241
In other references to ModelLod::GetStreamsForMesh
the code may assert for whether success
is true
, which also causes a assertion failure with actors without skinning.
https://github.com/o3de/o3de/blob/5dbc1edb86aab66082bee6d298b902cf0a73b5f5/Gems/DiffuseProbeGrid/Code/Source/Render/DiffuseProbeGridFeatureProcessor.cpp#L1034-L1040
https://github.com/o3de/o3de/blob/5dbc1edb86aab66082bee6d298b902cf0a73b5f5/Gems/EMotionFX/Code/EMotionFX/Source/Mesh.cpp#L189 If the actor doesn't have skin weights, then maxSkinInfluences will be zero, thus failing the assertion.
https://github.com/o3de/o3de/blob/5dbc1edb86aab66082bee6d298b902cf0a73b5f5/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp#L209-L216 There isn't a null check for indicesBuffAssetView and weightsBuffAssetView, which would be NULL if there's no skinning, thus crashing the editor due to access to 0x0000000.
However, after I fixed the points stated above, the editor doesn't crash any more, but the actor cannot be rendered correctly. It flickers for an instance when the viewport is refreshed, and then disappears. I was interested in filing a PR to fix this, but since I'm not quite knowledgeable about the Atom architecture, I'm not capable of fixing this by myself.
Describe the bug Adding a fbx file into the editor and dragging it into the scene crashes the editor. Likely caused by EMotion gem, since removing the gem then the editor doesn't crash under such conditions. Perhaps related to #15902.
The Actor in EMotionFX gem doesn't support actor with only blendshapes but no skinning weights. The editor crashes when such Actor is put into the scene as a result. Models with blendshapes but without skinning should be tolerated by the engine.
Assets required Jinhsi_boneless.zip
Steps to reproduce Steps to reproduce the behavior:
Expected behavior A actor corresponding to the fbx model is created in the scene
Actual behavior A transform gizmo appears up and instantly the editor freezes and crashes
Screenshots/Video If applicable, add screenshots and/or a video to help explain your problem.
Found in Branch
main
anddevelopment
. The crash is likely to be related to theEMotionFX
gem.Commit ID from o3de/o3de Repository 2409 binary release development at e3775002a627843f59ac48108db362a175467c02
Desktop/Device (please complete the following information):
Additional context The related error in the log is:
The full logs: Editor.log error.log