[Bf-blender-cvs] [6e58f6b3045] soc-2021-porting-modifiers-to-nodes_all: Merge branch 'soc-2021-porting-modifiers-to-nodes-remesh-blocks' into soc-2021-porting-modifiers-to-nodes
Fabian Schempp
noreply at git.blender.org
Thu Aug 19 22:07:12 CEST 2021
Commit: 6e58f6b30451725d7a28623f48c93c2a15eec166
Author: Fabian Schempp
Date: Tue Aug 17 22:39:49 2021 +0200
Branches: soc-2021-porting-modifiers-to-nodes_all
https://developer.blender.org/rB6e58f6b30451725d7a28623f48c93c2a15eec166
Merge branch 'soc-2021-porting-modifiers-to-nodes-remesh-blocks' into soc-2021-porting-modifiers-to-nodes
# Conflicts:
# release/scripts/startup/nodeitems_builtins.py
# source/blender/blenkernel/BKE_node.h
# source/blender/geometry/CMakeLists.txt
# source/blender/makesrna/intern/rna_nodetree.c
===================================================================
===================================================================
diff --cc release/scripts/startup/nodeitems_builtins.py
index 05681087d57,b63fc0030a4..8c3ac752c14
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@@ -554,11 -553,7 +554,12 @@@ geometry_node_categories =
NodeItem("GeometryNodeEdgeSplit"),
NodeItem("GeometryNodeSubdivisionSurface"),
NodeItem("GeometryNodeMeshSubdivide"),
+ NodeItem("GeometryNodeRemeshBlocks"),
+ NodeItem("GeometryNodeMeshExtrude"),
+ NodeItem("GeometryNodeMeshInset"),
+ NodeItem("GeometryNodeCollapse"),
+ NodeItem("GeometryNodeUnsubdivide"),
+ NodeItem("GeometryNodeDissolve"),
]),
GeometryNodeCategory("GEO_PRIMITIVES_MESH", "Mesh Primitives", items=[
NodeItem("GeometryNodeMeshCircle"),
diff --cc source/blender/blenkernel/BKE_node.h
index 81257a8196c,ffcb3390c55..7c5853ab566
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@@ -1477,13 -1477,8 +1477,14 @@@ int ntreeTexExecTree(struct bNodeTree *
#define GEO_NODE_CURVE_SET_HANDLES 1072
#define GEO_NODE_CURVE_SPLINE_TYPE 1073
#define GEO_NODE_CURVE_SELECT_HANDLES 1074
- #define GEO_NODE_MERGE_BY_DISTANCE 1075
+ #define GEO_NODE_REMESH_BLOCKS 1075
-
++#define GEO_NODE_MERGE_BY_DISTANCE 1076
+#define GEO_NODE_MESH_EXTRUDE 1076
+#define GEO_NODE_MESH_INSET 1077
+#define GEO_NODE_CURVE_SELECT_HANDLES 1078
+#define GEO_NODE_COLLAPSE 1079
+#define GEO_NODE_UNSUBDIVIDE 1080
+#define GEO_NODE_DISSOLVE 1081
/** \} */
/* -------------------------------------------------------------------- */
diff --cc source/blender/blenkernel/intern/node.cc
index 44ed5d00bea,d0053b61462..c3c22a2fa28
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@@ -5191,9 -5187,9 +5191,10 @@@ static void registerGeometryNodes(
register_node_type_geo_separate_components();
register_node_type_geo_subdivision_surface();
register_node_type_geo_switch();
+ register_node_type_geo_remesh_blocks();
register_node_type_geo_transform();
register_node_type_geo_triangulate();
+ register_node_type_geo_unsubdivide();
register_node_type_geo_viewer();
register_node_type_geo_volume_to_mesh();
}
diff --cc source/blender/geometry/CMakeLists.txt
index df63a0ae081,d5a67b9c6ab..02f62ae05dc
--- a/source/blender/geometry/CMakeLists.txt
+++ b/source/blender/geometry/CMakeLists.txt
@@@ -1,47 -1,46 +1,59 @@@
-# ***** 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.
-# ***** END GPL LICENSE BLOCK *****
+ # ***** 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(INC
+ .
+ ../blenfont
+ ../blenkernel
+ ../blenlib
+ ../blentranslation
+ ../functions
+ ../makesdna
+ ../makesrna
+ ../../../intern/guardedalloc
+ ../makesdna/intern
+ ${CMAKE_BINARY_DIR}/source/blender/makesdna/intern
+ )
-set(SRC
- intern/remesh_blocks.c
- GEO_mesh_remesh_blocks.h
-)
+ set(SRC
++ intern/remesh_blocks.c
++ GEO_mesh_remesh_blocks.h
+ intern/mesh_merge_by_distance.c
+ intern/pointcloud_merge_by_distance.cc
+ GEO_mesh_merge_by_distance.h
+ GEO_pointcloud_merge_by_distance.h
+ )
-set(LIB
- bf_blenkernel
- bf_blenlib
-)
+ 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()
++ 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}")
+ blender_add_lib(bf_geometry "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --cc source/blender/makesrna/intern/rna_nodetree.c
index 34fd7184d96,3d5daf3e2d7..affabe7f6e1
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@@ -9093,28 -9093,28 +9093,48 @@@ static void def_geo_triangulate(StructR
RNA_def_property_enum_default(prop, GEO_NODE_TRIANGULATE_NGON_BEAUTY);
RNA_def_property_ui_text(prop, "N-gon Method", "Method for splitting the n-gons into triangles");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+ }
+
+ static void def_geo_remesh_blocks(StructRNA *srna)
+ {
+ static const EnumPropertyItem remesh_mode_items[] = {
+ {0, "BLOCKS", 0, "Blocks", "Output a blocky surface with no smoothing"},
+ {1, "SMOOTH", 0, "Smooth", "Output a smooth surface with no sharp-features detection"},
+ {2,
+ "SHARP",
+ 0,
+ "Sharp",
+ "Output a surface that reproduces sharp edges and corners from the input mesh"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ PropertyRNA *prop = RNA_def_property(srna, "remesh_blocks_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "custom1");
+ RNA_def_property_enum_items(prop, remesh_mode_items);
+ RNA_def_property_ui_text(prop, "Mode", "Mesh smoothing mode for remesh operation");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
}
+static void def_geo_subdivision_surface(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ RNA_def_struct_sdna_from(srna, "NodeGeometrySubdivisionSurface", "storage");
+ prop = RNA_def_property(srna, "uv_smooth", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "uv_smooth");
+ RNA_def_property_enum_items(prop, rna_enum_subdivision_uv_smooth_items);
+ RNA_def_property_enum_default(prop, SUBSURF_UV_SMOOTH_PRESERVE_BOUNDARIES);
+ RNA_def_property_ui_text(prop, "UV Smooth", "Controls how smoothing is applied to UVs");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "boundary_smooth", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "boundary_smooth");
+ RNA_def_property_enum_items(prop, rna_enum_subdivision_boundary_smooth_items);
+ RNA_def_property_enum_default(prop, SUBSURF_BOUNDARY_SMOOTH_ALL);
+ RNA_def_property_ui_text(prop, "Boundary Smooth", "Controls how open boundaries are smoothed");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+}
+
static void def_geo_attribute_randomize(StructRNA *srna)
{
PropertyRNA *prop;
diff --cc source/blender/nodes/CMakeLists.txt
index dc5fa8dcba0,fcda05846d7..175c9744b2e
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@@ -217,9 -213,9 +217,10 @@@ set(SR
geometry/nodes/node_geo_separate_components.cc
geometry/nodes/node_geo_subdivision_surface.cc
geometry/nodes/node_geo_switch.cc
+ geometry/nodes/node_geo_remesh_blocks.cc
geometry/nodes/node_geo_transform.cc
geometry/nodes/node_geo_triangulate.cc
+ geometry/nodes/node_geo_unsubdivide.cc
geometry/nodes/node_geo_viewer.cc
geometry/nodes/node_geo_volume_to_mesh.cc
geometry/node_geometry_exec.cc
diff --cc source/blender/nodes/NOD_static_types.h
index 08a5246eb17,42c964b3a10..de2fb692d7e
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@@ -338,14 -335,13 +338,15 @@@ DefNode(GeometryNode, GEO_NODE_POINT_SE
DefNode(GeometryNode, GEO_NODE_POINT_TRANSLATE, def_geo_point_translate, "POINT_TRANSLATE", PointTranslate, "Point Translate", "")
DefNode(GeometryNode, GEO_NODE_POINTS_TO_VOLUME, def_geo_points_to_volume, "POINTS_TO_VOLUME", PointsToVolume, "Points to Volume", "")
DefNode(GeometryNode, GEO_NODE_RAYCAST, def_geo_raycast, "RAYCAST", Raycast, "Raycast", "")
+DefNode(GeometryNode, GEO_NODE_MERGE_BY_DISTANCE, def_geo_merge_by_distance, "MERGE_BY_DISTANCE", MergeByDistance, "Merge by Distance", "")
DefNode(GeometryNode, GEO_NODE_SELECT_BY_MATERIAL, 0, "SELECT_BY_MATERIAL", SelectByMaterial, "Select by Material", "")
DefNode(GeometryNode, GEO_NODE_SEPARATE_COMPONENTS, 0, "SEPARATE_COMPONENTS", SeparateComponents, "Separate Components", "")
-DefNode(GeometryNode, GEO_NODE_SUBDIVISION_SURFACE, 0, "SUBDIVISION_SURFACE", SubdivisionSurface, "Subdivision Surface", "")
+DefNode(GeometryNode, GEO_NODE_SUBDIVISION_SURFACE, def_geo_subdivision_surface, "SUBDIVISION_SURFACE", SubdivisionSurface, "Subdivision Surface", "")
DefNode(GeometryNode, GEO_NODE_SWITCH, def_ge
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list