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:
authorDalai Felinto <dfelinto@gmail.com>2013-10-29 06:42:51 +0400
committerDalai Felinto <dfelinto@gmail.com>2013-10-29 06:42:51 +0400
commita7b44c82e5b90e83a588fabb22fda5ac41891bdf (patch)
tree2fdc4134bdc21e47d05fe69176bc5c85a4c448cd /source/blender/makesrna/intern/rna_modifier.c
parent427844c28d2083ffcec93066ebee3fcf0fd01e42 (diff)
Triangulate Modifier: using different ngon and quad methods
Quads: Beauty, Fixed, Fixed Alternate, Shortest Diagonal Ngons: Beauty, Scanfill * Shortest Diagonal is the default method in the modifier (popular elsewhere), but beauty is the default in Ctrl+T). * Remove the need for output slot and beauty operator to be called after Clt+T Patch with collaborations and reviewed by Campbell Barton
Diffstat (limited to 'source/blender/makesrna/intern/rna_modifier.c')
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 57eeba61a73..276d8e0a678 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -109,6 +109,20 @@ EnumPropertyItem modifier_type_items[] = {
{0, NULL, 0, NULL, NULL}
};
+EnumPropertyItem modifier_triangulate_quad_method_items[] = {
+ {MOD_TRIANGULATE_QUAD_BEAUTY, "BEAUTY", 0, "Beauty ", "Split the quads in nice triangles, slower method"},
+ {MOD_TRIANGULATE_QUAD_FIXED, "FIXED", 0, "Fixed", "Split the quads on the first and third vertices"},
+ {MOD_TRIANGULATE_QUAD_ALTERNATE, "FIXED_ALTERNATE", 0, "Fixed Alternate", "Split the quads on the 2nd and 4th vertices"},
+ {MOD_TRIANGULATE_QUAD_SHORTEDGE, "SHORTEST_DIAGONAL", 0, "Shortest Diagonal", "Split the quads based on the distance between the vertices"},
+ {0, NULL, 0, NULL, NULL}
+};
+
+EnumPropertyItem modifier_triangulate_ngon_method_items[] = {
+ {MOD_TRIANGULATE_NGON_SCANFILL, "SCANFILL", 0, "Scanfill", "Split the ngons using a scanfill algorithm "},
+ {MOD_TRIANGULATE_NGON_BEAUTY, "BEAUTY", 0, "Beauty", "Arrange the new triangles nicely, slower method"},
+ {0, NULL, 0, NULL, NULL}
+};
+
#ifdef RNA_RUNTIME
#include "DNA_particle_types.h"
@@ -3500,9 +3514,16 @@ static void rna_def_modifier_triangulate(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "TriangulateModifierData");
RNA_def_struct_ui_icon(srna, ICON_MOD_TRIANGULATE);
- prop = RNA_def_property(srna, "use_beauty", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_TRIANGULATE_BEAUTY);
- RNA_def_property_ui_text(prop, "Beauty Subdivide", "Subdivide across shortest diagonal");
+ prop = RNA_def_property(srna, "quad_method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "quad_method");
+ RNA_def_property_enum_items(prop, modifier_triangulate_quad_method_items);
+ RNA_def_property_ui_text(prop, "Quad Method", "Method for splitting the quads into triangles");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop = RNA_def_property(srna, "ngon_method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "ngon_method");
+ RNA_def_property_enum_items(prop, modifier_triangulate_ngon_method_items);
+ RNA_def_property_ui_text(prop, "Ngon Method", "Method for splitting the ngons into triangles");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
}