brush_style_set

Defines or replaces the brush style named ref, which samples handles with this styleRef draw in the painterly mode (and every handle without one while it is the mode's style). layers: 1 to 4, drawn in order, each { shape: round | flat | filbert | dry, size × spacing [0.25, 8] (default 2), aspect [1, 8] (3), opacity [0, 1] (0.85), spacingScale × spacingPx [0.25, 4] (1), levels [from, to] within [0, 15] (all), keep (0, 1] (1), jitter { rotation ± rad [0, π/2] (0.25), size ± [0, 0.5] (0.15), position ± spacing [0, 1] (0.3), value ± OKLab L [0, 0.2] (0.08), chroma ± [0, 0.1] (0.03) } }; facing [from, to] of N·V with to > from (default [0, 0.1]); twoSided (false). At most 254 styles. The built-in style: a filbert base (size 2, aspect 2.5, opacity 0.8) and a flat detail (size 1.2, aspect 3.5, opacity 0.9, spacingScale 0.7, keep 0.5). Returns { ref, changed }.

Command

Usage

TypeScript
surface.execute('brush_style_set', { ref, layers, facing?, twoSided? })

Parameters

  • refstring

    Required

  • layersobject[]

    Required

  • facingnumber[]

    Optional

  • twoSidedboolean

    Optional

Returns

object with ref, changed, in the ok: true envelope.

JSON
{
  "type": "object",
  "properties": {
    "ref": {
      "type": "string"
    },
    "changed": {
      "type": "boolean"
    }
  },
  "required": [
    "ref",
    "changed"
  ]
}

See also