소스 검색

* 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
sha..RD 12 년 전
부모
커밋
c994965510
1개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 5
      engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java

+ 5 - 5
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();
             }