Files
effectcraft/crates/engine
Valentin KleinandFredApps 29d116c6f7 Convert To Bezier Path works on a selected shape layer or group, for example right after drawing a rectangle (#3220)
* #3057: Convert To Bezier Path converts a selected shape layer's or group's parametric paths

Right after drawing with the Rectangle, Ellipse or Polygon tool only the layer is selected,
and Convert To Bezier Path fell through to the mask branch and reported "no masks". It only
converted when the parametric path row itself (Rectangle Path 1) was selected.

- A selected shape group converts the parametric paths inside it, nested groups included.
- With only layers selected, a shape layer converts its parametric paths, as a selected
  layer's masks are targeted. Locked layers are skipped; animated parametric paths are left
  alone and reported (skippedAnimated), and selecting the path still converts it.
- Masks win only when targeted (mask param, selected mask, mask vertices) or when one uses
  RotoBezier: plain masks no longer turn the command into a silent no-op.
- An explicit layer/layers limits selected shape items to those layers; an unmatched mask
  param is an error instead of converting every path.
- Errors say what to select instead of asking for masks.

A PSD shape layer importing as a layer with a mask matches After Effects; no change there.

Fixes #3057

* #3057: Convert To Bezier Path converts a layer named twice once

A layer given twice in `layers` (by id and by name) was widened twice: its parametric paths were queued twice, and the second replacement found no such item, so the whole command failed. The layer list is deduplicated before the widening, which also keeps skippedAnimated from counting a path twice.

* #3057: Convert To Bezier Path leaves locked layers and a group's animated paths alone

Shape items given as `items` or selected on a locked layer converted anyway (only the layer-wide conversion checked locks); they now go through unlocked(), an error when every one is locked. A selected group skips its keyframed or expression-driven parametric paths and reports them in skippedAnimated, as converting a whole layer does; a path selected itself still converts at the current time.

* Doc comments for the functions this PR touches

* #3057: Convert To Bezier Path gives an explicit mask priority over shape items

With a `mask` given, a selected parametric path (or `items`) was converted instead of the mask, an unmatched `mask` converted the shape rather than reporting the miss, and a locked shape-item layer could reject the call before the mask was looked at. Shape items are now ignored when `mask` is present.

* #3057: Convert To Bezier Path converts a selected mask with the selected shape paths

With a mask and a parametric path both selected, only the path converted and the mask kept its RotoBezier tangents. Masks the selection targets (a selected mask or its property, mask vertices, on unlocked layers in scope) now convert in the same undo step, the result reports them as masks, and they stay selected with the new paths. An explicit `mask` keeps its priority.

* #3057: Convert To Bezier Path keeps mask conversion to an explicit layer

With `{"layer": A}` and a RotoBezier mask selected on layer B, the mask branch converted B's mask and left A unchanged. The resolved masks are now scoped to the explicit layer/layers (falling back to those layers' own masks), the priority check only counts selected masks and vertices in scope, and the scoped targets are edited directly instead of being resolved again.

* #3057: Convert To Bezier Path leaves masks on locked layers alone

A scoped or selected RotoBezier mask on a locked layer was converted through the mask branch. Masks on locked layers are now dropped after the scope and its fallback are resolved, so a locked selected mask does not hand the conversion to other masks; when every targeted mask is locked, the command reports the lock, as it does for shape items.

* #3057: Convert To Bezier Path converts in the composition `comp` names

With `comp` naming a composition that is not active, an explicit `mask` was resolved there but filtered against the active composition ("no mask matches"), and explicit `items` were looked up in the active composition. convert_to_bezier now works in the composition comp_id resolves, and selected_shape_items returns the composition layer_p resolved for explicit items (also used by Group and Ungroup Shapes); a selection made in another composition does not apply.

* Convert To Bezier Path: explicit items add no selected masks

With explicit `items`, only those shape paths convert. A RotoBezier mask
selected on the same layer no longer loses its RotoBezier flag as a side
effect. Regression test added.

* Convert To Bezier Path: explicit items without a parametric path convert no mask

* Convert To Bezier Path: items count as given only as a list

---------

Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-23 02:31:15 +07:00
..
2026-10-29 20:31:32 +01:00