Explorar el Código

Fixing a bug with cloning SkeletonControl for Spatial. The anim control will always be added if the object has an armature, even if it has no animations.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8950 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Kae..pl hace 14 años
padre
commit
e4c4380ab5

+ 2 - 3
engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ArmatureModifier.java

@@ -186,6 +186,7 @@ import com.jme3.util.BufferUtils;
 		}
 		}
 
 
 		// applying animations
 		// applying animations
+		AnimControl control = new AnimControl(animData.skeleton);
 		ArrayList<Animation> animList = animData.anims;
 		ArrayList<Animation> animList = animData.anims;
 		if (animList != null && animList.size() > 0) {
 		if (animList != null && animList.size() > 0) {
 			HashMap<String, Animation> anims = new HashMap<String, Animation>(animList.size());
 			HashMap<String, Animation> anims = new HashMap<String, Animation>(animList.size());
@@ -193,11 +194,9 @@ import com.jme3.util.BufferUtils;
 				Animation animation = animList.get(i);
 				Animation animation = animList.get(i);
 				anims.put(animation.getName(), animation);
 				anims.put(animation.getName(), animation);
 			}
 			}
-
-			AnimControl control = new AnimControl(animData.skeleton);
 			control.setAnimations(anims);
 			control.setAnimations(anims);
-			node.addControl(control);
 		}
 		}
+		node.addControl(control);
 		node.addControl(new SkeletonControl(animData.skeleton));
 		node.addControl(new SkeletonControl(animData.skeleton));
 
 
 		return node;
 		return node;