Bugfix: fixed an issue with badly loaded bone animations when bones did not have fully defined translation/rotation/scale.
Bugfix: fixed an issue with blender 2.49 animation loading when ipo had no curves defined (NPE was then thrown). git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@11001 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
162808f0cd
commit
752599891a
@ -274,10 +274,12 @@ public class AnimationHelper extends AbstractBlenderHelper {
|
|||||||
if (!p.isNull()) {
|
if (!p.isNull()) {
|
||||||
Structure ipoStructure = p.fetchData().get(0);
|
Structure ipoStructure = p.fetchData().get(0);
|
||||||
Ipo ipo = this.fromIpoStructure(ipoStructure, blenderContext);
|
Ipo ipo = this.fromIpoStructure(ipoStructure, blenderContext);
|
||||||
|
if(ipo != null) {//this can happen when ipo with no curves appear in blender file
|
||||||
lastFrame = Math.max(lastFrame, ipo.getLastFrame());
|
lastFrame = Math.max(lastFrame, ipo.getLastFrame());
|
||||||
blenderAction.featuresTracks.put(animatedFeatureName, ipo);
|
blenderAction.featuresTracks.put(animatedFeatureName, ipo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
blenderAction.stopFrame = lastFrame;
|
blenderAction.stopFrame = lastFrame;
|
||||||
return blenderAction;
|
return blenderAction;
|
||||||
}
|
}
|
||||||
@ -364,9 +366,8 @@ public class AnimationHelper extends AbstractBlenderHelper {
|
|||||||
public BoneTrack[] toTracks(Skeleton skeleton) {
|
public BoneTrack[] toTracks(Skeleton skeleton) {
|
||||||
List<BoneTrack> tracks = new ArrayList<BoneTrack>(featuresTracks.size());
|
List<BoneTrack> tracks = new ArrayList<BoneTrack>(featuresTracks.size());
|
||||||
for (Entry<String, Ipo> entry : featuresTracks.entrySet()) {
|
for (Entry<String, Ipo> entry : featuresTracks.entrySet()) {
|
||||||
Bone bone = skeleton.getBone(entry.getKey());
|
|
||||||
int boneIndex = skeleton.getBoneIndex(entry.getKey());
|
int boneIndex = skeleton.getBoneIndex(entry.getKey());
|
||||||
tracks.add((BoneTrack) entry.getValue().calculateTrack(boneIndex, bone.getLocalPosition(), bone.getLocalRotation(), bone.getLocalScale(), 1, stopFrame, fps, false));
|
tracks.add((BoneTrack) entry.getValue().calculateTrack(boneIndex, Vector3f.ZERO, Quaternion.IDENTITY, Vector3f.UNIT_XYZ, 1, stopFrame, fps, false));
|
||||||
}
|
}
|
||||||
return tracks.toArray(new BoneTrack[tracks.size()]);
|
return tracks.toArray(new BoneTrack[tracks.size()]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user