Explorar o código

Use filename as fallback instead of the class name for mesh instance loaded by dragging from file to editor.

asheraryam %!s(int64=7) %!d(string=hai) anos
pai
achega
79ca8e7305
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      editor/plugins/spatial_editor_plugin.cpp

+ 1 - 1
editor/plugins/spatial_editor_plugin.cpp

@@ -3238,7 +3238,7 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P
 		if (mesh != NULL) {
 		if (mesh != NULL) {
 			MeshInstance *mesh_instance = memnew(MeshInstance);
 			MeshInstance *mesh_instance = memnew(MeshInstance);
 			mesh_instance->set_mesh(mesh);
 			mesh_instance->set_mesh(mesh);
-			mesh_instance->set_name(mesh->get_name());
+			mesh_instance->set_name(path.get_file().get_basename());
 			instanced_scene = mesh_instance;
 			instanced_scene = mesh_instance;
 		} else {
 		} else {
 			if (!scene.is_valid()) { // invalid scene
 			if (!scene.is_valid()) { // invalid scene