From c2f8e70aa0076c08e119dbfa75be31f8d2f9a566 Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Fri, 4 Jul 2025 20:43:28 +0200 Subject: [PATCH] Revert "Create more optimized CSGShape3D baked static mesh" This reverts commit 28875459d9a61885be2d3fc7c8513aa14a179ebd. --- modules/csg/csg_shape.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index e655904f2e..ebb7d24bf6 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -36,7 +36,6 @@ #include "core/math/geometry_2d.h" #include "scene/resources/3d/navigation_mesh_source_geometry_data_3d.h" #include "scene/resources/navigation_mesh.h" -#include "scene/resources/surface_tool.h" #ifndef NAVIGATION_3D_DISABLED #include "servers/navigation_server_3d.h" #endif // NAVIGATION_3D_DISABLED @@ -737,19 +736,7 @@ void CSGShape3D::update_shape() { Ref CSGShape3D::bake_static_mesh() { Ref baked_mesh; if (is_root_shape() && root_mesh.is_valid()) { - Ref st; - st.instantiate(); - - int surface_count = root_mesh->get_surface_count(); - for (int i = 0; i < surface_count; i++) { - st->append_from(root_mesh, i, Transform3D()); - } - st->generate_normals(); - st->generate_tangents(); - st->index(); - st->optimize_indices_for_cache(); - - baked_mesh = st->commit(); + baked_mesh = root_mesh; } return baked_mesh; }