[Bf-blender-cvs] [226ae2e69f4] soc-2021-porting-modifiers-to-nodes-remesh-blocks: moved remesh_blocks to geometry module

Fabian Schempp noreply at git.blender.org
Mon Jul 19 00:10:49 CEST 2021


Commit: 226ae2e69f416e56fc153a6416dd0329324b4916
Author: Fabian Schempp
Date:   Mon Jul 19 00:10:22 2021 +0200
Branches: soc-2021-porting-modifiers-to-nodes-remesh-blocks
https://developer.blender.org/rB226ae2e69f416e56fc153a6416dd0329324b4916

moved remesh_blocks to geometry module

===================================================================

M	CMakeLists.txt
M	source/blender/CMakeLists.txt
M	source/blender/blenkernel/CMakeLists.txt
A	source/blender/geometry/CMakeLists.txt
R096	source/blender/blenkernel/BKE_mesh_remesh_blocks.h	source/blender/geometry/GEO_mesh_remesh_blocks.h
R097	source/blender/blenkernel/intern/mesh_remesh_blocks.c	source/blender/geometry/intern/remesh_blocks.c
M	source/blender/modifiers/intern/MOD_remesh.c
M	source/blender/nodes/CMakeLists.txt
M	source/blender/nodes/geometry/nodes/node_geo_remesh_blocks.cc

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fa07ef831d9..afbd09f894e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -265,10 +265,11 @@ if(UNIX AND NOT APPLE)
   option(WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF)
 endif()
 
+# Geometry
+option(WITH_REMESH_DUALCON          "Enable Remesh Algorithm using Dualcon" ON)
 
 # Modifiers
 option(WITH_MOD_FLUID           "Enable Mantaflow Fluid Simulation Framework" ON)
-option(WITH_REMESH_DUALCON          "Enable Remesh Modifier" ON)
 option(WITH_MOD_OCEANSIM        "Enable Ocean Modifier" ON)
 
 # Image format support
diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index 8d18cf0ae9a..c1adb29812d 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -118,6 +118,7 @@ add_subdirectory(blenloader)
 add_subdirectory(depsgraph)
 add_subdirectory(ikplugin)
 add_subdirectory(simulation)
+add_subdirectory(geometry)
 add_subdirectory(gpu)
 add_subdirectory(imbuf)
 add_subdirectory(nodes)
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index d2aae9ed21f..0c7ee43a1b4 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -193,7 +193,6 @@ set(SRC
   intern/mesh_normals.cc
   intern/mesh_remap.c
   intern/mesh_remesh_voxel.c
-  intern/mesh_remesh_blocks.c
   intern/mesh_runtime.c
   intern/mesh_sample.cc
   intern/mesh_tangent.c
@@ -387,7 +386,7 @@ set(SRC
   BKE_mesh_mapping.h
   BKE_mesh_mirror.h
   BKE_mesh_remap.h
-  BKE_mesh_remesh_blocks.h
+        ../geometry/GEO_mesh_remesh_blocks.h
   BKE_mesh_remesh_voxel.h
   BKE_mesh_runtime.h
   BKE_mesh_sample.hh
@@ -489,16 +488,6 @@ set(LIB
   bf_simulation
 )
 
-if(WITH_REMESH_DUALCON)
-  list(APPEND INC
-          ../../../intern/dualcon
-          )
-  list(APPEND LIB
-          bf_intern_dualcon
-          )
-  add_definitions(-DWITH_MOD_REMESH)
-endif()
-
 if(WITH_BINRELOC)
   list(APPEND INC_SYS
     ${BINRELOC_INCLUDE_DIRS}
diff --git a/source/blender/geometry/CMakeLists.txt b/source/blender/geometry/CMakeLists.txt
new file mode 100644
index 00000000000..8437a520bda
--- /dev/null
+++ b/source/blender/geometry/CMakeLists.txt
@@ -0,0 +1,49 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+        .
+        ../blenkernel
+        ../blenlib
+        ../makesdna
+        ../../../intern/guardedalloc
+        )
+
+set(SRC
+        intern/remesh_blocks.c
+        GEO_mesh_remesh_blocks.h
+        )
+
+set(LIB
+        bf_blenkernel
+        bf_blenlib
+        )
+
+if(WITH_REMESH_DUALCON)
+    list(APPEND INC
+            ../../../intern/dualcon
+            )
+    list(APPEND LIB
+            bf_intern_dualcon
+            )
+    add_definitions(-DWITH_REMESH_DUALCON)
+endif()
+
+blender_add_lib(bf_geometry "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/source/blender/blenkernel/BKE_mesh_remesh_blocks.h b/source/blender/geometry/GEO_mesh_remesh_blocks.h
similarity index 96%
rename from source/blender/blenkernel/BKE_mesh_remesh_blocks.h
rename to source/blender/geometry/GEO_mesh_remesh_blocks.h
index 0a81e12aa60..faae4e836ab 100644
--- a/source/blender/blenkernel/BKE_mesh_remesh_blocks.h
+++ b/source/blender/geometry/GEO_mesh_remesh_blocks.h
@@ -38,7 +38,7 @@ typedef enum eRemeshBlocksMode {
   REMESH_BLOCKS_SHARP_FEATURES = 2,
 } eRemeshBlocksMode;
 
-struct Mesh *BKE_mesh_remesh_blocks_to_mesh_nomain(struct Mesh *mesh,
+struct Mesh *GEO_mesh_remesh_blocks_to_mesh_nomain(struct Mesh *mesh,
                                                    const char remesh_flag,
                                                    const char remesh_mode,
                                                    const float threshold,
diff --git a/source/blender/blenkernel/intern/mesh_remesh_blocks.c b/source/blender/geometry/intern/remesh_blocks.c
similarity index 97%
rename from source/blender/blenkernel/intern/mesh_remesh_blocks.c
rename to source/blender/geometry/intern/remesh_blocks.c
index 8390168d6fa..4de4a80f130 100644
--- a/source/blender/blenkernel/intern/mesh_remesh_blocks.c
+++ b/source/blender/geometry/intern/remesh_blocks.c
@@ -22,7 +22,6 @@
  */
 
 #include "BKE_mesh.h"
-#include "BKE_mesh_remesh_blocks.h" /* own include */
 #include "BKE_mesh_runtime.h"
 
 #include "BLI_math_vector.h"
@@ -32,6 +31,8 @@
 #include "DNA_meshdata_types.h"
 #include "DNA_modifier_types.h"
 
+#include "GEO_mesh_remesh_blocks.h" /* own include */
+
 #include "MEM_guardedalloc.h"
 
 #ifdef WITH_REMESH_DUALCON
@@ -111,7 +112,7 @@ static void dualcon_add_quad(void *output_v, const int vert_indices[4])
   output->curface++;
 }
 
-Mesh *BKE_mesh_remesh_blocks_to_mesh_nomain(Mesh *mesh,
+Mesh *GEO_mesh_remesh_blocks_to_mesh_nomain(Mesh *mesh,
                                             const char remesh_flag,
                                             const char remesh_mode,
                                             const float threshold,
diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c
index f918c1f2b82..f99a3c8c406 100644
--- a/source/blender/modifiers/intern/MOD_remesh.c
+++ b/source/blender/modifiers/intern/MOD_remesh.c
@@ -29,9 +29,9 @@
 #include "DNA_object_types.h"
 #include "DNA_screen_types.h"
 
+#include "../../geometry/GEO_mesh_remesh_blocks.h"
 #include "BKE_context.h"
 #include "BKE_mesh.h"
-#include "BKE_mesh_remesh_blocks.h"
 #include "BKE_mesh_remesh_voxel.h"
 #include "BKE_screen.h"
 
@@ -72,7 +72,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *UNUSED(ctx)
     }
   }
   else {
-    result = BKE_mesh_remesh_blocks_to_mesh_nomain(
+    result = GEO_mesh_remesh_blocks_to_mesh_nomain(
         mesh, rmd->flag, rmd->mode, rmd->threshold, rmd->hermite_num, rmd->scale, rmd->depth);
   }
 
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index c6622e6acd7..2d35cc63cae 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -33,6 +33,7 @@ set(INC
   ../bmesh
   ../depsgraph
   ../functions
+  ../geometry
   ../gpu
   ../imbuf
   ../makesdna
@@ -379,6 +380,7 @@ set(SRC
 set(LIB
   bf_bmesh
   bf_functions
+  bf_geometry
   bf_intern_sky
 )
 
diff --git a/source/blender/nodes/geometry/nodes/node_geo_remesh_blocks.cc b/source/blender/nodes/geometry/nodes/node_geo_remesh_blocks.cc
index 9c4eb5e8f14..e1b252665e8 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_remesh_blocks.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_remesh_blocks.cc
@@ -15,14 +15,15 @@
  */
 
 #include "BKE_mesh.h"
-#include "BKE_mesh_remesh_blocks.h"
-
-#include "UI_interface.h"
 
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 #include "DNA_modifier_types.h"
 
+#include "GEO_mesh_remesh_blocks.h"
+
+#include "UI_interface.h"
+
 #include "node_geometry_util.hh"
 
 static bNodeSocketTemplate geo_node_remesh_blocks_in[] = {
@@ -52,7 +53,7 @@ static void geo_node_remesh_blocks_exec(GeoNodeExecParams params)
   if (geometry_set.has_mesh()) {
     Mesh *input_mesh = geometry_set.get_mesh_for_write();
 
-    Mesh *output_mesh = BKE_mesh_remesh_blocks_to_mesh_nomain(
+    Mesh *output_mesh = GEO_mesh_remesh_blocks_to_mesh_nomain(
         input_mesh, flag, mode, threshold, hermite_num, scale, depth);
 
     BKE_mesh_copy_parameters_for_eval(output_mesh, input_mesh);



More information about the Bf-blender-cvs mailing list