From c994965510d084db4c8d5dcca61197477f909165 Mon Sep 17 00:00:00 2001 From: "sha..RD" Date: Sat, 2 Feb 2013 20:03:16 +0000 Subject: [PATCH] * Fix GBF crash when merging with blender models (since they have index component count = 1) git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10306 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../tools/jme3tools/optimize/GeometryBatchFactory.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java b/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java index 6b4c5c648..35183e922 100644 --- a/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java +++ b/engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java @@ -132,11 +132,11 @@ public class GeometryBatchFactory { for (VertexBuffer vb : geom.getMesh().getBufferList().getArray()) { int currentCompsForBuf = compsForBuf[vb.getBufferType().ordinal()]; - if (currentCompsForBuf != 0 && currentCompsForBuf != vb.getNumComponents()) { - throw new UnsupportedOperationException("The geometry " + geom + " buffer " + vb.getBufferType() + - " has different number of components than the rest of the meshes " + - "(this: " + vb.getNumComponents() + ", expected: " + currentCompsForBuf + ")"); - } + if (vb.getBufferType() != Type.Index && currentCompsForBuf != 0 && currentCompsForBuf != vb.getNumComponents()) { + throw new UnsupportedOperationException("The geometry " + geom + " buffer " + vb.getBufferType() + + " has different number of components than the rest of the meshes " + + "(this: " + vb.getNumComponents() + ", expected: " + currentCompsForBuf + ")"); + } compsForBuf[vb.getBufferType().ordinal()] = vb.getNumComponents(); formatForBuf[vb.getBufferType().ordinal()] = vb.getFormat(); }