VRM4U icon indicating copy to clipboard operation
VRM4U copied to clipboard

vrm spring bone

Open Ander456 opened this issue 1 year ago • 1 comments

Describe the bug spring bone data chain only add first child chain; so the other will not be effect

Screenshots, log image image image

UnrealEngine Version: [UE5.3]

Additional context for some reason i try to fix the bug use this code replace origin // // 使用堆栈代替递归处理所有子骨骼 // struct BoneStackItem { // int32 BoneIndex; // int32 Depth; // }; // // TArray<BoneStackItem> BoneStack; // for (int32 ChildIndex : Children) { // BoneStack.Add({ChildIndex, 1}); // } // // while (BoneStack.Num() > 0) { // BoneStackItem CurrentItem = BoneStack.Pop(); // if (CurrentItem.Depth >= 100) { // continue; // } // // TArray CurrentChildren; // VRMUtil::GetDirectChildBones(VRMGetRefSkeleton(skeletalMesh), CurrentItem.BoneIndex, CurrentChildren); // if (CurrentChildren.Num() <= 0) // { // continue; // } // // auto& CurrentSData = chain.AddDefaulted_GetRef(); // CurrentSData.boneIndex = CurrentItem.BoneIndex; // CurrentSData.boneName = *RefSkeleton.GetBoneName(CurrentSData.boneIndex).ToString(); // // if (CurrentChildren.Num() > 0) { // CurrentSData.m_boneAxis = RefSkeletonTransform[CurrentChildren[0]].GetLocation(); // } else { // CurrentSData.m_boneAxis = RefSkeletonTransform[CurrentSData.boneIndex].GetLocation() * 0.7f; // } // // for (int32 ChildIndex : CurrentChildren) { // BoneStack.Add({ChildIndex, CurrentItem.Depth + 1}); // } // } // } // }

result the strap bone 012 chain is work. but others sway strongly suddenly.

Ander456 avatar Oct 25 '24 03:10 Ander456

Hi. The current VRM4U does not support the branching sway bone. If you really want to use UE, please change the setting of the sway bone.

ruyo avatar Nov 06 '24 15:11 ruyo