Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksi Juvani <aleksijuvani>2022-04-07 01:30:56 +0300
committerHans Goudey <h.goudey@me.com>2022-04-07 01:30:56 +0300
commit81ec3dce6542f996e5d61017fab83bd721b61822 (patch)
treed6434658da8830faee00e4614aaa832704975d48 /source/blender/makesrna/intern/rna_nodetree.c
parent181d577d7d97990bf1094710a09c377bad24a8eb (diff)
Geometry Nodes: Add "Connected" mode to Merge by Distance node
Expose the "Connected" mode from the weld modifier in the "Merge by Distance" geometry node. This method only merges vertices along existing edges, but it can be much faster because it doesn't have to build a KD Tree of all selected points. Differential Revision: https://developer.blender.org/D14321
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index cbac6aefc10..31b2d36dcfd 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -9846,6 +9846,32 @@ static void def_geo_mesh_cone(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
+static void def_geo_merge_by_distance(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ static EnumPropertyItem mode_items[] = {
+ {GEO_NODE_MERGE_BY_DISTANCE_MODE_ALL,
+ "ALL",
+ 0,
+ "All",
+ "Merge all close selected points, whether or not they are connected"},
+ {GEO_NODE_MERGE_BY_DISTANCE_MODE_CONNECTED,
+ "CONNECTED",
+ 0,
+ "Connected",
+ "Only merge mesh vertices along existing edges. This method can be much faster"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ RNA_def_struct_sdna_from(srna, "NodeGeometryMergeByDistance", "storage");
+
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, mode_items);
+ RNA_def_property_ui_text(prop, "Mode", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+}
+
static void def_geo_mesh_line(StructRNA *srna)
{
PropertyRNA *prop;