forked from bartvdbraak/blender
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:
parent
fd666b2c78
commit
a334b5a4b6
@ -127,6 +127,8 @@ class MASK_PT_spline():
|
|||||||
row.prop(spline, "use_cyclic")
|
row.prop(spline, "use_cyclic")
|
||||||
row.prop(spline, "use_fill")
|
row.prop(spline, "use_fill")
|
||||||
|
|
||||||
|
col.prop(spline, "use_self_intersection_check")
|
||||||
|
|
||||||
|
|
||||||
class MASK_PT_point():
|
class MASK_PT_point():
|
||||||
# subclasses must define...
|
# subclasses must define...
|
||||||
|
@ -779,6 +779,7 @@ float (*BKE_mask_spline_feather_differentiated_points_with_resolution_ex(MaskSpl
|
|||||||
|
|
||||||
*tot_feather_point = tot;
|
*tot_feather_point = tot;
|
||||||
|
|
||||||
|
if (spline->flag & MASK_SPLINE_NOINTERSECT)
|
||||||
spline_feather_collapse_inner_loops(spline, feather, tot);
|
spline_feather_collapse_inner_loops(spline, feather, tot);
|
||||||
|
|
||||||
return feather;
|
return feather;
|
||||||
|
@ -141,7 +141,8 @@ typedef struct MaskLayer {
|
|||||||
/* reserve (1 << 0) for SELECT */
|
/* reserve (1 << 0) for SELECT */
|
||||||
enum {
|
enum {
|
||||||
MASK_SPLINE_CYCLIC = (1 << 1),
|
MASK_SPLINE_CYCLIC = (1 << 1),
|
||||||
MASK_SPLINE_NOFILL = (1 << 2)
|
MASK_SPLINE_NOFILL = (1 << 2),
|
||||||
|
MASK_SPLINE_NOINTERSECT = (1 << 3)
|
||||||
};
|
};
|
||||||
|
|
||||||
/* MaskSpline->weight_interp */
|
/* 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_boolean_negative_sdna(prop, NULL, "flag", MASK_SPLINE_NOFILL);
|
||||||
RNA_def_property_ui_text(prop, "Fill", "Make this spline filled");
|
RNA_def_property_ui_text(prop, "Fill", "Make this spline filled");
|
||||||
RNA_def_property_update(prop, NC_MASK | NA_EDITED, "rna_Mask_update_data");
|
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)
|
static void rna_def_mask_layer(BlenderRNA *brna)
|
||||||
|
Loading…
Reference in New Issue
Block a user