浏览代码

Merge pull request #14465 from Splizard/duplicate_node_id_warning

Add a warning for and ignore duplicate node IDs.
Mr.doob 7 年之前
父节点
当前提交
13fdb96a2b
共有 1 个文件被更改,包括 9 次插入1 次删除
  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;