Browse Source

Merge pull request #14465 from Splizard/duplicate_node_id_warning

Add a warning for and ignore duplicate node IDs.
Mr.doob 7 years ago
parent
commit
13fdb96a2b
1 changed files with 9 additions and 1 deletions
  1. 9 1
      examples/js/loaders/ColladaLoader.js

+ 9 - 1
examples/js/loaders/ColladaLoader.js

@@ -3183,7 +3183,15 @@ THREE.ColladaLoader.prototype = {
 
 			}
 
-			library.nodes[ data.id ] = data;
+			if ( hasNode( data.id ) ) {
+
+				console.warn( 'THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.', data.id );
+
+			} else {
+
+				library.nodes[ data.id ] = data;
+
+			}
 
 			return data;