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
path: root/source
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-09-19 02:59:51 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-09-19 02:59:51 +0400
commit513293a2566016f6e2f1aba00f73910d14e71780 (patch)
treec6d23475c22767777988962fc7a11bdc9d6f8e6c /source
parent70821c6b24f19acd7263fadf161b94611b53273f (diff)
Added new line style options for selecting chains by min/max 2D lengths.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/linestyle.c2
-rw-r--r--source/blender/makesdna/DNA_linestyle_types.h3
-rw-r--r--source/blender/makesrna/intern/rna_linestyle.c22
3 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c
index 88584633a49..86ea80cb89e 100644
--- a/source/blender/blenkernel/intern/linestyle.c
+++ b/source/blender/blenkernel/intern/linestyle.c
@@ -69,6 +69,8 @@ static void default_linestyle_settings(FreestyleLineStyle *linestyle)
linestyle->r = linestyle->g = linestyle->b = 0.0;
linestyle->alpha = 1.0;
linestyle->thickness = 1.0;
+ linestyle->min_length = 0.0f;
+ linestyle->max_length = 10000.0f;
linestyle->color_modifiers.first = linestyle->color_modifiers.last = NULL;
linestyle->alpha_modifiers.first = linestyle->alpha_modifiers.last = NULL;
diff --git a/source/blender/makesdna/DNA_linestyle_types.h b/source/blender/makesdna/DNA_linestyle_types.h
index 8b3b5a60181..85468ce6657 100644
--- a/source/blender/makesdna/DNA_linestyle_types.h
+++ b/source/blender/makesdna/DNA_linestyle_types.h
@@ -319,6 +319,8 @@ typedef struct LineStyleThicknessModifier_Calligraphy {
#define LS_SAME_OBJECT 2
#define LS_DASHED_LINE 4
#define LS_MATERIAL_BOUNDARY 8
+#define LS_MIN_2D_LENGTH 16
+#define LS_MAX_2D_LENGTH 32
/* FreestyleLineStyle::caps */
#define LS_CAPS_BUTT 1
@@ -332,6 +334,7 @@ typedef struct FreestyleLineStyle {
float r, g, b, alpha;
float thickness;
int flag, caps;
+ float min_length, max_length;
unsigned short dash1, gap1, dash2, gap2, dash3, gap3;
int panel; /* for UI */
int pad1;
diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c
index e5b5aee5541..389d3746671 100644
--- a/source/blender/makesrna/intern/rna_linestyle.c
+++ b/source/blender/makesrna/intern/rna_linestyle.c
@@ -733,6 +733,28 @@ static void rna_def_linestyle(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Same Object", "If true, only feature edges of the same object are joined.");
RNA_def_property_update(prop, NC_SCENE, NULL);
+ prop= RNA_def_property(srna, "use_min_length", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", LS_MIN_2D_LENGTH);
+ RNA_def_property_ui_text(prop, "Use Min 2D Length", "Enable the selection of chains by a minimum 2D length.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "min_length", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "min_length");
+ RNA_def_property_range(prop, 0.0f, 10000.0f);
+ RNA_def_property_ui_text(prop, "Min 2D Length", "Minimum 2D length for the selection of chains.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "use_max_length", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", LS_MAX_2D_LENGTH);
+ RNA_def_property_ui_text(prop, "Use Max 2D Length", "Enable the selection of chains by a maximum 2D length.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "max_length", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "max_length");
+ RNA_def_property_range(prop, 0.0f, 10000.0f);
+ RNA_def_property_ui_text(prop, "Max 2D Length", "Maximum 2D length for the selection of chains.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
prop= RNA_def_property(srna, "material_boundary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LS_MATERIAL_BOUNDARY);
RNA_def_property_ui_text(prop, "Material Boundary", "If true, chains of feature edges are split at material boundaries.");