Search in sources :

Example 11 with Modifier

use of com.jme3.scene.plugins.blender.modifiers.Modifier in project jmonkeyengine by jMonkeyEngine.

the class Modifier method validate.

protected boolean validate(Structure modifierStructure, BlenderContext blenderContext) {
    Structure modifierData = (Structure) modifierStructure.getFieldValue("modifier");
    Pointer pError = (Pointer) modifierData.getFieldValue("error");
    invalid = pError.isNotNull();
    return !invalid;
}
Also used : Pointer(com.jme3.scene.plugins.blender.file.Pointer) Structure(com.jme3.scene.plugins.blender.file.Structure)

Example 12 with Modifier

use of com.jme3.scene.plugins.blender.modifiers.Modifier in project jmonkeyengine by jMonkeyEngine.

the class TriangulateModifier method apply.

@Override
public void apply(Node node, BlenderContext blenderContext) {
    if (invalid) {
        LOGGER.log(Level.WARNING, "Triangulate modifier is invalid! Cannot be applied to: {0}", node.getName());
    }
    TemporalMesh temporalMesh = this.getTemporalMesh(node);
    if (temporalMesh != null) {
        LOGGER.log(Level.FINE, "Applying triangulation modifier to: {0}", temporalMesh);
        temporalMesh.triangulate();
    } else {
        LOGGER.log(Level.WARNING, "Cannot find temporal mesh for node: {0}. The modifier will NOT be applied!", node);
    }
}
Also used : TemporalMesh(com.jme3.scene.plugins.blender.meshes.TemporalMesh)

Aggregations

Structure (com.jme3.scene.plugins.blender.file.Structure)7 TemporalMesh (com.jme3.scene.plugins.blender.meshes.TemporalMesh)7 Pointer (com.jme3.scene.plugins.blender.file.Pointer)5 ArrayList (java.util.ArrayList)4 Geometry (com.jme3.scene.Geometry)3 Node (com.jme3.scene.Node)3 BlenderFileException (com.jme3.scene.plugins.blender.file.BlenderFileException)3 ParticleEmitter (com.jme3.effect.ParticleEmitter)2 EmitterMeshVertexShape (com.jme3.effect.shapes.EmitterMeshVertexShape)2 Vector3f (com.jme3.math.Vector3f)2 Spatial (com.jme3.scene.Spatial)2 AnimationHelper (com.jme3.scene.plugins.blender.animations.AnimationHelper)2 MeshHelper (com.jme3.scene.plugins.blender.meshes.MeshHelper)2 Modifier (com.jme3.scene.plugins.blender.modifiers.Modifier)2 ObjectHelper (com.jme3.scene.plugins.blender.objects.ObjectHelper)2 HashSet (java.util.HashSet)2 Bone (com.jme3.animation.Bone)1 BoundingBox (com.jme3.bounding.BoundingBox)1 BoundingSphere (com.jme3.bounding.BoundingSphere)1 BoundingVolume (com.jme3.bounding.BoundingVolume)1