From 3d54ab33782b048e11c457ce7a5b82e9a17323ec Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Sun, 8 Jan 2012 23:48:28 +0000 Subject: [PATCH] * Blender loader will now extract vertex data into separate vertex buffers for meshes that use multiple materials instead of sharing them git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9007 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../jme3/scene/plugins/blender/meshes/MeshHelper.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/meshes/MeshHelper.java b/engine/src/blender/com/jme3/scene/plugins/blender/meshes/MeshHelper.java index 8e9e6a04a..c92693340 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/meshes/MeshHelper.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/meshes/MeshHelper.java @@ -402,6 +402,15 @@ public class MeshHelper extends AbstractBlenderHelper { } } } + + // if there are multiple materials used, extract the shared + // vertex data + if (geometries.size() > 1){ + // extract from itself + for (Geometry geom : geometries){ + geom.getMesh().extractVertexData(geom.getMesh()); + } + } blenderContext.addLoadedFeatures(structure.getOldMemoryAddress(), structure.getName(), structure, geometries); blenderContext.setMeshContext(structure.getOldMemoryAddress(), meshContext);