diff options
author | Lyuma <xn.lyuma@gmail.com> | 2023-02-23 11:07:48 +0100 |
---|---|---|
committer | Lyuma <xn.lyuma@gmail.com> | 2023-02-23 11:55:28 +0100 |
commit | 51a4fe1d530be9894e56db20a271773eb63053b2 (patch) | |
tree | af8a41fcaca9de7ad488761e5b911bc67e320144 /editor/import/resource_importer_scene.cpp | |
parent | 19c9fd6926b958016d562e3b2e93b0e9480300f5 (diff) |
import: Fix uv2 by avoiding premature ImporterMesh::get_mesh()
Implements create_convex_shape in ImpoterMesh.
Note: ImporterMeshInstance3D::get_mesh() is safe.
The only dangerous function with side effects is ImpoterMesh::get_mesh()
Diffstat (limited to 'editor/import/resource_importer_scene.cpp')
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 32c16255dd..f24759ace6 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -353,13 +353,12 @@ static String _fixstr(const String &p_what, const String &p_str) { static void _pre_gen_shape_list(Ref<ImporterMesh> &mesh, Vector<Ref<Shape3D>> &r_shape_list, bool p_convex) { ERR_FAIL_NULL_MSG(mesh, "Cannot generate shape list with null mesh value"); - ERR_FAIL_NULL_MSG(mesh->get_mesh(), "Cannot generate shape list with null mesh value"); if (!p_convex) { Ref<ConcavePolygonShape3D> shape = mesh->create_trimesh_shape(); r_shape_list.push_back(shape); } else { Vector<Ref<Shape3D>> cd; - cd.push_back(mesh->get_mesh()->create_convex_shape(true, /*Passing false, otherwise VHACD will be used to simplify (Decompose) the Mesh.*/ false)); + cd.push_back(mesh->create_convex_shape(true, /*Passing false, otherwise VHACD will be used to simplify (Decompose) the Mesh.*/ false)); if (cd.size()) { for (int i = 0; i < cd.size(); i++) { r_shape_list.push_back(cd[i]); @@ -1230,7 +1229,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, HashMap< shapes = collision_map[m]; } else { shapes = get_collision_shapes( - m->get_mesh(), + m, node_settings, p_applied_root_scale); } |