Masks: an open mask leaves its layer whole until it is closed (#290)
While a mask was being drawn with the Pen, its open path was filled as if closed, so the layer went black except inside the points placed so far, which made rotoscoping by eye impossible. As in After Effects, an open mask makes no transparency: the layer shows whole until the path is closed. Effects that take a mask as a path (Stroke and the others) still get open masks. Test: open_masks_make_no_transparency (render). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
735482d7ed
commit
56b374800d
@@ -134,7 +134,10 @@ pub fn shapes(ctx: &EvalCtx, layer: &Layer) -> Vec<effectcraft_effects::MaskShap
|
||||
/// Returns whether any mask was applied.
|
||||
pub fn apply(ctx: &EvalCtx, layer: &Layer, buf: &mut Buf, blur: MaskBlur) -> bool {
|
||||
let Some(masks) = layer.masks() else { return false };
|
||||
let list: Vec<_> = masks.groups().filter(|g| g.enabled && matches!(g.kind, GroupKind::Mask { mode, .. } if mode != MaskMode::None)).collect();
|
||||
// An open mask (a path the Pen is still drawing) makes no transparency: the layer shows
|
||||
// whole until the path is closed (After Effects; effects still use it as a path).
|
||||
let closed = |g: &effectcraft_project::PropGroup| matches!(ctx.group_value(layer, g, "path"), Some(Value::Path(sp)) if sp.closed);
|
||||
let list: Vec<_> = masks.groups().filter(|g| g.enabled && matches!(g.kind, GroupKind::Mask { mode, .. } if mode != MaskMode::None) && closed(g)).collect();
|
||||
if list.is_empty() {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user