From 790e9d9fa084c30609a13d175c56a4f3c14f132e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 3 Jun 2013 05:07:16 +0000 Subject: fix [#35311] Planar Decimate / Limited Dissolve fails to merge some adjacent faces optionally limit by face flipping, also added support to delimit by material and edge crease. --- source/blender/makesrna/intern/rna_mesh.c | 10 +++++++++- source/blender/makesrna/intern/rna_modifier.c | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 9c1b9a9630b..7e54f665214 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -42,6 +42,8 @@ #include "BLI_math_rotation.h" #include "BLI_utildefines.h" +#include "BKE_editmesh.h" + #include "RNA_access.h" #include "RNA_define.h" #include "RNA_types.h" @@ -50,6 +52,13 @@ #include "WM_types.h" +EnumPropertyItem mesh_delimit_mode_items[] = { + {BMO_DELIM_NORMAL, "NORMAL", 0, "Normal", "Delimit by face directions"}, + {BMO_DELIM_MATERIAL, "MATERIAL", 0, "Material", "Delimit by face material"}, + {BMO_DELIM_SEAM, "SEAM", 0, "Seam", "Delimit by edge seams"}, + {0, NULL, 0, NULL, NULL}, +}; + #ifdef RNA_RUNTIME #include "DNA_scene_types.h" @@ -60,7 +69,6 @@ #include "BKE_depsgraph.h" #include "BKE_main.h" #include "BKE_mesh.h" -#include "BKE_editmesh.h" #include "BKE_report.h" #include "ED_mesh.h" /* XXX Bad level call */ diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 3cf1e0c3b20..0b7d6823b8f 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1216,6 +1216,13 @@ static void rna_def_modifier_decimate(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_DECIM_FLAG_ALL_BOUNDARY_VERTS); RNA_def_property_ui_text(prop, "All Boundaries", "Dissolve all vertices inbetween face boundaries (planar only)"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop = RNA_def_property(srna, "delimit", PROP_ENUM, PROP_NONE); + RNA_def_property_flag(prop, PROP_ENUM_FLAG); /* important to run before default set */ + RNA_def_property_enum_items(prop, mesh_delimit_mode_items); + RNA_def_property_ui_text(prop, "Delimit", "Limit merging geometry"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + /* end dissolve-only option */ -- cgit v1.2.3