Browse Source

Merge pull request #21217 from Mugen87/dev43

VRMLLoader: Apply DEF-name to node names.
Mr.doob 4 years ago
parent
commit
5191deba8d
2 changed files with 12 additions and 0 deletions
  1. 6 0
      examples/js/loaders/VRMLLoader.js
  2. 6 0
      examples/jsm/loaders/VRMLLoader.js

+ 6 - 0
examples/js/loaders/VRMLLoader.js

@@ -723,6 +723,12 @@ THREE.VRMLLoader = ( function () {
 
 
 				}
 				}
 
 
+				if ( build !== undefined && node.DEF !== undefined && build.hasOwnProperty( 'name' ) === true ) {
+
+					build.name = node.DEF;
+
+				}
+
 				return build;
 				return build;
 
 
 			}
 			}

+ 6 - 0
examples/jsm/loaders/VRMLLoader.js

@@ -761,6 +761,12 @@ var VRMLLoader = ( function () {
 
 
 				}
 				}
 
 
+				if ( build !== undefined && node.DEF !== undefined && build.hasOwnProperty( 'name' ) === true ) {
+
+					build.name = node.DEF;
+
+				}
+
 				return build;
 				return build;
 
 
 			}
 			}