Explorar el Código

Merge pull request #3481 from vanRepin/master

fix node names in serializer
David Catuhe hace 7 años
padre
commit
a5c06e2a81
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      serializers/src/glTF/2.0/babylon.glTFSerializer.ts

+ 4 - 0
serializers/src/glTF/2.0/babylon.glTFSerializer.ts

@@ -10,6 +10,7 @@ module BABYLON {
     }
     interface OGLTFNode {
         mesh: number;
+        name?: string;
         translation?: number[];
         scale?: number[];
         rotation?: number[];
@@ -623,6 +624,9 @@ module BABYLON {
                     }
                     gltf.meshes.push(mesh);
                     node.mesh = gltf.meshes.length - 1;
+                    if (babylonMesh.name) {
+                      node.name = babylonMesh.name;
+                    }
                     gltf.nodes.push(node);
 
                     scene.nodes.push(gltf.nodes.length - 1);