浏览代码

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

asheraryam 7 年之前
父节点
当前提交
79ca8e7305
共有 1 个文件被更改,包括 1 次插入1 次删除
  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) {
 			MeshInstance *mesh_instance = memnew(MeshInstance);
 			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;
 		} else {
 			if (!scene.is_valid()) { // invalid scene