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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-04-07 21:28:09 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-04-07 21:28:09 +0400
commite94abda66dae7d01260839a7c5c5ff271f3ae33d (patch)
treebeba13ff569e188bc6c2a9c21762c9765abd6d09 /source/blender/makesrna/intern/rna_linestyle.c
parent8ea8b6a1baecdbc3271a65cc9089b43aaeae743e (diff)
New options in the Parameter Editor mode for controling the position of stroke thickness.
The new options enable a better control on the position of stroke thickness with respect to stroke backbone geometry. Three predefined positions are: * center: thickness is evenly split to the left and right side of the stroke geometry. * inside: strokes are drawn within object boundary. * outside: strokes are drawn outside the object boundary. Another option called "relative" allows users to specify the relative position by a number between 0 (inside) and 1 (outside). The thickness position options are applied only to strokes of the edge types SILHOUETTE and BORDER, since these are the only edge types defined in terms of object boundary. Strokes of other edge types are always using the "center" option.
Diffstat (limited to 'source/blender/makesrna/intern/rna_linestyle.c')
-rw-r--r--source/blender/makesrna/intern/rna_linestyle.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c
index dc1942b23b4..abb715f2471 100644
--- a/source/blender/makesrna/intern/rna_linestyle.c
+++ b/source/blender/makesrna/intern/rna_linestyle.c
@@ -875,6 +875,12 @@ static void rna_def_linestyle(BlenderRNA *brna)
{LS_CAPS_ROUND, "ROUND", 0, "Round", "Round cap (half-circle)"},
{LS_CAPS_SQUARE, "SQUARE", 0, "Square", "Square cap (flat and extended)"},
{0, NULL, 0, NULL, NULL}};
+ static EnumPropertyItem thickness_position_items[] = {
+ {LS_THICKNESS_CENTER, "CENTER", 0, "Center", "Stroke is centered along stroke geometry"},
+ {LS_THICKNESS_INSIDE, "INSIDE", 0, "Inside", "Stroke is drawn inside stroke geometry"},
+ {LS_THICKNESS_OUTSIDE, "OUTSIDE", 0, "Outside", "Stroke is drawn outside stroke geometry"},
+ {LS_THICKNESS_RELATIVE, "RELATIVE", 0, "Relative", "Stroke thinkness is split by a user-defined ratio"},
+ {0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "FreestyleLineStyle", "ID");
RNA_def_struct_ui_text(srna, "Freestyle Line Style", "Freestyle line style, reusable by multiple line sets");
@@ -904,6 +910,18 @@ static void rna_def_linestyle(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Thickness", "Base line thickness, possibly modified by line thickness modifiers");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ prop= RNA_def_property(srna, "thickness_position", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_bitflag_sdna(prop, NULL, "thickness_position");
+ RNA_def_property_enum_items(prop, thickness_position_items);
+ RNA_def_property_ui_text(prop, "Thickness Position", "Select the position of stroke thickness");
+ RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+
+ prop= RNA_def_property(srna, "thickness_ratio", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "thickness_ratio");
+ RNA_def_property_range(prop, 0.f, 1.f);
+ RNA_def_property_ui_text(prop, "Thickness Ratio", "A number between 0 (inside) and 1 (outside) specifying the relative position of stroke thickness");
+ RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+
prop= RNA_def_property(srna, "color_modifiers", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "color_modifiers", NULL);
RNA_def_property_struct_type(prop, "LineStyleColorModifier");