From 86be16cda44a1c1be7bdcc3553688a6dde33638c Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Sat, 21 Jul 2012 12:04:49 +0000 Subject: [PATCH] Fixed Issue 498: Blender loader has strict requirements for animation import. (Although the animation of the given model looks bad because bone constraints are not yet fully supported.) git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9577 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/scene/plugins/blender/animations/Ipo.java | 5 ++++- .../com/jme3/scene/plugins/blender/animations/IpoHelper.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/animations/Ipo.java b/engine/src/blender/com/jme3/scene/plugins/blender/animations/Ipo.java index b416118b4..ed2b4a0de 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/animations/Ipo.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/animations/Ipo.java @@ -1,5 +1,7 @@ package com.jme3.scene.plugins.blender.animations; +import java.util.logging.Logger; + import com.jme3.animation.BoneTrack; import com.jme3.animation.SpatialTrack; import com.jme3.animation.Track; @@ -16,6 +18,7 @@ import com.jme3.scene.plugins.blender.curves.BezierCurve; * @author Marcin Roguski */ public class Ipo { + private static final Logger LOGGER = Logger.getLogger(Ipo.class.getName()); public static final int AC_LOC_X = 1; public static final int AC_LOC_Y = 2; @@ -218,7 +221,7 @@ public class Ipo { } break; default: - throw new IllegalStateException("Unknown ipo curve type: " + bezierCurves[j].getType()); + LOGGER.warning("Unknown ipo curve type: " + bezierCurves[j].getType()); } } translations[index] = new Vector3f(translation[0], translation[1], translation[2]); diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/animations/IpoHelper.java b/engine/src/blender/com/jme3/scene/plugins/blender/animations/IpoHelper.java index 94faba587..c438c9d2a 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/animations/IpoHelper.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/animations/IpoHelper.java @@ -10,6 +10,7 @@ import com.jme3.scene.plugins.blender.file.FileBlockHeader; import com.jme3.scene.plugins.blender.file.Pointer; import com.jme3.scene.plugins.blender.file.Structure; import java.util.List; +import java.util.logging.Logger; /** * This class helps to compute values from interpolation curves for features @@ -19,6 +20,7 @@ import java.util.List; * @author Marcin Roguski */ public class IpoHelper extends AbstractBlenderHelper { + private static final Logger LOGGER = Logger.getLogger(IpoHelper.class.getName()); /** * This constructor parses the given blender version and stores the result. @@ -132,7 +134,8 @@ public class IpoHelper extends AbstractBlenderHelper { if (rnaPath.endsWith("rotation") || rnaPath.endsWith("rotation_euler")) { return Ipo.OB_ROT_X + arrayIndex; } - throw new IllegalStateException("Unknown curve rna path: " + rnaPath); + LOGGER.warning("Unknown curve rna path: " + rnaPath); + return -1; } /**