Browse Source

GLTFLoader: Move geometry.userData setting to addPrimitiveAttributes

Takahiro 7 years ago
parent
commit
abe3deb39b
1 changed files with 6 additions and 1 deletions
  1. 6 1
      examples/js/loaders/GLTFLoader.js

+ 6 - 1
examples/js/loaders/GLTFLoader.js

@@ -2074,6 +2074,12 @@ THREE.GLTFLoader = ( function () {
 
 		}
 
+		if ( primitiveDef.extras !== undefined ) {
+
+			geometry.userData = primitiveDef.extras;
+
+		}
+
 	}
 
 	/**
@@ -2314,7 +2320,6 @@ THREE.GLTFLoader = ( function () {
 					if ( geometries.length > 1 ) mesh.name += '_' + i;
 
 					if ( meshDef.extras !== undefined ) mesh.userData = meshDef.extras;
-					if ( primitive.extras !== undefined ) mesh.geometry.userData = primitive.extras;
 
 					meshes.push( mesh );