for (int i = 0; i < finalTimeList.size(); i++) {
time[i] = finalTimeList.get(i);
}
final Transform[] transforms = finalTransformList.toArray(new Transform[finalTransformList.size()]);
AnimationClip animationClip = animationItemRoot.getAnimationClip();
if (animationClip == null) {
animationClip = new AnimationClip(animationItemRoot.getName());
animationItemRoot.setAnimationClip(animationClip);
}
// Make an animation channel - first find if we have a matching joint
Joint joint = _dataCache.getElementJointMapping().get(parentElement);
if (joint == null) {
String nodeName = parentElement.getAttributeValue("name", (String) null);
if (nodeName == null) { // use id if name doesn't exist
nodeName = parentElement.getAttributeValue("id", parentElement.getName());
}
if (nodeName != null) {
joint = _dataCache.getExternalJointMapping().get(nodeName);
}
if (joint == null) {
// no joint still, so make a transform channel.
final TransformChannel transformChannel = new TransformChannel(nodeName, time, transforms);
animationClip.addChannel(transformChannel);
_colladaStorage.getAnimationChannels().add(transformChannel);
return;
}
}
// create joint channel
final JointChannel jointChannel = new JointChannel(joint, time, transforms);
animationClip.addChannel(jointChannel);
_colladaStorage.getAnimationChannels().add(jointChannel);
}