From d7995b4a6a6e1171b97386f49f4ac9eafd20f1dc Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Wed, 4 May 2011 22:39:22 +0000 Subject: [PATCH] * Fixed crash in MaterialLoader when handling materials exported from Blender 2.57 git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7446 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java b/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java index aec8e31ad..e42c5f02a 100644 --- a/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java +++ b/engine/src/ogre/com/jme3/scene/plugins/ogre/MaterialLoader.java @@ -224,7 +224,13 @@ public class MaterialLoader implements AssetLoader { diffuse = readColor(); } }else if(keyword.equals("ambient")) { - ambient = readColor(); + if (scan.hasNext("vertexcolour")){ + // use vertex colors + ambient = ColorRGBA.White; + scan.next(); // skip it + }else{ + ambient = readColor(); + } }else if (keyword.equals("specular")){ specular = new ColorRGBA(); specular.r = scan.nextFloat();