Masks: set the corner roundness of a Rounded Rectangle mask (#3077)

* Masks: set the corner roundness of a Rounded Rectangle mask (#3067)

layer.addMask takes a roundness (corner radius in px) for shape rounded, and the new
mask.setRoundness changes it afterwards on a rectangular mask.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Mask roundness: refuse ellipses, keep feather points and key correspondence

mask.setRoundness accepted any closed path whose vertices lie on its bounding
box, so an ellipse was replaced by a rectangle. It now accepts only a plain
rectangle (four corner vertices, straight sides) or a rounded one (eight
vertices, straight sides alternating with circular corners).

The rebuilt path keeps the old start vertex and direction, and its feather
points, so an animated path's other keys and the feather points still line
up. A change between square and rounded corners changes the vertex count; it
is refused when the path is keyed or has feather points instead of leaving
keys with different counts or dropping the points.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Valentin Klein
2026-11-06 17:37:17 +01:00
committed by GitHub
co-authored by Claude Opus 5.5
parent be8b5fd8d4
commit 8948a7cdc9
6 changed files with 243 additions and 5 deletions
+4 -2
View File
@@ -318,8 +318,10 @@ build real projects through these interfaces; they are worked examples of everyt
channels (`{"layers":[{"name":"diffuse","rgba":["diffuse.R","diffuse.G","diffuse.B",""]}]}`);
EXtractoR shows them when its `red` / `green` / `blue` / `alpha` are set to those names
(`prop.set {"path":"effects/#1/red","value":"depth.Z"}`). Effect Controls offers them as popups.
* **Masks**: `layer.addMask {layer, shape: rect|ellipse, rect}` first, then `layer.mask.set
{field: feather|expansion|opacity, value}`.
* **Masks**: `layer.addMask {layer, shape: rect|ellipse|rounded, rect, roundness}` first, then
`layer.mask.set {field: feather|expansion|opacity, value}`. A Rounded Rectangle mask's corner
radius (`roundness`, layer pixels) is set when it's added and changed later with
`mask.setRoundness {layer, mask, roundness}` (0 = square corners); it only reshapes a rectangular mask.
* **Renders**: `renderQueue.add {comp, format: h264|prores|webm|png…, channels: rgba,
proresProfile: 4444, output}` then `renderQueue.render {"wait": true}`. Check a render by
importing it (`file.import`, `file.newCompFromSelection`) and `render_frame {transparent: true}`