design_add_layer
Add a typed design layer to the active sketch, using registered plugin layer types and optional properties for placement, blending, opacity, and transforms.
Instructions
Add a new design layer of a given type to the active sketch. Layer types come from registered plugins (e.g. 'typography:text', 'filter:grain', 'shapes:rect', 'guides:thirds').
Painting layers with algorithm stroke paths: Type 'painting:stroke' can render algorithm-published paths when properties include:
pathSource: 'algorithm:' — binds to a path channel (e.g. 'algorithm:strokePaths')
pathBrushId: brush preset ('flat', 'round-hard', 'round-soft', 'pencil', 'ink-pen', 'splatter')
pathColor: hex color for strokes (e.g. '#5a4a2a')
depthMapping: JSON string mapping path depth to brush params, e.g. '{"maxDepth":5,"width":[60,4],"pressure":[1.0,0.15],"paintLoad":[0.9,0.3],"opacity":[1.0,0.6]}' Values interpolate linearly from depth=0 to maxDepth. Paths beyond maxDepth clamp. Multiple layers can read the same or different channels for multi-pass rendering (shadow, base, highlight, leaves).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Layer display name (default: type's display name) | |
| type | Yes | Layer type ID (e.g. 'typography:text', 'filter:grain', 'shapes:rect') | |
| index | No | Insert position in layer stack (default: top) | |
| opacity | No | Layer opacity 0–1 (default: 1) | |
| sketchId | No | Target sketch ID (default: selected sketch) | |
| blendMode | No | Blend mode (default: 'normal') | |
| transform | No | Layer transform (default: full canvas) | |
| properties | No | Initial layer properties (merged with type defaults) |