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

vrm spring bone #429

Open
Ander456 opened this issue Oct 25, 2024 · 1 comment
Open

vrm spring bone #429

Ander456 opened this issue Oct 25, 2024 · 1 comment

Comments

@Ander456
Copy link

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 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.

@ruyo
Copy link
Owner

ruyo commented Nov 6, 2024

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.

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