Refactoring: removed unnecessary return type from the modifiers (it was never used).
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10803 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
8df3569688
commit
2a00f1ccb0
engine/src/blender/com/jme3/scene/plugins/blender/modifiers
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -127,11 +127,10 @@ import java.util.logging.Logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node apply(Node node, BlenderContext blenderContext) {
|
||||
public void apply(Node node, BlenderContext blenderContext) {
|
||||
if (invalid) {
|
||||
LOGGER.log(Level.WARNING, "Array modifier is invalid! Cannot be applied to: {0}", node.getName());
|
||||
return node;
|
||||
}
|
||||
} else {
|
||||
int fittype = ((Number) modifierData.get("fittype")).intValue();
|
||||
float[] offset = (float[]) modifierData.get("offset");
|
||||
if (offset == null) {// the node will be repeated several times in the same place
|
||||
@ -243,6 +242,6 @@ import java.util.logging.Logger;
|
||||
node.attachChild(caps[1]);
|
||||
}
|
||||
}
|
||||
return node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,12 +64,10 @@ import com.jme3.scene.plugins.blender.objects.ObjectHelper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node apply(Node node, BlenderContext blenderContext) {
|
||||
public void apply(Node node, BlenderContext blenderContext) {
|
||||
if (invalid) {
|
||||
LOGGER.log(Level.WARNING, "Mirror modifier is invalid! Cannot be applied to: {0}", node.getName());
|
||||
return node;
|
||||
}
|
||||
|
||||
} else {
|
||||
int flag = ((Number) modifierData.get("flag")).intValue();
|
||||
float[] mirrorFactor = new float[] { (flag & 0x08) != 0 ? -1.0f : 1.0f, (flag & 0x10) != 0 ? -1.0f : 1.0f, (flag & 0x20) != 0 ? -1.0f : 1.0f };
|
||||
if (blenderContext.getBlenderKey().isFixUpAxis()) {
|
||||
@ -190,6 +188,6 @@ import com.jme3.scene.plugins.blender.objects.ObjectHelper;
|
||||
geometriesToAdd.clear();
|
||||
}
|
||||
}
|
||||
return node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,9 +37,8 @@ public abstract class Modifier {
|
||||
* the node that will have modifier applied
|
||||
* @param blenderContext
|
||||
* the blender context
|
||||
* @return the node with applied modifier
|
||||
*/
|
||||
public abstract Node apply(Node node, BlenderContext blenderContext);
|
||||
public abstract void apply(Node node, BlenderContext blenderContext);
|
||||
|
||||
/**
|
||||
* Determines if the modifier can be applied multiple times over one mesh.
|
||||
|
@ -65,7 +65,7 @@ import com.jme3.scene.plugins.blender.file.BlenderFileException;
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
@ -85,6 +85,5 @@ import com.jme3.scene.plugins.blender.file.BlenderFileException;
|
||||
node.addControl(control);
|
||||
}
|
||||
}
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
@ -55,12 +55,10 @@ import java.util.logging.Logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Node apply(Node node, BlenderContext blenderContext) {
|
||||
public void apply(Node node, BlenderContext blenderContext) {
|
||||
if (invalid) {
|
||||
LOGGER.log(Level.WARNING, "Particles modifier is invalid! Cannot be applied to: {0}", node.getName());
|
||||
return node;
|
||||
}
|
||||
|
||||
} else {
|
||||
MaterialHelper materialHelper = blenderContext.getHelper(MaterialHelper.class);
|
||||
ParticleEmitter emitter = particleEmitter.clone();
|
||||
|
||||
@ -91,6 +89,6 @@ import java.util.logging.Logger;
|
||||
}
|
||||
|
||||
node.attachChild(emitter);
|
||||
return node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user