diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-12-10 00:13:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-10 00:13:01 +0100 |
commit | 58e8da57de06aa0e44ea2bc11a061cc0d1029c43 (patch) | |
tree | 86288a215c742b3ce3fb0906a54ed96286431388 /editor/import | |
parent | 4fd26d89c1ea3c5221bf3040a505eecd45f4bf61 (diff) | |
parent | 74b68d2e710d8f3aeafdf8fc788b7f008d10e404 (diff) |
Merge pull request #14479 from Web-eWorks/gltf-fixes
Fix importing GLTF meshes as external files.
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index e801f3e7c3..00eb69a568 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -1597,8 +1597,11 @@ void EditorSceneImporterGLTF::_generate_node(GLTFState &state, int p_node, Node if (n->mesh >= 0) { ERR_FAIL_INDEX(n->mesh, state.meshes.size()); MeshInstance *mi = memnew(MeshInstance); - const GLTFMesh &mesh = state.meshes[n->mesh]; + GLTFMesh &mesh = state.meshes[n->mesh]; mi->set_mesh(mesh.mesh); + if (mesh.mesh->get_name() == "") { + mesh.mesh->set_name(n->name); + } for (int i = 0; i < mesh.blend_weights.size(); i++) { mi->set("blend_shapes/" + mesh.mesh->get_blend_shape_name(i), mesh.blend_weights[i]); } |