From 13254cde8c7ca38af2dcec35efdb9f8f9b3bca46 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 Aug 2012 09:44:56 +0000 Subject: Alternate mask spline feather offset calculation method: now there are 2 [Even | Smooth] - Even preserves thickness but can give unsightly loops - Smooth gives nicer shape but can give unsightly feather/spline mismatch for 'S' shapes created by beziers. This is an example where smooth works much nicer. http://www.graphicall.org/ftp/ideasman42/mask_compare.png --- source/blender/makesrna/intern/rna_mask.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_mask.c b/source/blender/makesrna/intern/rna_mask.c index a6571a2db4f..719baed8edb 100644 --- a/source/blender/makesrna/intern/rna_mask.c +++ b/source/blender/makesrna/intern/rna_mask.c @@ -540,6 +540,12 @@ static void rna_def_maskSpline(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static EnumPropertyItem spline_offset_mode_items[] = { + {MASK_SPLINE_OFFSET_EVEN, "EVEN", 0, "Even", "Calculate even feather offset"}, + {MASK_SPLINE_OFFSET_SMOOTH, "SMOOTH", 0, "Smooth", "Calculate feather offset as a second curve"}, + {0, NULL, 0, NULL, NULL} + }; + StructRNA *srna; PropertyRNA *prop; @@ -548,6 +554,13 @@ static void rna_def_maskSpline(BlenderRNA *brna) srna = RNA_def_struct(brna, "MaskSpline", NULL); RNA_def_struct_ui_text(srna, "Mask spline", "Single spline used for defining mask shape"); + /* offset mode */ + prop = RNA_def_property(srna, "offset_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "offset_mode"); + RNA_def_property_enum_items(prop, spline_offset_mode_items); + RNA_def_property_ui_text(prop, "Feather Offset", "The method used for calculating the feather offset"); + RNA_def_property_update(prop, 0, "rna_Mask_update_data"); + /* weight interpolation */ prop = RNA_def_property(srna, "weight_interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "weight_interp"); -- cgit v1.2.3