Crashes when updating the constraint limits using characters with multiple LODs
sergi-gonzalez opened this issue · 1 comments
Hi @pafuhana1213,
Your plugin is awesome. Thanks for sharing it.
We are using Kawaii Physics with UE 5.1.
If you character has multiple LODs, the plugin will crash when trying to get CompactPoseIndex in different locations of \KawaiiPhysics\Source\KawaiiPhysics\Private\AnimNode_KawaiiPhysics.cpp
const FCompactPoseBoneIndex CompactPoseIndex = Capsule.DrivingBone.GetCompactPoseIndex(BoneContainer);
when your character is using a LOD different from zero because the DrivingBone indices only work for LOD zero.
We have added the following code to fix the crashes right before calling UpdateSphericalLimits in the method FAnimNode_KawaiiPhysics::EvaluateSkeletalControl_AnyThread.
for (auto& Sphere : SphericalLimitsData) { Sphere.DrivingBone.CachedCompactPoseIndex = BoneContainer.MakeCompactPoseIndex(Sphere.DrivingBone.GetMeshPoseIndex(BoneContainer)); }
for (auto& Capsule : CapsuleLimitsData) { Capsule.DrivingBone.CachedCompactPoseIndex = BoneContainer.MakeCompactPoseIndex(Capsule.DrivingBone.GetMeshPoseIndex(BoneContainer)); }
for (auto& Planer : PlanarLimitsData) { Planer.DrivingBone.CachedCompactPoseIndex = BoneContainer.MakeCompactPoseIndex(Planer.DrivingBone.GetMeshPoseIndex(BoneContainer)); }
Best regards,
s
Hi @sergi-gonzalez ,
Thanks for your report and I committed the following codes to fix this issue.
aff5328
Please check it! Thanks!