This is an animation splitter. The following code, instead of naming the first clip the first animation's name, names the second animation that. The second gets the first one's name, the third the second's, and so forth. The first clip seems to get an automatic name of "complete:"
Mesh[] keyFrames = singleStream.getKeyFrames();
Animation animations = new Animation(keyFrames.length);
int numberOfAnimations, totalFramesInMax = 0;
for (numberOfAnimations = 0; numberOfAnimations < nameFields.length && nameFields[numberOfAnimations].getText().trim().length() > 0; numberOfAnimations++)
totalFramesInMax += Integer.parseInt(numberOfFramesFields[numberOfAnimations].getText().trim());
double divider = (double)totalFramesInMax/(double)keyFrames.length;
System.out.println("Total Frames in Max: "+totalFramesInMax +" Divider: "+divider +" Number of KeyFrames: "+keyFrames.length);
for (int i = 0; i < numberOfAnimations; i++) {
final int animationFrames = Integer.parseInt(numberOfFramesFields[i].getText().trim());
final int totalFrames = keyFrames.length;
animations.createSubSequence(nameFields[i].getText().trim());
for (int kf = 0; kf < animationFrames/divider; kf++)
animations.addKeyFrame(keyFrames[kf]);
System.out.println("Finished for: "+nameFields[i].getText());
}
model.setAnimationSequence(animations);
Is this a jpct bug?