Made feather self-intersection check an option.

Useful in cases when masking stuff like self-intersecting
ropes. This could probably be smarter option, but can't
currently think about robust approach here.
This commit is contained in:
Sergey Sharybin 2012-08-06 15:20:14 +00:00
parent fd666b2c78
commit a334b5a4b6
4 changed files with 13 additions and 2 deletions

@ -127,6 +127,8 @@ class MASK_PT_spline():
row.prop(spline, "use_cyclic")
row.prop(spline, "use_fill")
col.prop(spline, "use_self_intersection_check")
class MASK_PT_point():
# subclasses must define...

@ -779,7 +779,8 @@ float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpl
*tot_feather_point = tot;
spline_feather_collapse_inner_loops(spline, feather, tot);
if (spline->flag & MASK_SPLINE_NOINTERSECT)
spline_feather_collapse_inner_loops(spline, feather, tot);
return feather;
}

@ -141,7 +141,8 @@ typedef struct MaskLayer {
/* reserve (1 << 0) for SELECT */
enum {
MASK_SPLINE_CYCLIC = (1 << 1),
MASK_SPLINE_NOFILL = (1 << 2)
MASK_SPLINE_NOFILL = (1 << 2),
MASK_SPLINE_NOINTERSECT = (1 << 3)
};
/* MaskSpline->weight_interp */

@ -568,6 +568,13 @@ static void rna_def_maskSpline(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MASK_SPLINE_NOFILL);
RNA_def_property_ui_text(prop, "Fill", "Make this spline filled");
RNA_def_property_update(prop, NC_MASK | NA_EDITED, "rna_Mask_update_data");
/* self-intersection check */
prop = RNA_def_property(srna, "use_self_intersection_check", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MASK_SPLINE_NOINTERSECT);
RNA_def_property_ui_text(prop, "Self Intersection Check", "Prevent feather from self-intersections");
RNA_def_property_update(prop, NC_MASK | NA_EDITED, "rna_Mask_update_data");
}
static void rna_def_mask_layer(BlenderRNA *brna)