1
0
Fork 0
forked from fte/fteqw

Fix for IQM skeletons with multiple root bones (#218)

Fix case where skeleton contains multiple root bones with no parent bone
This commit is contained in:
Luis Gutierrez 2023-08-28 20:29:55 -07:00 committed by GitHub
parent 510f50789c
commit 25e1db29bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4577,12 +4577,14 @@ void calcanimdata()
pose &j = poses.add();
j.name = p.bonename;
j.parent = -1;
loopk(p.remap)
{
if (!strcmp(poses[k].name, fr.pose[p.boneparent].bonename))
if(p.boneparent >= 0) {
loopk(p.remap)
{
j.parent = k;
break;
if (!strcmp(poses[k].name, fr.pose[p.boneparent].bonename))
{
j.parent = k;
break;
}
}
}
loopk(10) { j.offset[k] = 1e16f; j.scale[k] = -1e16f; }