Browse Source

Merge pull request #7780 from JamesHagerman/dev

Removing uuid assumption from MaterialLoader.parse() but on the dev b…
Mr.doob 9 years ago
parent
commit
5e86137cbc
1 changed files with 5 additions and 1 deletions
  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 );