[Bf-blender-cvs] [c674adb6f40] soc-2021-porting-modifiers-to-nodes_all: SOC2021 Porting Modifiers To nodes all

Fabian Schempp noreply at git.blender.org
Thu Aug 19 22:07:13 CEST 2021


Commit: c674adb6f40ec98722a4d39e3973184980ccd524
Author: Fabian Schempp
Date:   Thu Aug 19 07:22:53 2021 +0200
Branches: soc-2021-porting-modifiers-to-nodes_all
https://developer.blender.org/rBc674adb6f40ec98722a4d39e3973184980ccd524

SOC2021 Porting Modifiers To nodes all

This branch merges all branches from soc2021 porting modifiers to nodes
into one. The branche is mainly used to make a testbuild.

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

M	source/blender/blenkernel/BKE_node.h
M	source/blender/bmesh/intern/bmesh_mesh.c
M	source/blender/bmesh/intern/bmesh_mesh.h
M	source/blender/makesrna/RNA_enum_types.h
M	source/blender/nodes/CMakeLists.txt
A	source/blender/nodes/geometry/nodes/node_geo_mesh_inset.cc

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

diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 8e598a34c85..ae46f4759f4 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1483,10 +1483,9 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
 #define GEO_NODE_MERGE_BY_DISTANCE 1078
 #define GEO_NODE_MESH_EXTRUDE 1079
 #define GEO_NODE_MESH_INSET 1080
-#define GEO_NODE_CURVE_SELECT_HANDLES 1081
-#define GEO_NODE_COLLAPSE 1082
-#define GEO_NODE_UNSUBDIVIDE 1083
-#define GEO_NODE_DISSOLVE 1084
+#define GEO_NODE_COLLAPSE 1081
+#define GEO_NODE_UNSUBDIVIDE 1082
+#define GEO_NODE_DISSOLVE 1083
 /** \} */
 
 /* -------------------------------------------------------------------- */
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index 6d9e5c1a9cf..1b420cea417 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -1447,8 +1447,8 @@ void BM_mesh_vert_coords_apply_with_mat4(BMesh *bm,
 }
 
 /**
-* Use to select  bmesh vertex data based on an array of bool.
-*/
+ * Use to select bmesh vertex data based on an array of bool.
+ */
 void BM_select_vertices(BMesh *bm, const bool *mask)
 {
   BMIter iter;
@@ -1485,155 +1485,164 @@ void BM_select_faces(BMesh *bm, const bool *mask)
   }
 }
 
-void BM_get_selected_vertices(BMesh *bm, bool *selection)
+/**
+ * Use to temporary tag bmesh edge data based on an array of bool.
+ */
+void BM_tag_vertices(BMesh *bm, const bool *mask)
 {
   BMIter iter;
-  BMVert *v;
+  BMEdge *e;
   int i;
-  BM_ITER_MESH_INDEX (v, &iter, bm, BM_VERTS_OF_MESH, i) {
-    selection[i] = BM_elem_flag_test(v, BM_ELEM_SELECT);
+  BM_ITER_MESH_INDEX (e, &iter, bm, BM_EDGES_OF_MESH, i) {
+    BM_elem_flag_set(e, BM_ELEM_TAG, mask[i]);
   }
 }
 
-void BM_get_tagged_faces(BMesh *bm, bool *selection)
+/**
+ * Use to temporary tag bmesh edge data based on an array of bool.
+ */
+void BM_tag_edges(BMesh *bm, const bool *mask)
 {
   BMIter iter;
-  BMFace *f;
+  BMEdge *e;
   int i;
-  BM_ITER_MESH_INDEX (f, &iter, bm, BM_FACES_OF_MESH, i) {
-    selection[i] = BM_elem_flag_test(f, BM_ELEM_TAG);
+  BM_ITER_MESH_INDEX (e, &iter, bm, BM_EDGES_OF_MESH, i) {
+    BM_elem_flag_set(e, BM_ELEM_TAG, mask[i]);
   }
 }
 
-void BM_tag_new_faces(BMesh *bm, BMOperator *b_mesh_operator)
+/**
+ * Use to temporary tag bmesh face data based on an array of bool.
+ */
+void BM_tag_faces(BMesh *bm, const bool *mask)
 {
   BMIter iter;
   BMFace *f;
-  BM_mesh_elem_hflag_disable_all(bm, BM_FACE, BM_ELEM_TAG, false);
-  BMO_ITER (f, &iter, b_mesh_operator->slots_out, "faces.out", BM_FACE) {
-    BM_elem_flag_enable(f, BM_ELEM_TAG);
+  int i;
+  BM_ITER_MESH_INDEX (f, &iter, bm, BM_FACES_OF_MESH, i) {
+    BM_elem_flag_set(f, BM_ELEM_TAG, mask[i]);
   }
 }
 
-void BM_tag_vertices(BMesh *bm, const bool *mask)
+/**
+ * Write selected bmesh vertex to array of bool with length of totvert.
+ */
+void BM_get_selected_vertices(BMesh *bm, bool *selection)
 {
   BMIter iter;
   BMVert *v;
   int i;
   BM_ITER_MESH_INDEX (v, &iter, bm, BM_VERTS_OF_MESH, i) {
-    BM_elem_flag_set(v, BM_ELEM_TAG, mask[i]);
+    selection[i] = BM_elem_flag_test(v, BM_ELEM_SELECT);
   }
 }
 
 /**
- * Use to temporary tag bmesh edge data based on an array of bool.
+ * Write selected bmesh edge to array of bool with length of totedge.
  */
-void BM_tag_edges(BMesh *bm, const bool *mask)
+void BM_get_selected_edges(BMesh *bm, bool *selection)
 {
   BMIter iter;
   BMEdge *e;
   int i;
   BM_ITER_MESH_INDEX (e, &iter, bm, BM_EDGES_OF_MESH, i) {
-    BM_elem_flag_set(e, BM_ELEM_TAG, mask[i]);
+    selection[i] = BM_elem_flag_test(e, BM_ELEM_SELECT);
   }
 }
 
 /**
- * Use to temporary tag bmesh face data based on an array of bool.
+ * Write selected bmesh face to array of bool with length of totpoly.
  */
-void BM_tag_faces(BMesh *bm, const bool *mask)
+void BM_get_selected_faces(BMesh *bm, bool *selection)
 {
   BMIter iter;
   BMFace *f;
   int i;
   BM_ITER_MESH_INDEX (f, &iter, bm, BM_FACES_OF_MESH, i) {
-    BM_elem_flag_set(f, BM_ELEM_TAG, mask[i]);
+    selection[i] = BM_elem_flag_test(f, BM_ELEM_SELECT);
   }
 }
 
-void BM_untag_faces_by_tag(BMesh *bm, int tag)
-{
-  BMIter iter;
-  BMFace *f;
-  int i;
-  BM_ITER_MESH_INDEX (f, &iter, bm, BM_FACES_OF_MESH, i) {
-    if (BM_elem_flag_test(f, tag)) {
-      BM_elem_flag_disable(f, BM_ELEM_TAG);
-    }
-  }
-}
 /**
- * Use to select  bmesh vertex data based on an array of bool.
+ * Write tagged bmesh vertex to array of bool with length of totvert.
  */
-void BM_select_vertices(BMesh *bm, const bool *mask)
+void BM_get_tagged_vertices(BMesh *bm, bool *selection)
 {
   BMIter iter;
   BMVert *v;
   int i;
   BM_ITER_MESH_INDEX (v, &iter, bm, BM_VERTS_OF_MESH, i) {
-    BM_elem_flag_set(v, BM_ELEM_SELECT, mask[i]);
+    selection[i] = BM_elem_flag_test(v, BM_ELEM_TAG);
   }
 }
 
 /**
- * Use to select bmesh edge data based on an array of bool.
+ * Write tagged bmesh edge to array of bool with length of totedge.
  */
-void BM_select_edges(BMesh *bm, const bool *mask)
+void BM_get_tagged_edges(BMesh *bm, bool *selection)
 {
   BMIter iter;
   BMEdge *e;
   int i;
   BM_ITER_MESH_INDEX (e, &iter, bm, BM_EDGES_OF_MESH, i) {
-    BM_elem_flag_set(e, BM_ELEM_SELECT, mask[i]);
+    selection[i] = BM_elem_flag_test(e, BM_ELEM_TAG);
   }
 }
 
 /**
- * Use to select bmesh face data based on an array of bool.
+ * Write tagged bmesh faces to array of bool with length of totpoly.
  */
-void BM_select_faces(BMesh *bm, const bool *mask)
+void BM_get_tagged_faces(BMesh *bm, bool *selection)
 {
   BMIter iter;
   BMFace *f;
   int i;
   BM_ITER_MESH_INDEX (f, &iter, bm, BM_FACES_OF_MESH, i) {
-    BM_elem_flag_set(f, BM_ELEM_SELECT, mask[i]);
+    selection[i] = BM_elem_flag_test(f, BM_ELEM_TAG);
   }
 }
 
-void BM_tag_vertices(BMesh *bm, const bool *mask)
+/**
+ * Use to remove tag from all bmesh verts that are tagged with another tag.
+ */
+void BM_untag_vertices_by_tag(BMesh *bm, int tag)
 {
   BMIter iter;
   BMVert *v;
   int i;
   BM_ITER_MESH_INDEX (v, &iter, bm, BM_VERTS_OF_MESH, i) {
-    BM_elem_flag_set(v, BM_ELEM_TAG, mask[i]);
+    if (BM_elem_flag_test(v, tag)) {
+      BM_elem_flag_disable(v, BM_ELEM_TAG);
+    }
   }
 }
 
 /**
- * Use to temporary tag bmesh edge data based on an array of bool.
+ * Use to remove tag from all bmesh edges that are tagged with another tag.
  */
-void BM_tag_edges(BMesh *bm, const bool *mask)
+void BM_untag_edges_by_tag(BMesh *bm, int tag)
 {
   BMIter iter;
   BMEdge *e;
   int i;
   BM_ITER_MESH_INDEX (e, &iter, bm, BM_EDGES_OF_MESH, i) {
-    BM_elem_flag_set(e, BM_ELEM_TAG, mask[i]);
+    if (BM_elem_flag_test(e, tag)) {
+      BM_elem_flag_disable(e, BM_ELEM_TAG);
+    }
   }
 }
 
 /**
- * Use to temporary tag bmesh face data based on an array of bool.
+ * Use to remove tag from all bmesh faces that are tagged with another tag.
  */
-void BM_tag_faces(BMesh *bm, const bool *mask)
+void BM_untag_faces_by_tag(BMesh *bm, int tag)
 {
   BMIter iter;
   BMFace *f;
   int i;
   BM_ITER_MESH_INDEX (f, &iter, bm, BM_FACES_OF_MESH, i) {
-    BM_elem_flag_set(f, BM_ELEM_TAG, mask[i]);
+    if (BM_elem_flag_test(f, tag)) {
+      BM_elem_flag_disable(f, BM_ELEM_TAG);
+    }
   }
 }
-/** \} */
diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h
index 3d6da9bfc53..1cc9f4a6aca 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.h
+++ b/source/blender/bmesh/intern/bmesh_mesh.h
@@ -138,17 +138,23 @@ void BM_mesh_vert_coords_apply_with_mat4(BMesh *bm,
 void BM_select_vertices(BMesh *bm, const bool *mask);
 void BM_select_edges(BMesh *bm, const bool *mask);
 void BM_select_faces(BMesh *bm, const bool *mask);
-void BM_get_selected_vertices(BMesh *bm, bool *selection);
+
 void BM_tag_vertices(BMesh *bm, const bool *mask);
 void BM_tag_edges(BMesh *bm, const bool *mask);
 void BM_tag_faces(BMesh *bm, const bool *mask);
-void BM_untag_faces_by_tag(BMesh *bm, int tag);
+
+void BM_get_selected_vertices(BMesh *bm, bool *selection);
+void BM_get_selected_edges(BMesh *bm, bool *selection);
+void BM_get_selected_faces(BMesh *bm, bool *selection);
+
+void BM_get_tagged_vertices(BMesh *bm, bool *selection);
+void BM_get_tagged_edges(BMesh *bm, bool *selection);
 void BM_get_tagged_faces(BMesh *bm, bool *selection);
-void BM_tag_new_faces(BMesh *bm, BMOperator *b_mesh_operator);
 
-void BM_select_vertices(BMesh *bm, const bool *mask);
-void BM_select_edges(BMesh *bm, const bool *mask);
-void BM_select_faces(BMesh *bm, const bool *mask);
-void BM_tag_vertices(BMesh *bm, const bool *mask);
-void BM_tag_edges(BMesh *bm, const bool *mask);
-void BM_tag_faces(BMesh *bm, const bool *mask);
\ No newline at end of file
+void BM_untag_vertices_by_tag(BMesh *bm, int tag);
+void BM_untag_edges_by_tag(BMesh *bm, int tag);
+void BM_untag_faces_by_tag(BMesh *bm, int tag);
+
+void BM_tag_new_vertices(BMesh *bm, BMOperator *b_mesh_operator);
+void BM_tag_new_edges(BMesh *bm, BMOperator *b_mesh_operator);
+void BM_tag_new_faces(BMesh *bm, BMOperator *b_mesh_operator);
\ No newline at end of file
diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h
index 19f0aadecd9..c7e7dc84775 100644
--- a/source/blender/makesrna/RNA_enum_types.h
+++ b/source/blender/makesrna/RNA_enum_types.h
@@ -78,6 +78,9 @@ extern const EnumPropertyItem rna_enum_linestyle_alpha_modifier_type_items[];
 extern const EnumPropertyItem rna_enum_linestyle_thickness_modifier_type_items[];
 extern const EnumPropertyItem rna_enum_linestyle_geometry_modifier_type_items[];
 
+extern const EnumPropertyItem nonmanifold_thickness_mode_items[];
+extern const EnumPropertyItem nonmanifold_boundary_mode_items[];
+
 extern const EnumPropertyItem rna_enum_window_cursor_items[];
 
 extern const EnumPropertyItem rna_enum_dt_method_vertex_items[];
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index b8ee7473369..73ff2e6f2e4 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -187,7 +187,7 @@ set(SRC
   geometry/nodes/node_geo_delete_geometry.cc
   geometry/nodes/node_geo_dissolve.cc
   geometry/nodes/node_geo_edge_sp

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list