Created
December 18, 2011 13:43
-
-
Save skrat/1493467 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/extras/loaders/ColladaLoader.js b/src/extras/loaders/ColladaLoader.js | |
index 18b1d98..a30aba7 100644 | |
--- a/src/extras/loaders/ColladaLoader.js | |
+++ b/src/extras/loaders/ColladaLoader.js | |
@@ -1846,6 +1846,9 @@ THREE.ColladaLoader = function () { | |
for ( i = 0; i < this.primitives.length; i ++ ) { | |
var primitive = this.primitives[ i ]; | |
+ if (primitive.count == 0) { | |
+ continue; | |
+ } | |
primitive.setVertices( this.vertices ); | |
this.handlePrimitive( primitive, this.geometry3js, vertex_store ); | |
diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js | |
index 0aee9d4..ba4af63 100644 | |
--- a/src/renderers/WebGLRenderer.js | |
+++ b/src/renderers/WebGLRenderer.js | |
@@ -3863,6 +3863,9 @@ THREE.WebGLRenderer = function ( parameters ) { | |
for ( g in geometry.geometryGroups ) { | |
geometryGroup = geometry.geometryGroups[ g ]; | |
+ if (!geometryGroup.materialIndex) { | |
+ continue; | |
+ } | |
// initialise VBO on the first access | |
@@ -4007,6 +4010,9 @@ THREE.WebGLRenderer = function ( parameters ) { | |
geometryGroup = geometry.geometryGroupsList[ i ]; | |
material = getBufferMaterial( object, geometryGroup ); | |
+ if (!material) { | |
+ continue; | |
+ } | |
customAttributesDirty = material.attributes && areCustomAttributesDirty( m | |
@@ -4028,6 +4034,9 @@ THREE.WebGLRenderer = function ( parameters ) { | |
geometry.__dirtyColors = false; | |
geometry.__dirtyTangents = false; | |
+ if (!material) { | |
+ return; | |
+ } | |
material.attributes && clearCustomAttributes( material ); | |
} else if ( object instanceof THREE.Ribbon ) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment