From cbefb99eed6d8ed9c944212b8b4b1df45448f759 Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Sun, 22 May 2011 00:28:34 +0000 Subject: [PATCH] * OBJ loader will warn you if you're using lit meshes without normals git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7514 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/core-plugins/com/jme3/scene/plugins/OBJLoader.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java b/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java index f5a17cf61..998e28c86 100644 --- a/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java +++ b/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java @@ -45,6 +45,7 @@ import com.jme3.scene.Mesh.Mode; import com.jme3.scene.Node; import com.jme3.scene.Spatial; import com.jme3.scene.VertexBuffer; +import com.jme3.scene.VertexBuffer.Type; import com.jme3.scene.mesh.IndexBuffer; import com.jme3.scene.mesh.IndexIntBuffer; import com.jme3.scene.mesh.IndexShortBuffer; @@ -409,6 +410,12 @@ public final class OBJLoader implements AssetLoader { else geom.setQueueBucket(Bucket.Opaque); + if (material.getMaterialDef().getName().contains("Lighting") + || mesh.getFloatBuffer(Type.Normal) == null){ + logger.log(Level.WARNING, "OBJ mesh {0} doesn't contain normals! " + + "It might not display correctly", geom.getName()); + } + return geom; }