2
0
Эх сурвалжийг харах

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

JamesHagerman 9 жил өмнө
parent
commit
a67119645f

+ 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 );