diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-23 13:55:43 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-23 13:55:43 +0100 |
commit | 13382a88dfab32f3ce56560756926df3349e3422 (patch) | |
tree | 66df0ba7926a07b7a85c4fdc1a89c0b56c9bbd8e /editor/import/resource_importer_scene.h | |
parent | 09c8957f9d445a02ee167c41594ee41e48b8c60f (diff) | |
parent | 51a4fe1d530be9894e56db20a271773eb63053b2 (diff) |
Merge pull request #73814 from lyuma/importer_mesh_convex
import: Fix uv2 by avoiding premature ImporterMesh::get_mesh()
Diffstat (limited to 'editor/import/resource_importer_scene.h')
-rw-r--r-- | editor/import/resource_importer_scene.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index 24d2569420..520ccd1070 100644 --- a/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -39,6 +39,7 @@ #include "scene/resources/box_shape_3d.h" #include "scene/resources/capsule_shape_3d.h" #include "scene/resources/cylinder_shape_3d.h" +#include "scene/resources/importer_mesh.h" #include "scene/resources/mesh.h" #include "scene/resources/shape_3d.h" #include "scene/resources/sphere_shape_3d.h" @@ -298,7 +299,7 @@ public: ResourceImporterScene(bool p_animation_import = false); template <class M> - static Vector<Ref<Shape3D>> get_collision_shapes(const Ref<Mesh> &p_mesh, const M &p_options, float p_applied_root_scale); + static Vector<Ref<Shape3D>> get_collision_shapes(const Ref<ImporterMesh> &p_mesh, const M &p_options, float p_applied_root_scale); template <class M> static Transform3D get_collision_shapes_transform(const M &p_options); @@ -314,7 +315,8 @@ public: }; template <class M> -Vector<Ref<Shape3D>> ResourceImporterScene::get_collision_shapes(const Ref<Mesh> &p_mesh, const M &p_options, float p_applied_root_scale) { +Vector<Ref<Shape3D>> ResourceImporterScene::get_collision_shapes(const Ref<ImporterMesh> &p_mesh, const M &p_options, float p_applied_root_scale) { + ERR_FAIL_COND_V(p_mesh.is_null(), Vector<Ref<Shape3D>>()); ShapeType generate_shape_type = SHAPE_TYPE_DECOMPOSE_CONVEX; if (p_options.has(SNAME("physics/shape_type"))) { generate_shape_type = (ShapeType)p_options[SNAME("physics/shape_type")].operator int(); |