Переглянути джерело

Bugfix: fixed a bug that caused an exception to be throw when cloneForSpatial methods were called; this was caused by placing AnimControl before SkeletonControl in the Spatial's controls list

git-svn-id: https://jmonkeyengine.googlecode.com/svn/branches/gradle-restructure@11067 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Kae..pl 11 роки тому
батько
коміт
bc6c3cd93e

+ 7 - 0
jme3-blender/src/main/java/com/jme3/scene/plugins/blender/animations/AnimationHelper.java

@@ -136,6 +136,13 @@ public class AnimationHelper extends AbstractBlenderHelper {
                 }
                 control.setAnimations(anims);
                 node.addControl(control);
+                
+                //make sure that SkeletonControl is added AFTER the AnimControl
+                SkeletonControl skeletonControl = node.getControl(SkeletonControl.class);
+                if(skeletonControl != null) {
+                    node.removeControl(SkeletonControl.class);
+                    node.addControl(skeletonControl);
+                }
             }
         }
     }