|
|
|
@ -177,14 +177,11 @@ import com.jme3.util.BufferUtils; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
|
public Node apply(Node node, BlenderContext blenderContext) { |
|
|
|
|
public void apply(Node node, BlenderContext blenderContext) { |
|
|
|
|
if (invalid) { |
|
|
|
|
LOGGER.log(Level.WARNING, "Armature modifier is invalid! Cannot be applied to: {0}", node.getName()); |
|
|
|
|
}// if invalid, animData will be null
|
|
|
|
|
if (animationData == null || skeleton == null) { |
|
|
|
|
return node; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(animationData != null && skeleton != null) { |
|
|
|
|
// setting weights for bones
|
|
|
|
|
List<Geometry> geomList = (List<Geometry>) blenderContext.getLoadedFeature(meshOMA, LoadedFeatureDataType.LOADED_FEATURE); |
|
|
|
|
MeshContext meshContext = blenderContext.getMeshContext(meshOMA); |
|
|
|
@ -225,11 +222,11 @@ import com.jme3.util.BufferUtils; |
|
|
|
|
} |
|
|
|
|
} catch (BlenderFileException e) { |
|
|
|
|
LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e); |
|
|
|
|
this.invalid = true; |
|
|
|
|
return node; |
|
|
|
|
invalid = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(!invalid) { |
|
|
|
|
// applying animations
|
|
|
|
|
AnimControl control = new AnimControl(animationData.skeleton); |
|
|
|
|
List<Animation> animList = animationData.anims; |
|
|
|
@ -245,8 +242,8 @@ import com.jme3.util.BufferUtils; |
|
|
|
|
node.addControl(new SkeletonControl(animationData.skeleton)); |
|
|
|
|
|
|
|
|
|
blenderContext.setNodeForSkeleton(skeleton, node); |
|
|
|
|
|
|
|
|
|
return node; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|