diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-11-05 03:52:26 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-11-05 03:52:26 +0400 |
commit | dd633f1affc8951a0a6ba19cdffbb58ac7f54acd (patch) | |
tree | f6290998a6d4cea5fc8d8dbc11a99ecddd6a5125 /source/blender | |
parent | a9055460a92397d8110289167719d616ce3f0399 (diff) |
Fix for dashed line options not working as expected in some applications
when combined with geometry modifiers.
The problem is that users were not able to choose the time when the
dashed line options are applied. Instead, the dashed line options were
applied only before geometry modifiers were employed. Since dashes were
separate strokes, the geometry modifiers were processed dash by dash.
Depending on users' artistic intention, this may or may not lead to
expected stylization results, as reported by octane98 in the
BlenderArtists Freestyle thread on January 3, 2012.
http://blenderartists.org/forum/showthread.php?89986-Freestyle-for-Blender&p=2018592&viewfull=1#post2018592
Now the Strokes tab of the Freestyle Line Style panel has two sets of
dashed line options. One is in the Splitting section of the Strokes tab
and used for splitting strokes by dashed line patterns. The other set
is called "Dashed Line" and used to generate dashed lines based on the
strokes after the geometry modifiers are applied. The two sets of
dashed line options are independent of each other, so that users can
enable one of them as well as both at the same time.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesdna/DNA_linestyle_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_linestyle.c | 53 |
2 files changed, 52 insertions, 6 deletions
diff --git a/source/blender/makesdna/DNA_linestyle_types.h b/source/blender/makesdna/DNA_linestyle_types.h index 9ffb53e83b6..2507b072a2f 100644 --- a/source/blender/makesdna/DNA_linestyle_types.h +++ b/source/blender/makesdna/DNA_linestyle_types.h @@ -390,6 +390,7 @@ typedef struct LineStyleThicknessModifier_Calligraphy { #define LS_MIN_2D_ANGLE 128 #define LS_MAX_2D_ANGLE 256 #define LS_SPLIT_LENGTH 512 +#define LS_SPLIT_PATTERN 1024 /* FreestyleLineStyle::chaining */ #define LS_CHAINING_PLAIN 1 @@ -420,6 +421,10 @@ typedef struct FreestyleLineStyle { float split_length; float min_angle, max_angle; /* for splitting */ float min_length, max_length; + unsigned short split_dash1, split_gap1; + unsigned short split_dash2, split_gap2; + unsigned short split_dash3, split_gap3; + int pad; unsigned short dash1, gap1, dash2, gap2, dash3, gap3; int panel; /* for UI */ diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c index 62d69ee8732..fbe8eae31b3 100644 --- a/source/blender/makesrna/intern/rna_linestyle.c +++ b/source/blender/makesrna/intern/rna_linestyle.c @@ -1019,6 +1019,47 @@ static void rna_def_linestyle(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Max 2D Length", "Maximum curvilinear 2D length for the selection of chains"); RNA_def_property_update(prop, NC_LINESTYLE, NULL); + prop= RNA_def_property(srna, "use_split_pattern", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", LS_SPLIT_PATTERN); + RNA_def_property_ui_text(prop, "Use Split Pattern", "Enable chain splitting by dashed line patterns"); + RNA_def_property_update(prop, NC_LINESTYLE, NULL); + + prop= RNA_def_property(srna, "split_dash1", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "split_dash1"); + RNA_def_property_range(prop, 0, USHRT_MAX); + RNA_def_property_ui_text(prop, "Split Dash 1", "Length of the 1st dash for splitting"); + RNA_def_property_update(prop, NC_LINESTYLE, NULL); + + prop= RNA_def_property(srna, "split_gap1", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "split_gap1"); + RNA_def_property_range(prop, 0, USHRT_MAX); + RNA_def_property_ui_text(prop, "Split Gap 1", "Length of the 1st gap for splitting"); + RNA_def_property_update(prop, NC_LINESTYLE, NULL); + + prop= RNA_def_property(srna, "split_dash2", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "split_dash2"); + RNA_def_property_range(prop, 0, USHRT_MAX); + RNA_def_property_ui_text(prop, "Split Dash 2", "Length of the 2nd dash for splitting"); + RNA_def_property_update(prop, NC_LINESTYLE, NULL); + + prop= RNA_def_property(srna, "split_gap2", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "split_gap2"); + RNA_def_property_range(prop, 0, USHRT_MAX); + RNA_def_property_ui_text(prop, "Split Gap 2", "Length of the 2nd gap for splitting"); + RNA_def_property_update(prop, NC_LINESTYLE, NULL); + + prop= RNA_def_property(srna, "split_dash3", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "split_dash3"); + RNA_def_property_range(prop, 0, USHRT_MAX); + RNA_def_property_ui_text(prop, "Split Dash 3", "Length of the 3rd dash for splitting"); + RNA_def_property_update(prop, NC_LINESTYLE, NULL); + + prop= RNA_def_property(srna, "split_gap3", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "split_gap3"); + RNA_def_property_range(prop, 0, USHRT_MAX); + RNA_def_property_ui_text(prop, "Split Gap 3", "Length of the 3rd gap for splitting"); + RNA_def_property_update(prop, NC_LINESTYLE, 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"); @@ -1038,37 +1079,37 @@ static void rna_def_linestyle(BlenderRNA *brna) prop= RNA_def_property(srna, "dash1", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "dash1"); RNA_def_property_range(prop, 0, USHRT_MAX); - RNA_def_property_ui_text(prop, "Dash 1", "Length of the 1st dash"); + RNA_def_property_ui_text(prop, "Dash 1", "Length of the 1st dash for dashed lines"); RNA_def_property_update(prop, NC_LINESTYLE, NULL); prop= RNA_def_property(srna, "gap1", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "gap1"); RNA_def_property_range(prop, 0, USHRT_MAX); - RNA_def_property_ui_text(prop, "Gap 1", "Length of the 1st gap"); + RNA_def_property_ui_text(prop, "Gap 1", "Length of the 1st gap for dashed lines"); RNA_def_property_update(prop, NC_LINESTYLE, NULL); prop= RNA_def_property(srna, "dash2", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "dash2"); RNA_def_property_range(prop, 0, USHRT_MAX); - RNA_def_property_ui_text(prop, "Dash 2", "Length of the 2nd dash"); + RNA_def_property_ui_text(prop, "Dash 2", "Length of the 2nd dash for dashed lines"); RNA_def_property_update(prop, NC_LINESTYLE, NULL); prop= RNA_def_property(srna, "gap2", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "gap2"); RNA_def_property_range(prop, 0, USHRT_MAX); - RNA_def_property_ui_text(prop, "Gap 2", "Length of the 2nd gap"); + RNA_def_property_ui_text(prop, "Gap 2", "Length of the 2nd gap for dashed lines"); RNA_def_property_update(prop, NC_LINESTYLE, NULL); prop= RNA_def_property(srna, "dash3", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "dash3"); RNA_def_property_range(prop, 0, USHRT_MAX); - RNA_def_property_ui_text(prop, "Dash 3", "Length of the 3rd dash"); + RNA_def_property_ui_text(prop, "Dash 3", "Length of the 3rd dash for dashed lines"); RNA_def_property_update(prop, NC_LINESTYLE, NULL); prop= RNA_def_property(srna, "gap3", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "gap3"); RNA_def_property_range(prop, 0, USHRT_MAX); - RNA_def_property_ui_text(prop, "Gap 3", "Length of the 3rd gap"); + RNA_def_property_ui_text(prop, "Gap 3", "Length of the 3rd gap for dashed lines"); RNA_def_property_update(prop, NC_LINESTYLE, NULL); } |