SDK : Fixed AssetPackLoader so build works again

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7305 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 14 years ago
parent b06652b6a8
commit ea9e60d099
  1. 12
      sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/AssetPackLoader.java

@ -7,6 +7,7 @@ package com.jme3.gde.assetpack;
import com.jme3.animation.AnimControl;
import com.jme3.animation.BoneAnimation;
import com.jme3.animation.BoneTrack;
import com.jme3.animation.SkeletonControl;
import com.jme3.asset.ModelKey;
import com.jme3.gde.assetpack.actions.AddAssetAction;
import com.jme3.gde.assetpack.project.wizards.FileDescription;
@ -47,7 +48,7 @@ public class AssetPackLoader {
Spatial model = null;
Node node = null;
while (fileElement != null) {
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Load main file {0}",fileElement.getAttribute("path"));
Logger.getLogger(AssetPackLoader.class.getName()).log(Level.INFO, "Load main file {0}", fileElement.getAttribute("path"));
if (model != null && node == null) {
node = new Node(assetElement.getAttribute("name"));
node.attachChild(model);
@ -72,7 +73,14 @@ public class AssetPackLoader {
AnimControl control = to.getControl(AnimControl.class);
AnimControl control2 = from.getControl(AnimControl.class);
if (control == null) {
control = new AnimControl(to, control2.getTargets(), control2.getSkeleton());
SkeletonControl fromSkeletonControl = from.getControl(SkeletonControl.class);
control = new AnimControl(control2.getSkeleton());
SkeletonControl toSkeletonControl = to.getControl(SkeletonControl.class);
if (toSkeletonControl == null) {
toSkeletonControl = new SkeletonControl(fromSkeletonControl.getTargets(), control.getSkeleton());
}
to.addControl(control);
to.addControl(toSkeletonControl);
}
Collection<String> names = control.getAnimationNames();
Collection<String> names2 = new LinkedList<String>(control2.getAnimationNames());

Loading…
Cancel
Save