Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes when updating the constraint limits using characters with multiple LODs #87

Closed
sergi-gonzalez opened this issue May 18, 2023 · 1 comment

Comments

@sergi-gonzalez
Copy link

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

pafuhana1213 pushed a commit that referenced this issue May 27, 2023
…ers with multiple LODs #87

Added an Enable flag to each Limits to skip processing when DrivingBone is disabled due to LOD etc.
@pafuhana1213
Copy link
Owner

Hi @sergi-gonzalez ,
Thanks for your report and I committed the following codes to fix this issue.
aff5328

Please check it! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants