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:
parent
510f50789c
commit
25e1db29bf
1 changed files with 7 additions and 5 deletions
12
iqm/iqm.cpp
12
iqm/iqm.cpp
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue