Explorar el Código

Removing uuid assumption from MaterialLoader.parse() but on the dev branch this time.

JamesHagerman hace 9 años
padre
commit
a67119645f
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      src/loaders/MaterialLoader.js

+ 5 - 1
src/loaders/MaterialLoader.js

@@ -49,7 +49,11 @@ THREE.MaterialLoader.prototype = {
 	parse: function ( json ) {
 
 		var material = new THREE[ json.type ];
-		material.uuid = json.uuid;
+		if ( json.uuid !== undefined) {
+			material.uuid = json.uuid;
+		} else {
+			material.uuid = THREE.Math.generateUUID();
+		}
 
 		if ( json.name !== undefined ) material.name = json.name;
 		if ( json.color !== undefined ) material.color.setHex( json.color );