* Fixed syntax error in ModifierHelper

* Other minor fixes

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7855 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 14 years ago
parent a0dea25ec5
commit b8826716b1
  1. 19
      engine/src/blender/com/jme3/scene/plugins/blender/helpers/v249/ModifierHelper.java
  2. 16
      engine/src/blender/com/jme3/scene/plugins/blender/structures/Modifier.java
  3. 2
      engine/src/core/com/jme3/asset/AssetKey.java

@ -40,6 +40,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.jme3.animation.AnimControl;
@ -118,7 +119,7 @@ public class ModifierHelper extends AbstractBlenderHelper {
} else if (Modifier.MIRROR_MODIFIER_DATA.equals(modifier.getType())) {
return this.applyMirrorModifierData(node, modifier, dataRepository);
} else {
LOGGER.warning("Modifier: " + modifier.getType() + " not yet implemented!!!");
LOGGER.log(Level.WARNING, "Modifier: {0} not yet implemented!!!", modifier.getType());
return node;
}
}
@ -266,7 +267,7 @@ public class ModifierHelper extends AbstractBlenderHelper {
loadedModifier = new AnimData(new Skeleton(bones), animations);
}
} else {
LOGGER.warning("Unsupported modifier type: " + modifier.getType());
LOGGER.log(Level.WARNING, "Unsupported modifier type: {0}", modifier.getType());
}
} else if (Modifier.PARTICLE_MODIFIER_DATA.equals(modifier.getType())) {// ****************PARTICLES MODIFIER
Pointer pParticleSystem = (Pointer) modifier.getFieldValue("psys");
@ -488,7 +489,11 @@ public class ModifierHelper extends AbstractBlenderHelper {
protected Node applyObjectAnimationModifier(Node node, Modifier modifier, DataRepository dataRepository) {
AnimData ad = (AnimData) modifier.getJmeModifierRepresentation();
ad.skeleton.getBone(0).setAttachNode(node);
// TODO: Why is this line here? Why is this needed?
// Remove if necessary.
//ad.skeleton.getBone(0).setAttachNode(node);
return this.applyArmatureModifierData(node, modifier, dataRepository);
}
@ -544,7 +549,7 @@ public class ModifierHelper extends AbstractBlenderHelper {
objectOffset[1] = translation.y;
objectOffset[2] = translation.z;
} catch (BlenderFileException e) {
LOGGER.warning("Problems in blender file structure! Object offset cannot be applied! The problem: " + e.getMessage());
LOGGER.log(Level.WARNING, "Problems in blender file structure! Object offset cannot be applied! The problem: {0}", e.getMessage());
}
}
@ -563,10 +568,10 @@ public class ModifierHelper extends AbstractBlenderHelper {
ObjectHelper objectHelper = dataRepository.getHelper(ObjectHelper.class);
caps[i] = (Node) objectHelper.toObject(capStructure, dataRepository);
if (caps[i] == null) {
LOGGER.warning("Cap object '" + capStructure.getName() + "' couldn't be loaded!");
LOGGER.log(Level.WARNING, "Cap object ''{0}'' couldn''t be loaded!", capStructure.getName());
}
} catch (BlenderFileException e) {
LOGGER.warning("Problems in blender file structure! Cap object cannot be applied! The problem: " + e.getMessage());
LOGGER.log(Level.WARNING, "Problems in blender file structure! Cap object cannot be applied! The problem: {0}", e.getMessage());
}
}
}
@ -648,7 +653,7 @@ public class ModifierHelper extends AbstractBlenderHelper {
center[2] = translation.z;
}
} catch (BlenderFileException e) {
LOGGER.severe("Cannot load mirror's reference object. Cause: " + e.getLocalizedMessage());
LOGGER.log(Level.SEVERE, "Cannot load mirror''s reference object. Cause: {0}", e.getLocalizedMessage());
}
}
float tolerance = ((Number) modifierData.get("tolerance")).floatValue();

@ -7,16 +7,26 @@ package com.jme3.scene.plugins.blender.structures;
* @author Marcin Roguski (Kaelthas)
*/
public class Modifier {
public static final String ARRAY_MODIFIER_DATA = "ArrayModifierData";
public static final String ARMATURE_MODIFIER_DATA = "ArmatureModifierData";
public static final String PARTICLE_MODIFIER_DATA = "ParticleSystemModifierData";
public static final String MIRROR_MODIFIER_DATA = "MirrorModifierData";
public static final String OBJECT_ANIMATION_MODIFIER_DATA = "ObjectAnimationModifierData";
/** Blender's type of modifier. */
/**
* Blender's type of modifier.
*/
private String type;
/** JME modifier representation object. */
/**
* JME modifier representation object.
*/
private Object jmeModifierRepresentation;
/** Various additional data used by modifiers.*/
/**
* Various additional data used by modifiers.
*/
private Object additionalData;
/**

@ -61,7 +61,7 @@ public class AssetKey<T> implements Savable {
protected static String getExtension(String name){
int idx = name.lastIndexOf('.');
//workaround for filenames ending with xml and another dot ending before that (my.mesh.xml)
if(name.toLowerCase().indexOf(".xml")==name.length()-4){
if (name.toLowerCase().endsWith(".xml")) {
idx = name.substring(0, idx).lastIndexOf('.');
if (idx == -1) {
idx = name.lastIndexOf('.');

Loading…
Cancel
Save