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
This commit is contained in:
Kae..pl 2014-03-04 14:03:09 +00:00
parent b8714b0f10
commit bc6c3cd93e

View File

@ -136,6 +136,13 @@ public class AnimationHelper extends AbstractBlenderHelper {
} }
control.setAnimations(anims); control.setAnimations(anims);
node.addControl(control); 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);
}
} }
} }
} }