mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-05 05:22:58 -05:00
Layer.pathItems and GroupItem.pathItems now return a PathItems collection for the paths directly in the layer or group, topmost first, as the Layer and GroupItem pages describe them (https://ai-scripting.docsforadobe.dev/jsobjref/Layer/, https://ai-scripting.docsforadobe.dev/jsobjref/GroupItem/). Before, both threw an error that said they were not available yet. - The collection has the members of Document.pathItems. Its parent is the layer or group, and length, [i], index and getByName read only that container's paths, so a path inside a group, a compound path or a sublayer is not listed. - add() and the shape creators put the new path on top of the layer's or group's contents and leave the current layer as it was. The path is made with the container's layer current (layer.setCurrent) and, for a group, moved into it with node.move, in the run's one undo step. - VectorCraft's own rule: a layer or group that is hidden or locked, or that is in a hidden or locked layer or group, throws "Cannot add a path to a hidden or locked layer or group" and no path is made. - The last four path lists stay cached while their documents are unchanged, so a loop over a large layer or group builds its list once. Docs: docs/mcp.md, docs/target-app-parity.md.