Bugfix: animations are now loaded from frame 1 rather than 0 (just like in blender).

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10965 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
Kae..pl 11 years ago
parent 5851055a1a
commit a7f0a5a99b
  1. 4
      engine/src/blender/com/jme3/scene/plugins/blender/animations/ArmatureHelper.java
  2. 2
      engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ObjectAnimationModifier.java

@ -183,7 +183,7 @@ public class ArmatureHelper extends AbstractBlenderHelper {
Bone bone = skeleton.getBone(boneIndex); Bone bone = skeleton.getBone(boneIndex);
Ipo ipo = new Ipo(bezierCurves, fixUpAxis, blenderContext.getBlenderVersion()); Ipo ipo = new Ipo(bezierCurves, fixUpAxis, blenderContext.getBlenderVersion());
tracks.add((BoneTrack) ipo.calculateTrack(boneIndex, bone.getLocalPosition(), bone.getLocalRotation(), bone.getLocalScale(), 0, ipo.getLastFrame(), fps, false)); tracks.add((BoneTrack) ipo.calculateTrack(boneIndex, bone.getLocalPosition(), bone.getLocalRotation(), bone.getLocalScale(), 1, ipo.getLastFrame(), fps, false));
} }
} }
this.equaliseBoneTracks(tracks); this.equaliseBoneTracks(tracks);
@ -221,7 +221,7 @@ public class ArmatureHelper extends AbstractBlenderHelper {
Bone bone = skeleton.getBone(boneIndex); Bone bone = skeleton.getBone(boneIndex);
Ipo ipo = ipoHelper.fromIpoStructure(ipoStructure, blenderContext); Ipo ipo = ipoHelper.fromIpoStructure(ipoStructure, blenderContext);
if (ipo != null) { if (ipo != null) {
tracks.add((BoneTrack) ipo.calculateTrack(boneIndex, bone.getLocalPosition(), bone.getLocalRotation(), bone.getLocalScale(), 0, ipo.getLastFrame(), fps, false)); tracks.add((BoneTrack) ipo.calculateTrack(boneIndex, bone.getLocalPosition(), bone.getLocalRotation(), bone.getLocalScale(), 1, ipo.getLastFrame(), fps, false));
} }
} }
} }

@ -53,7 +53,7 @@ import com.jme3.scene.plugins.blender.file.BlenderFileException;
Spatial object = (Spatial) blenderContext.getLoadedFeature(objectOMA, LoadedFeatureDataType.LOADED_FEATURE); Spatial object = (Spatial) blenderContext.getLoadedFeature(objectOMA, LoadedFeatureDataType.LOADED_FEATURE);
// calculating track // calculating track
SpatialTrack track = (SpatialTrack) ipo.calculateTrack(-1, object.getLocalTranslation(), object.getLocalRotation(), object.getLocalScale(), 0, ipo.getLastFrame(), fps, true); SpatialTrack track = (SpatialTrack) ipo.calculateTrack(-1, object.getLocalTranslation(), object.getLocalRotation(), object.getLocalScale(), 1, ipo.getLastFrame(), fps, true);
Animation animation = new Animation(objectAnimationName, ipo.getLastFrame() / (float) fps); Animation animation = new Animation(objectAnimationName, ipo.getLastFrame() / (float) fps);
animation.setTracks(new SpatialTrack[] { track }); animation.setTracks(new SpatialTrack[] { track });

Loading…
Cancel
Save