Layer: Quick Set Anchor, nine anchor points with Position compensation (#3080)

* Layer: Quick Set Anchor, nine anchor points with Position compensation (#2967)

layer.quickSetAnchor moves the Anchor Point of 2D layers to a corner, edge midpoint or the
centre of their content and shifts Position and its keys so nothing moves. Layer > Transform >
Quick Set Anchor lists the nine points.

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

* Quick Set Anchor: skip layers with an animated Anchor Point, Scale or Rotation

The anchor is set at the current time and the Position shift is worked out
from the current Anchor Point, Scale and Rotation, so on a layer where any of
them is keyed or has an expression the layer would move at other frames.
Such layers are skipped like 3D and locked ones (an error when none is left).

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

* Quick Set Anchor: skip layers with a Position expression or Auto-Orient along the path

An expression on Position (or the separated X/Y) overrides the shifted value,
and Auto-Orient along the path adds a rotation the shift does not account for;
both would make the layer jump, so they are skipped like 3D layers.

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

* Quick Set Anchor: error when no selected layer has content bounds

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

* Quick Set Anchor: test separated, keyed Position keeps the layer in place

Co-Authored-By: Claude Sonnet 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:11 +01:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 9a32a51793
commit be8b5fd8d4
4 changed files with 285 additions and 4 deletions
+5
View File
@@ -261,6 +261,11 @@ build real projects through these interfaces; they are worked examples of everyt
`layer.centerAnchor` skip them and fail when every target is locked ("… is locked"); Select
All and `layer.selectNext` / `selectPrevious` step over them. Unlock with
`layer.setSwitch {"layers": [...], "switch": "lock", "value": false}` or `layer.unlockAll`.
* **Quick Set Anchor**: `layer.quickSetAnchor {point: topLeft|top|topRight|left|center|right|bottomLeft|bottom|bottomRight, layers?}`
(Layer ▸ Transform ▸ Quick Set Anchor) moves the Anchor Point of 2D layers to that point of their
content and shifts Position and its keys so the layers don't move, in one undo step. 3D and
locked layers, and layers whose Anchor Point, Scale or Rotation is keyed or has an expression,
are skipped (an error when none is left); returns `{layers}`.
* **Solid Settings**: `layer.settings {layer, name?, color?, width?, height?, pixelAspect?,
affectAll?}` edits a solid or adjustment layer's solid (and renames the layer and the solid).
A solid shared by several layers (duplicates share theirs) changes for all of them unless