godot/editor/import
Andrea Catania 21a13649be
Fix Static & Rigid body generation on mesh import.
The function `_gen_shape_list` is using the resource `Res<Mesh>`, but during the import phase the resource used is instead `Ref<EditorSceneImporterMesh>`.

Note: the `Ref<EditorSceneImporterMesh>` is an intermediate resource, that will be used to create a `Res<Mesh>` at the end of the import process. `Ref<EditorSceneImporterMesh>` and `Ref<Mesh>` are not inheriting each other, so the internal cast done by `Ref<>` during the assignment, is always null:

```c++
Ref<EditorSceneImporterMesh> import_mesh(/* Assume it's initialized */);
CRASH_NOW(import_mesh.is_null());

Ref<Mesh> mesh = import_mesh;
CRASH_NOW(mesh.is_null()); // <--- Here we have a crash, since it's impossible perform the above cast, and the `mesh` is always null.
```

Here the full list of call to `_gen_shape_list`, where we can notice that a `Ref<EditorSceneImporterMesh>` is passed:
- https://github.com/AndreaCatania/godot/blob/master/editor/import/resource_importer_scene.cpp#L428
- https://github.com/AndreaCatania/godot/blob/master/editor/import/resource_importer_scene.cpp#L454-L458
- https://github.com/AndreaCatania/godot/blob/master/editor/import/resource_importer_scene.cpp#L512-L516

As you can notice, we always pass the following mesh: `Ref<EditorSceneImporterMesh> mesh = mi->get_mesh();`.

We already have the function `_pre_gen_shape_list` that executes the exact same job but using the correct type; Since there is no further usage of the function `_gen_shape_list` in the code base, I think it's just some leftover code, so I removed it entirely to use the proper function.
2021-07-24 08:39:18 +02:00
..
atlas_import_failed.xpm
collada.cpp Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
collada.h Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
editor_import_collada.cpp Merge pull request #49754 from aaronfranke/is-eq-approx-sub-opt 2021-06-20 11:44:56 +02:00
editor_import_collada.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
editor_import_plugin.cpp Consistently prefix bound virtual methods with _ 2021-06-12 00:55:52 +02:00
editor_import_plugin.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
resource_importer_bitmask.cpp Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
resource_importer_bitmask.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
resource_importer_csv_translation.cpp Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
resource_importer_csv_translation.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
resource_importer_image.cpp Core: Move DirAccess and FileAccess to core/io 2021-06-11 14:52:39 +02:00
resource_importer_image.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
resource_importer_layered_texture.cpp Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
resource_importer_layered_texture.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
resource_importer_obj.cpp Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
resource_importer_obj.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
resource_importer_scene.cpp Fix Static & Rigid body generation on mesh import. 2021-07-24 08:39:18 +02:00
resource_importer_scene.h Rename Reference to RefCounted 2021-06-11 18:48:42 +02:00
resource_importer_shader_file.cpp Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
resource_importer_shader_file.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
resource_importer_texture.cpp Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
resource_importer_texture.h Core: Move DirAccess and FileAccess to core/io 2021-06-11 14:52:39 +02:00
resource_importer_texture_atlas.cpp Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
resource_importer_texture_atlas.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
resource_importer_wav.cpp Fix editor suffixes and degrees conversion 2021-06-30 12:38:25 -03:00
resource_importer_wav.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
scene_import_settings.cpp Optimize StringName usage 2021-07-18 21:20:02 -03:00
scene_import_settings.h Improved 3D Scene Importer 2021-03-22 12:16:40 -03:00
scene_importer_mesh.cpp Options to clean/simplify convex hull generated from mesh 2021-07-07 12:14:12 -07:00
scene_importer_mesh.h Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
scene_importer_mesh_node_3d.cpp Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
scene_importer_mesh_node_3d.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
SCsub SCons: Format buildsystem files with psf/black 2020-03-30 09:05:53 +02:00