Find bones and slots by index, not name.

This commit is contained in:
Nathan Sweet 2021-09-21 21:42:39 -10:00
parent db92cb3667
commit 2614811ef8
3 changed files with 6 additions and 6 deletions

View File

@ -59,8 +59,8 @@ public class IkConstraint implements Updatable {
bones = new Array(data.bones.size);
for (BoneData boneData : data.bones)
bones.add(skeleton.findBone(boneData.name));
target = skeleton.findBone(data.target.name);
bones.add(skeleton.bones.get(boneData.index));
target = skeleton.bones.get(data.target.index);
}
/** Copy constructor. */

View File

@ -66,8 +66,8 @@ public class PathConstraint implements Updatable {
this.data = data;
bones = new Array(data.bones.size);
for (BoneData boneData : data.bones)
bones.add(skeleton.findBone(boneData.name));
target = skeleton.findSlot(data.target.name);
bones.add(skeleton.bones.get(boneData.index));
target = skeleton.slots.get(data.target.index);
position = data.position;
spacing = data.spacing;
mixRotate = data.mixRotate;

View File

@ -59,8 +59,8 @@ public class TransformConstraint implements Updatable {
mixShearY = data.mixShearY;
bones = new Array(data.bones.size);
for (BoneData boneData : data.bones)
bones.add(skeleton.findBone(boneData.name));
target = skeleton.findBone(data.target.name);
bones.add(skeleton.bones.get(boneData.index));
target = skeleton.bones.get(data.target.index);
}
/** Copy constructor. */