if (tracks != null && tracks.length > 0) { Animation spatialAnimation = new Animation(action.getName(), action.getAnimationTime()); spatialAnimation.setTracks(tracks); animations.add(spatialAnimation); blenderContext.addAnimation((Long) node.getUserData(ObjectHelper.OMA_MARKER), spatialAnimation);
if (tracks != null && tracks.length > 0) { Animation boneAnimation = new Animation(action.getName(), action.getAnimationTime()); boneAnimation.setTracks(tracks); animations.add(boneAnimation); Long animatedNodeOMA = ((Number) blenderContext.getMarkerValue(ObjectHelper.OMA_MARKER, node)).longValue();
/** * Creates an Animation based on the keyFrames previously added to the helper. * @return the generated animation */ public Animation buildAnimation() { interpolateTime(); interpolate(keyFramesTranslation, Type.Translation); interpolate(keyFramesRotation, Type.Rotation); interpolate(keyFramesScale, Type.Scale); SpatialTrack spatialTrack = new SpatialTrack(times, translations, rotations, scales); //creating the animation Animation spatialAnimation = new Animation(name, duration); spatialAnimation.setTracks(new SpatialTrack[]{spatialTrack}); return spatialAnimation; }
anim.setTracks(new Track[]{ pair.toJmeSpatialTrack() });
spatialAnimation.setTracks(new SpatialTrack[] { spatialTrack });
animation.setTracks(trackList); tracks.clear(); } else if (qName.equals("keyframe")) {
animation.setTracks(trackList); tracks.clear(); } else if (qName.equals("keyframe")) {
animation.setTracks(trackList); tracks.clear(); } else if (qName.equals("keyframe")) {
animation.setTracks(poseTracks.toArray(new PoseTrack[poseTracks.size()])); AnimControl control = new AnimControl(); control.addAnim(animation);
/** * Creates an Animation based on the keyFrames previously added to the helper. * @return the generated animation */ public Animation buildAnimation() { interpolateTime(); interpolate(keyFramesTranslation, Type.Translation); interpolate(keyFramesRotation, Type.Rotation); interpolate(keyFramesScale, Type.Scale); SpatialTrack spatialTrack = new SpatialTrack(times, translations, rotations, scales); //creating the animation Animation spatialAnimation = new Animation(name, duration); spatialAnimation.setTracks(new SpatialTrack[]{spatialTrack}); return spatialAnimation; }
/** * Creates an Animation based on the keyFrames previously added to the helper. * @return the generated animation */ public Animation buildAnimation() { interpolateTime(); interpolate(keyFramesTranslation, Type.Translation); interpolate(keyFramesRotation, Type.Rotation); interpolate(keyFramesScale, Type.Scale); SpatialTrack spatialTrack = new SpatialTrack(times, translations, rotations, scales); //creating the animation Animation spatialAnimation = new Animation(name, duration); spatialAnimation.setTracks(new SpatialTrack[]{spatialTrack}); return spatialAnimation; }
anim.setTracks(new Track[]{ pair.toJmeSpatialTrack() });
boneAnim.setTracks(new BoneTrack[] {boneTrack});
private Animation createAnimation(DAENode animationNode, Bone bone, Skeleton skeleton) { DAENode channel = animationNode.getChild(Names.CHANNEL); DAENode sampler = animationNode.getChild(Names.SAMPLER); DAENode times = sampler.getChild(Names.INPUT, Names.SEMANTIC, Semantic.INPUT.name()).getLinkedSource(); DAENode values = sampler.getChild(Names.INPUT, Names.SEMANTIC, Semantic.OUTPUT.name()).getLinkedSource(); float[] timeValues = times.getChild(Names.FLOAT_ARRAY).getContent(FLOAT_LIST).get(); float[] outputValues = values.getChild(Names.FLOAT_ARRAY).getContent(FLOAT_LIST).get(); ChannelTarget channelTarget = ChannelTarget.forName(channel.getAttribute(Names.TARGET, TEXT).get()); Conditions.checkTrue(sampler.isDefined()); Conditions.checkTrue(times.isDefined()); Conditions.checkTrue(values.isDefined()); Conditions.checkTrue(channel.isDefined()); Conditions.checkNotNull(channelTarget); Conditions.checkNotNull(timeValues); Conditions.checkNotNull(outputValues); Transform[] transformList = channelTarget.transform(outputValues).get(); Conditions.checkNotNull(transformList); Conditions.checkValue(transformList.length, timeValues.length); int boneIndex = skeleton.getBoneIndex(bone); float animationLength = max(timeValues); Quaternion[] rotations = getRotations(transformList); Vector3f[] translations = getTranslations(transformList); BoneTrack track = new BoneTrack(boneIndex, timeValues, translations, rotations); Animation anim = new Animation(animationNode.getAttribute(Names.ID, TEXT).get(), animationLength); anim.setTracks(new BoneTrack[] {track}); return anim; }