Skip to content

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

Closed
@sergi-gonzalez

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions