From a7f0a5a99b30bc0b61a6fe85615d72d3d42f8115 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Tue, 7 Jan 2014 07:08:27 +0000 Subject: [PATCH] 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 --- .../jme3/scene/plugins/blender/animations/ArmatureHelper.java | 4 ++-- .../plugins/blender/modifiers/ObjectAnimationModifier.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/animations/ArmatureHelper.java b/engine/src/blender/com/jme3/scene/plugins/blender/animations/ArmatureHelper.java index 2c87d9c0f..9370cdc8c 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/animations/ArmatureHelper.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/animations/ArmatureHelper.java @@ -183,7 +183,7 @@ public class ArmatureHelper extends AbstractBlenderHelper { Bone bone = skeleton.getBone(boneIndex); 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); @@ -221,7 +221,7 @@ public class ArmatureHelper extends AbstractBlenderHelper { Bone bone = skeleton.getBone(boneIndex); Ipo ipo = ipoHelper.fromIpoStructure(ipoStructure, blenderContext); 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)); } } } diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ObjectAnimationModifier.java b/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ObjectAnimationModifier.java index caf1e206e..805260202 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ObjectAnimationModifier.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ObjectAnimationModifier.java @@ -53,7 +53,7 @@ import com.jme3.scene.plugins.blender.file.BlenderFileException; Spatial object = (Spatial) blenderContext.getLoadedFeature(objectOMA, LoadedFeatureDataType.LOADED_FEATURE); // 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.setTracks(new SpatialTrack[] { track });