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

Merge pull request #16412 from Kalacione/patch-1

GLTFLoader - store original node name
Mr.doob 6 жил өмнө
parent
commit
5e0bccd615

+ 2 - 1
examples/js/loaders/GLTFLoader.js

@@ -1299,7 +1299,7 @@ THREE.GLTFLoader = ( function () {
 
 			if ( typeof gltfDef.extras === 'object' ) {
 
-				object.userData = gltfDef.extras;
+				Object.assign( object.userData, gltfDef.extras );
 
 			} else {
 
@@ -2996,6 +2996,7 @@ THREE.GLTFLoader = ( function () {
 
 			if ( nodeDef.name !== undefined ) {
 
+				node.userData.name = nodeDef.name;
 				node.name = THREE.PropertyBinding.sanitizeNodeName( nodeDef.name );
 
 			}