mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-06 05:53:08 -05:00
Merge main into feat/revolve-rendered-groups
This commit is contained in:
commit
f5a9bc56ce
208 files changed
+12640
-715
No files matched your search
+153
-14
@@ -880,7 +880,7 @@ ends the wait, so the sampler can be shown again. The BSDs and headless sessions
|
||||
| `invoke_menu` | `{command, params?}` | Invokes a menu item by command id. UI commands such as `view.*` and `window.*` are in `command_list` with `ui: true`; running them needs the desktop app (`--connect`). The app refuses `attributes.openUrl`, `file.export.svg.browser`, `file.saveForWeb.browser` and `file.showPackage` for every control and MCP request, since each opens another app, so the headless error for them does not suggest `--connect`. |
|
||||
| `open_panel` | `{panel}` | Remote only. `panel` is a panel id (`layers`, `swatches`, `colorGuide`, …, as `window.panel` takes) or its display label (`"Color Guide"`), in any case. |
|
||||
| `screenshot` | `{path?, scale?, artboard?, window?, max_side?, traceViews?}` | Returns MCP image content (`image/png`, base64) plus a text block. Renders the artboard with the pixels of a PNG `export` with `background: "white"` at the same scale; `traceViews:true` draws Image Trace objects in the view set with `imageTrace.setView`, as in the app's window; `window:true` captures the app window (remote only), as `ui_screenshot` does, and `max_side` (1–4096, window captures only) scales the returned image down as described for `ui_screenshot`. With `path` the backend (the headless session or the app) writes the PNG there too; a window capture written there keeps its full size with `max_side`. An app that does not send the image back writes a window capture without `path` to a file in a new folder inside the system's temporary folder (on Unix only the user can open it); the server reads the file and then removes the folder, also when the capture or the read fails. |
|
||||
| `open_file` | `{path, importer?, params?}` | Opens any readable file as a new active document: `.vectorcraft`/`.drawcraft`, `.vctemplate`, `.svg`/`.svgz`, `.pdf`/`.ai`, `.ait`, `.eps`/`.epsf`, `.ps`, `.dxf`, `.emf`, `.wmf`, PICT (`.pct`/`.pic`/`.pict`, and a version 2 picture of any extension), HP-GL (`.plt`/`.hpgl`/`.hgl`/`.hpg`, and a file of an extension no other format reads that starts with plotter instructions), PNG (`.png`/`.pns`), JPEG, GIF, WebP, TIFF, BMP (`.bmp`/`.dib`/`.rle`), Targa (`.tga`/`.vda`/`.icb`/`.vst`), PCX, Pixar (`.pxr`), JPEG 2000 (`.jpf`/`.jpx`/`.jp2`/`.j2k`/`.j2c`/`.jpc`), HEIC/HEIF (`.heic`/`.heif`), JPEG XL (`.jxl`), PSD (`.psd`/`.pdd`)/PSB (an image opens as a document of its pixel size; a PSD or PSB file with its layers as layers, or as its merged image through `run_command document.open` with `layers: false`; a JPEG XL file as its first frame), CDR drawings of versions 1 to 27 (`.cdr`, `.cdt`), CMX files with 32-bit coordinates (`.cmx`), layered raster `.pcraft` documents (as one image at the canvas size; a warning says when only the smaller preview could be read), DWG drawings (`.dwg`, `.dws`, `.dwt`). Templates (`.vctemplate`, `.ait`, `.cdt`, `.dwt`) open as a new untitled document. PDF, `.ai` and SVG files saved with Preserve Editing reopen as the document they carry. The reply is `document.open`'s: its `warnings` say what didn't come in as it was (an EPS whose PostScript can't be read opens as its preview, and the warning names the PostScript error, the operator and the procedure). A file of an extension only an installed importer plug-in lists opens with that importer ([Plug-ins](#plug-ins)); `importer: "plugin.<id>"` opens the file with the importer it names, which must list the file's extension, also one a built-in format reads (in the app, as File › Open With does), and `params` gives that importer's parameters (their defaults when omitted). `run_command document.formats` lists the formats. |
|
||||
| `open_file` | `{path, importer?, params?}` | Opens any readable file as a new active document: `.vectorcraft`/`.drawcraft`, `.vctemplate`, `.svg`/`.svgz`, `.pdf`/`.ai`, `.ait`, `.eps`/`.epsf`, `.ps`, `.dxf`, `.emf`, `.wmf`, PICT (`.pct`/`.pic`/`.pict`, and a version 2 picture of any extension), HP-GL (`.plt`/`.hpgl`/`.hgl`/`.hpg`, and a file of an extension no other format reads that starts with plotter instructions), PNG (`.png`/`.pns`), JPEG (`.jpg`/`.jpeg`/`.jpe`), GIF, WebP, TIFF, BMP (`.bmp`/`.dib`/`.rle`), Targa (`.tga`/`.vda`/`.icb`/`.vst`), PCX, Pixar (`.pxr`), JPEG 2000 (`.jpf`/`.jpx`/`.jp2`/`.j2k`/`.j2c`/`.jpc`), HEIC/HEIF (`.heic`/`.heif`), JPEG XL (`.jxl`), PSD (`.psd`/`.pdd`)/PSB (an image opens as a document of its pixel size; a PSD or PSB file with its layers as layers, or as its merged image through `run_command document.open` with `layers: false`; a JPEG XL file as its first frame), CDR drawings of versions 1 to 27 (`.cdr`, `.cdt`), CMX files with 32-bit coordinates (`.cmx`), layered raster `.pcraft` documents (as one image at the canvas size; a warning says when only the smaller preview could be read), DWG drawings (`.dwg`, `.dws`, `.dwt`). Templates (`.vctemplate`, `.ait`, `.cdt`, `.dwt`) open as a new untitled document. PDF, `.ai` and SVG files saved with Preserve Editing reopen as the document they carry. The reply is `document.open`'s: its `warnings` say what didn't come in as it was (an EPS whose PostScript can't be read opens as its preview, and the warning names the PostScript error, the operator and the procedure). A file of an extension only an installed importer plug-in lists opens with that importer ([Plug-ins](#plug-ins)); `importer: "plugin.<id>"` opens the file with the importer it names, which must list the file's extension, also one a built-in format reads (in the app, as File › Open With does), and `params` gives that importer's parameters (their defaults when omitted). `run_command document.formats` lists the formats. |
|
||||
| `save_file` | `{path?, compress?, version?, preview?, precision?, options?}` | Runs `document.save`: the document's own file in its own format (native `.vectorcraft` unless it was opened from or saved as SVG, PDF or a restorable `.ai`; then `warnings` say what that format loses). A path's extension picks the format (`.vectorcraft`, `.vctemplate`, `.pdf`, `.svg`, `.svgz`, `.ai`: a PDF carrying the native document, which reopens editable; `.eps`: by default one file whose bounding box fits the visible art, the first artboard when no art shows; `options.useArtboards: true` makes the chosen artboard the page and, with two or more chosen, the file at the path is the central file of the visible art and each artboard is also written to `<name>_<artboard>.eps` beside it, listed in the reply's `files`). For a native file, `compress: true` gzips it (default: the `useCompression` preference, Preferences › File Handling › Use Compression), `version` (1 to 4) writes it for an older VectorCraft (1 and 2 are never compressed, and `version: 2` with `compress: true` is an error; versions 1 to 3 get each live star as a plain path of its outline, without its point count and ratio), `preview: true` embeds a PNG of the first artboard, and `precision` (0 to 9) rounds path anchors and handles to that many decimal places for that save only (colors, transforms and type stay exact). `options` passes the format's save options as `run_command document.formats` lists them. When `compress`, `version`, `preview` or `precision` is given both at the top level and in `options` with different values, the call is an error (`` `compress: true` and `options.compress: false` disagree: give the option once ``) and nothing is written. A key in `options` that no save format takes is an error, and nothing is written (see Parameter keys). The save drops each option the written format doesn't read. The reply's `warnings` then name each such option given (for example `` `compress` was not used: SVG files don't read it `` for an `.svg` path, and `` `options.preview` was not used: … `` for a key in `options`; a PDF-compatible `.ai` file reads `compress` but not `version`, `preview`, `precision`, `outlineText`, `hiddenObjects`, `transparentImages` or `preserveEditing`, and a legacy `.ai` file reads only its own options). For a `.ai` file, these warnings name the kind of `.ai` written: a legacy .ai (version 7) for `aiVersion: "7"`, a non-PDF-compatible .ai for `pdfCompatible: false`, and a PDF-compatible .ai otherwise, including a save that reuses the options the document was last saved with. `run_command document.save` and the other save commands refuse any option given beside the path and in `options` with different values, and give the same warnings for each key given beside the path or in `options` that the file doesn't read. The headless session and the app receive the same `app.save` params, and the app is also sent `wait: true`: the call returns once the file is written, or with the error (such as a path outside the write root), even with Background Save on. When the save asks first (the question before replacing a file that opened with losses, or on macOS and Linux the file dialog for an untitled document without `path`), the reply is `{pending}` or `"cancelled"` as before, and the save that runs after the answer uses the Background Save preference. Location refusals return `READ_ONLY_LOCATION: <reason>` without a fallback panel for automation; see [Save location errors](#save-location-errors). In the desktop app, a save that runs in the background shows in the progress window after 0.4 s with a moving bar. `file.cancelSave` stops every such save before it replaces its file → `{cancelled: n}`: the file stays as it was, and the document keeps its file and format and stays modified. A save whose file was already being replaced finishes and is reported as saved. `file.saveInBackground` closes the window while the saves go on → `{hidden: n}`. |
|
||||
| `export` | `{path?, format?, scale?, artboard?, range?, selection?, outlineText?, options?}` | `svg`, `svgz`, `pdf`, `ai` (the PDF-compatible `.ai` that Save writes, which carries the document when every artboard is written in order), `eps`, `dxf`, `emf`, `wmf`, `hpgl` (a `.plt` plot file for plotters and cutters), `png`, `jpg`, `webp`, `gif`, `png8` (an indexed `.png`), `tiff`, `bmp`, `tga`, `psd` (layered), `txt` (the document's text), `vectorcraft` or `template` (a native template). The tool's `format` enum and `document.formats` list them, generated from the engine's format table. When `format` is omitted, it comes from the path's extension. PDF and `.ai` write one page per artboard: all of them, or `artboard` (0-based) / `range` (`"1-3, 5"`, 1-based). SVG and SVGZ write one file per chosen artboard. EPS writes one file of the visible art; with `artboard`, `range`, `options.artboards` or `options: {"useArtboards": true}` it writes one file per chosen artboard, after a central file of the visible art when there are two or more, and `useArtboards: false` keeps the one file. Rasters, DXF, EMF, WMF and HP-GL write one artboard, or one file per chosen artboard with `options: {"useArtboards": true}`. Rasters also take `options: {"rect": [x, y, width, height]}` (page points, y down): that area of the page at the given `ppi`/`scale`, without an artboard and without changing the document; it is refused with `artboard`, `artboards`, `range` or `useArtboards`, with a non-positive or non-finite size, and for non-raster formats. `options` carries more format options (e.g. `{"quality": 80}` for JPEG). `selection: true` exports the selected objects cropped to their bounds (the reply adds their `bounds`, and reports `format` and the encoder's `warnings` as a whole-document export does); `outlineText: true` writes SVG text as paths. Template layers are left out, live effects are kept, and exporting `vectorcraft` never changes the document's path. Without `path` the bytes come back as `dataBase64`. Both backends run the same `document.export` call. |
|
||||
| `add_text` | `{text, x?, y?, width?, height?, fit?, fitMinPercent?, path?, mode?, pathEffect?, size?, font?, color?, justify?, vertical?}` | Point type at (x, y) (`justify`: `left`, `center` or `right` starts, centres or ends each line on x); area type with `width`/`height` (`fit`: `none`, `autoHeight`, `shrinkText`, as `text.areaOptions`); or `path` + `mode` (`area`/`onPath`) to flow text in or along a path, with `pathEffect` for type on a path (`rainbow`, `skew`, `3dRibbon`, `stairStep`, `gravity`; SVG export writes type on a path with any effect other than `rainbow` as outlines, with a warning). An invalid effect is rejected before editing. `justify` (also `auto`, `justifyAll`) aligns the paragraphs of every kind, as `text.setStyle` does later. `vertical: true` uses the existing vertical writing mode for every kind (default `false`, horizontal). Returns `{id}`, with `overflow: true` when the text doesn't fit its frame or path. |
|
||||
@@ -889,7 +889,7 @@ ends the wait, so the sampler can be shown again. The BSDs and headless sessions
|
||||
| `transform` | `{ids?, dx?, dy?, rotate?, scale?, scaleX?, scaleY?, reflect?, shear?, origin?, copy?}` | Runs move, rotate, scale, reflect, shear in that order. `rotate` is in degrees counter-clockwise; a positive `shear` moves the top to the right. With `copy`, the first step duplicates. A `scale`, `reflect` or `shear` that its command would refuse returns that error before any step runs; nothing changes and no undo step is recorded. The same holds for a step that is neither a number nor null, a `reflect` that is not a string, a `copy` that is not true or false, and an `origin` that is not two numbers. A null `rotate`, `scale`, `scaleX`, `scaleY`, `shear`, `reflect`, `copy` or `origin` is left out; a null `dx` or `dy` counts as 0, so it still runs the move. |
|
||||
| `create_graph` | `{type?, x, y, width, height, csv? \| series?, categories?, rows?}` | The nine Illustrator graph types: column, stacked column, bar, stacked bar, line, area, scatter, pie and radar. An empty CSV cell or a `null` in `rows` is a blank value; a number in straight quotes is a label. Edit later with `graph.setData` / `graph.setType` via `run_command`. `graph.column {design, columnType: vertical\|uniform\|repeating\|sliding, each, fractions: chop\|scale}` draws the columns or bars of the series picked with Group Selection (or `seriesIndexes`, or all of them) with a graph design saved by `graph.design`; with no `design` it returns the series' current design and options. Type in the design that holds a `%` followed by two digits shows each column's value, with at least the first digit's places before the decimal point and the second digit's places after it. |
|
||||
| `text_wrap` | `{ids?, offset?, invert?, release?}` | Area type below the objects (same layer) flows around them. A type object in `ids` with another of them above it in its layer is the text to wrap, not a wrap object, so the objects and the type can be selected together. The reply has a `warning` when no area type lies below any of the wrap objects. `offset` is in points, from -1000 to 1000 (default 6). An offset outside that range or not a number, or an `invert` or `release` that is not true or false, is an error and changes nothing; `object.textWrap.make` and `object.textWrap.options` refuse the same values. |
|
||||
| `undo` / `redo` | `{}` | Many calls that change nothing record no undo step, for example `object.align` with nothing to move, `object.move` by 0 without `copy`, `path.moveAnchors` by 0, `layer.setProps` with every row already as given and `object.showAll` with nothing hidden. `undo` (`edit.undo`) after such a call undoes the step before it. Settings that change without an undo step stay as they are when `undo` or `redo` brings back a step that did not change them: the perspective grid's view options and active plane, the grid preferences (`gridlineEvery`, `gridSubdivisions`), the export settings (`assets.settings.set`), and the current brush and symbol. A step that changed one of them, such as a perspective grid preset that shows the grid, takes that change back. The point Automatic Plane Positioning holds comes back with the step, and is let go when the active plane kept is another one. `inspect_document` lists the undo steps as `history`. `run_command` with `edit.clearHistory` removes every undo and redo step of the active document and returns `{cleared}`, the number of steps removed; the document stays as it is, and the command records no undo step. `run_command` with `edit.newDocumentFromState` and `{index?, created?}` makes a new document holding the art as it was at that state and makes it the active document, and returns `{index, title}`. `index` is a row of the History panel, with 0 the oldest state kept, and an omitted or null `index` uses the current state. An `index` that names no state fails with `no history state N`, one that is not a whole number with `` `index` must be a whole number ``, and either changes nothing. `created` is File Info's created date in Unix seconds or null, and defaults to now. The new document takes the next `Untitled-N` name, is marked unsaved, has nothing selected and has no steps to undo or redo. It is out of symbol, opacity-mask and pattern editing, and the art drawn in a pattern's tile is stored in the pattern, as `object.pattern.done` stores it. The source document and its steps stay as they are, except that typing or a drag in progress is first kept as a step. When a command keeps a drag whose preview Real-time Drawing off had not applied yet (`edit.undo`, `edit.redo`, `edit.clearHistory`, `edit.newDocumentFromState` and the other commands that end a drag first), and applying that preview gives a warning, the command's result carries it as `previewWarning`, and as `warning` too when the command gives no warning of its own; the app's status bar shows `warning`. Any other command that changes the document during a tool's drag, from `run_command`, a panel or a menu, records its own undo step before the drag's. The command acts on the document without the drag's preview, and the drag then continues from the command's result: with Real-time Drawing on, the drag's preview is applied again at once, and with it off, the release applies it as before. The release records the drag's step after the command's, `undo` takes back the drag first and the command next, and Escape cancels only the drag. The drag acts on the objects it started with, so a selection the command makes (`select.all`, `edit.duplicate`) does not change what the drag moves, and the drag's release and Escape set the selection as they do without the command (with Real-time Drawing on, so does each move of the drag); a command that records no undo step, such as `select.none`, adds no step. When the command deletes or changes the art being dragged, the drag continues with the art the command left, and a drag left with nothing to change records no step. A warning or an error from the drag's preview applied again after the command is in the command's result as `previewWarning`. Typing in progress is kept as a step of its own before the command. Two cases run the command inside the drag, which then keeps the command's edit as part of its own step: a press of the Quick Pen (an edit to its path ends the path), and `object.transform` with `copy` during an Alt-drag, which copies the art as the drag's move left it. A command run while a dialog's or a panel's preview is open runs inside that preview. While the Type tool edits type, `undo` and `redo` put its caret, with no characters selected, at the end of the text the step changed: after the text it puts back or retypes, or where the text it takes out was. A step that changes no characters, such as a formatting change, leaves the caret and the selection where they are. |
|
||||
| `undo` / `redo` | `{}` | Many calls that change nothing record no undo step, for example `object.align` with nothing to move, `object.move` by 0 without `copy`, `path.moveAnchors` by 0, `layer.setProps` with every row already as given and `object.showAll` with nothing hidden. `undo` (`edit.undo`) after such a call undoes the step before it. Settings that change without an undo step stay as they are when `undo` or `redo` brings back a step that did not change them: the perspective grid's view options and active plane, the grid preferences (`gridlineEvery`, `gridSubdivisions`), the export settings (`assets.settings.set`), and the current brush and symbol. A step that changed one of them, such as a perspective grid preset that shows the grid, takes that change back. The point Automatic Plane Positioning holds comes back with the step, and is let go when the active plane kept is another one. `inspect_document` lists the undo steps as `history`. `run_command` with `edit.clearHistory` removes every undo and redo step of the active document and returns `{cleared}`, the number of steps removed; the document stays as it is, and the command records no undo step. `run_command` with `edit.newDocumentFromState` and `{index?, created?}` makes a new document holding the art as it was at that state and makes it the active document, and returns `{index, title}`. `index` is a row of the History panel, with 0 the oldest state kept, and an omitted or null `index` uses the current state. An `index` that names no state fails with `no history state N`, one that is not a whole number with `` `index` must be a whole number ``, and either changes nothing. `created` is File Info's created date in Unix seconds or null, and defaults to now. The new document takes the next `Untitled-N` name, is marked unsaved, has nothing selected and has no steps to undo or redo. It is out of symbol, opacity-mask and pattern editing, and the art drawn in a pattern's tile is stored in the pattern, as `object.pattern.done` stores it. The source document and its steps stay as they are, except that typing or a drag in progress is first kept as a step. When a command keeps a drag whose preview Real-time Drawing off had not applied yet (`edit.undo`, `edit.redo`, `edit.clearHistory`, `edit.newDocumentFromState` and the other commands that end a drag first), and applying that preview gives a warning, the command's result carries it as `previewWarning`, and as `warning` too when the command gives no warning of its own; the app's status bar shows `warning`. Any other command that changes the document during a tool's drag, from `run_command`, a panel or a menu, records its own undo step before the drag's. The command acts on the document without the drag's preview, and the drag then continues from the command's result: with Real-time Drawing on, the drag's preview is applied again at once, and with it off, the release applies it as before. The release records the drag's step after the command's, `undo` takes back the drag first and the command next, and Escape cancels only the drag. The drag acts on the objects it started with, so a selection the command makes (`select.all`, `edit.duplicate`) does not change what the drag moves, and the drag's release and Escape set the selection as they do without the command (with Real-time Drawing on, so does each move of the drag); a command that records no undo step, such as `select.none`, adds no step. When the command deletes or changes the art being dragged, the drag continues with the art the command left, and a drag left with nothing to change records no step. A warning or an error from the drag's preview applied again after the command is in the command's result as `previewWarning`. Typing in progress is kept as a step of its own before the command. Two cases run the command inside the drag, which then keeps the command's edit as part of its own step: a press of the Quick Pen (an edit to its path ends the path), and `object.transform` with `copy` during an Alt-drag, which copies the art as the drag's move left it. A command run while a dialog's or a panel's preview is open runs inside that preview, except during an add-on dialog's preview (Object › Plug-ins, other than Edit Points Only): there a command that changes the document records its own undo step, acts on the document without the preview using the shown selection restricted to objects present in that document, and stays after the dialog's Cancel or OK. A shown selection containing only preview objects becomes empty for the command. A path whose selected anchors or segments the preview renumbered (Set Corners recut it) is left out of that selection, so Clear does not delete its points. A command that is refused leaves the dialog's selection as it was. The dialog previews again from the command's result and selection, including after a failed preview when only the selection changed. An outside selection command's selection and paint defaults stay together afLine truncated
|
||||
| `agent_folders` | `{}` | Where VectorCraft opens and saves files for this session: `{read_folder, write_folder}`, each a path or `null`. In the open window, the agent folders of Preferences › AI Integrations (`Documents/ArtCraft/Agents/VectorCraft` for an empty one); in a headless session started for agents, the folders it was confined to (`read_folders` / `write_folders` list them all when a kind has several); a session started without automation roots answers `unrestricted: true`. An app reached with the deprecated `--connect` answers an error: its own `--automation-*-root` flags, if any, confine it. |
|
||||
|
||||
For example, create editable Japanese area type with the engine's vertical writing mode:
|
||||
@@ -3317,7 +3317,7 @@ through `$`:
|
||||
or layer that keeps other objects that are not ruler guides. `removeAll()` on the `pathItems` of a compound path that is such a clipping
|
||||
path throws the same way, since it would leave the clipping path empty. The document's `pathItems.removeAll()` still deletes the paths of a group that
|
||||
is the clipping path when a visible text object that lays out glyphs stays inside that group, because the text then
|
||||
clips. Text beside the clipping path in the clipping group does not count. Hidden text, text
|
||||
clips. A visible image or placed document inside that group keeps it clipping by its frame too, when the frame encloses an area. When deleting the paths makes a live geometry effect, such as an Offset Path inset, leave no clipping region where there was one before, `removeAll()` throws and deletes nothing. A region that the effect already left empty before the call does not count as such a change; the call still throws when no clipping geometry stays in the mask. Text beside the clipping path in the clipping group does not count. Hidden text, text
|
||||
in a hidden group, blank text without a list marker, area text too short for its first line, and text that a clipping group nested in
|
||||
the mask clips do not keep it clipping, so `removeAll()` then throws and deletes nothing. `remove()` on an object that
|
||||
is hidden or locked, is inside a hidden or locked layer or group, or is a group that holds one, and `removeAll()`
|
||||
@@ -4642,7 +4642,11 @@ https://www.indesignjs.de/indesignapi/illustrator/illustrator.d.ts describe it.
|
||||
`CMYKColor`, `GrayColor` or `LabColor`; anything else throws a `TypeError`, and a component out of its range throws a
|
||||
`RangeError`. The rest of this paragraph gives VectorCraft's own rules. OK returns the color picked; in the app,
|
||||
when the run's active document (a document the script made included) is in CMYK, an RGB pick is returned as CMYK, so
|
||||
the color's `typename` can differ from the picker's model and from the color given. An answer taken from `answers`
|
||||
the color's `typename` can differ from the picker's model and from the color given. RGB values typed into the
|
||||
picker convert from the RGB profile of the document the window shows (the working RGB profile when it shows none) to the RGB profile of the run's active
|
||||
document, and in a CMYK document they then separate through that document's CMYK profile. Hex, screen-sample and HSB
|
||||
picks, and typed values that Only Web Colors snaps, start in display sRGB and convert only through the active
|
||||
document's profiles. An answer taken from `answers`
|
||||
keeps the color model it was given. The picker opens on the color as
|
||||
given, whatever Only Web Colors was left at in another picker. OK with both the color and its model unchanged, and Cancel, return a new object of the color the
|
||||
script gave. The picker shows no preview on the selection and has no Stop button: the status bar's Stop and quitting
|
||||
@@ -7009,6 +7013,55 @@ already walks Image Trace. Short agent entry points:
|
||||
nothing, and a built-in preset's name, `Custom` or another saved preset's name keeps the editor open. Delete selects
|
||||
the saved preset below the deleted one, else the one above it, else Default. Import… asks whether to replace saved presets whose names the file holds (Cancel
|
||||
keeps them), and Export… writes every saved preset.
|
||||
- Concept to Vector: `conceptVector.providers` lists the providers that `conceptVector.generate` can call by id, with
|
||||
their styles. The built-in `offline.traceStyles` makes the styles `outline`, `inkLines`, `flatColor`, `detailedColor`
|
||||
and `grayTones` with Image Trace on this computer; it takes no prompt and makes vector art only. A provider is used
|
||||
only when it is named: an unknown one is an error, and so is one that takes no image, makes no vector art, or does
|
||||
not support a non-empty `prompt`, each with that reason; no other provider is used in its place. Results are vector
|
||||
art, so `output` other than `"vector"` is an error for every provider. `flatColor` traces abutting fills and lays
|
||||
seam fills under them, as Image Trace's Abutting method with Fills does, when they fit within the limits below.
|
||||
`conceptVector.generate {id?, provider, styles: [style id…], detail?: 0-100, prompt?, output?: "vector"}` makes one
|
||||
variation of the image (or unexpanded Image Trace object) for each of 1 to 8 different styles and keeps them as a job of
|
||||
the session; it does not change the document and is not journaled. A source that is locked or hidden, itself or by a
|
||||
layer or group around it, or that is on a locked artboard, is refused. Results are
|
||||
checked whatever provider made them: one variation per style in the order asked, every point finite and near the
|
||||
image, every subpath with an anchor point, at most 250,000 paths (each subpath of a compound path counted as one)
|
||||
and 1,000,000 anchor points in all. The reply lists each variation's `style`, `label`,
|
||||
`paths`, `anchors`, `bounds` in the image's pixels and `warnings` (for example that a large image was traced scaled
|
||||
down to 16 megapixels). `conceptVector.results {job}` returns the job again, and `conceptVector.cancel {job}` drops
|
||||
its variations. The session keeps the 4 newest jobs until their document closes. A `conceptVector.generate` in a
|
||||
script stops when the script is asked to stop, and keeps no job. A script that ends with an error,
|
||||
like a batch, leaves the jobs as they were: the jobs it made are dropped, and a job it canceled, or whose document it
|
||||
closed, is kept.
|
||||
`conceptVector.insert {job, variations: [style id…]}` puts a group of each chosen variation, named after its style and
|
||||
in the provider's order, to the right of the image, each the image's size with 24 pt between them, moved further
|
||||
right past other visible art, also where a variation reaches past its image-sized box (the next one then starts 24
|
||||
pt past what it paints); it is one undo step and selects the groups. A variation with no paths is left out, and when
|
||||
every chosen one has none, nothing changes (no undo step, `ids` empty). The groups go above the outermost clip group or
|
||||
opacity-masked group around the image, so that it does not hide them, and above the outermost envelope, blend,
|
||||
repeat or other live object, the outermost group whose members it makes or places (a graph, an Objects on Path,
|
||||
Shaper, dimension, flare or Live Paint group, a compound shape), and the outermost group with effects or fills and strokes of its
|
||||
own, around it, whose content stays as it is. It is an error when the job was canceled or dropped, when its document
|
||||
is not the active one, when the object, its pixels or its placement changed, when the object is now locked or hidden,
|
||||
or when it is on a layer with a clipping mask, an opacity mask, or effects, fills or strokes of its own, or when the
|
||||
object or a group around it has effects that move or reshape it (Transform, a warp), which show the image away from
|
||||
its placement, or when its image is distorted (Perspective Distort or Free Distort) and drawn at its corners instead
|
||||
of by its transform. Jobs are not saved, so an insert or a cancel played from recorded steps (an action, a journal played
|
||||
again, or a step of a batch played again) is an error too. Example, where insert takes the `job`
|
||||
that generate returned (job numbers count up through the session, so 1 only for its first job):
|
||||
|
||||
```json
|
||||
{"command": "conceptVector.generate", "params": {"provider": "offline.traceStyles", "styles": ["outline", "flatColor"], "detail": 60}}
|
||||
{"command": "conceptVector.insert", "params": {"job": 1, "variations": ["flatColor"]}}
|
||||
```
|
||||
|
||||
In the app, `ui.conceptVector` opens the Concept to Vector panel, which runs the same commands; Generate shows a progress bar
|
||||
and Cancel. On the desktop it runs off the UI thread unless `VECTORCRAFT_SYNC_OPEN` is set, in which case it runs at
|
||||
once on the UI thread; the web build runs it on the UI thread one part a frame, and
|
||||
Cancel takes effect before the next part. `ui.conceptVector.generate` does what Generate does and returns
|
||||
`{running: true}` while the styles are made, else `{running: false, job}`; `ui.conceptVector.cancel` does what Cancel
|
||||
does. A Generate after a Cancel starts once the canceled run's thread has ended. The panel shows a job's results only
|
||||
while the document it was made in is the active one, and a preview that leaves part of its variation out says so.
|
||||
- Live Paint: `livePaint.make`, `livePaint.merge`, `livePaint.fill {group?, point}`, `livePaint.strokeEdge`,
|
||||
`livePaint.info {group?|id?}`, `livePaint.release`, `livePaint.expand`, and `livePaint.gapOptions {ids?, detect?, size?,
|
||||
color?, closeGaps?}` (Object › Live Paint › Gap Options). Make gives each covered face the fill rows that draw of
|
||||
@@ -7544,6 +7597,11 @@ limits, so art too complex for the shaded surface does not refuse the wireframe.
|
||||
{"name":"run_command","arguments":{"command":"effect.setParams","params":{"index":0,"item":null,"params":{"render":{"mode":"rendered","quality":"high","background":"white"}}}}}
|
||||
```
|
||||
|
||||
The 3D and Materials panel's Render Settings › Raster Settings dialog sets resolution and background on the objects
|
||||
selected when the dialog opened. OK applies the changes in one undo step and records nothing when nothing changes.
|
||||
When there are changes to apply, OK keeps the dialog open with the reason while its document is not active, after it was reverted or had an Undo,
|
||||
a Redo or a canceled edit that put back an earlier state, if one of those objects was changed, deleted, locked or hidden, or while another edit is in progress.
|
||||
|
||||
## 3D material
|
||||
|
||||
Revolve, Extrude & Bevel, Inflate and Rotate take `material`, an object with `roughness` (0..1, default 1) and
|
||||
@@ -9430,6 +9488,14 @@ is not a whole number of 0 or more, such as 1.5, -1 or "1" ("`subpath` must be a
|
||||
an `anchor` or `segment` in the same way. The document does not change and no undo step is recorded.
|
||||
`path.moveAnchor` to the point the anchor is at, and `path.setHandle` to the point the handle is at on an anchor that
|
||||
keeps its kind, leave the document as it is and record no undo step.
|
||||
`path.convertAnchor`, `path.reshapeSegment`, `path.setHandle`, `path.moveAnchor`, `path.insertAnchor` and
|
||||
`path.removeAnchor` also take the `id` of type on a path outside perspective and edit its path in document space, so
|
||||
the Anchor Point, Add Anchor Point and Delete Anchor Point tools, the Pen with Alt and the Pen's Auto Add/Delete work
|
||||
on selected type on a path as on a path (#10862); the type lays out again along the edited path, and its brackets keep
|
||||
their fractions of the path. `path.removeAnchor` refuses to leave the type's path with fewer than two anchors, and an
|
||||
edit that would put it past the canvas is refused; the document does not change. `path.insertAnchor` leaves the type
|
||||
selected whole, with no direct-selected anchors, so the arrow keys and `path.moveAnchors` move the whole type. The
|
||||
Scissors tool does not cut type on a path.
|
||||
On a path with Live Corners that store a radius (rounded, or straightened by an earlier move), `path.moveAnchor` and
|
||||
`path.moveAnchors` (and the arrow keys) move the uncut corner
|
||||
each moved anchor belongs to by the drag delta and cut the corners again at their radii. The corners stay live; a live
|
||||
@@ -11825,7 +11891,8 @@ be one of …", and a `visible` that is not true or false fails with "`visible`
|
||||
every group as it is. The groups and their contents are VectorCraft's own.
|
||||
`window.taskBar.actions {action, visible?}` (desktop app) turns one of the Contextual Task Bar's actions or chips on
|
||||
(`visible: true`), off (`false`) or toggles it (omitted or null), and returns `{action, visible}`. The actions are `imageTrace`,
|
||||
`cropImage`, `removeBackground`, `removeAnchorPoints`, `join` (Connect and Join), `cutPath`, `convertToCorner`,
|
||||
`cropImage`, `removeBackground`, `conceptToVector` (Concept to Vector), `removeAnchorPoints`,
|
||||
`join` (Connect and Join), `cutPath`, `convertToCorner`,
|
||||
`convertToSmooth`, `group`, `makeClippingMask`, `unite`, `expand`, `editClippingPath`, `releaseClippingMask`,
|
||||
`ungroup`, `isolate`, `editPath`, `releaseCompoundPath`, `createOutlines`, `convertToPointType`, `convertToAreaType`,
|
||||
`typeOnPathOptions`, `centerOnTop`, `centerOnBottom`, `dynamicText`, `offsetPath`, `simplify`, `smooth`, `duplicate`,
|
||||
@@ -12019,7 +12086,8 @@ Placement does not trim composite font or character set names as `type.composite
|
||||
effective ppi. `file.place.queue` loads the place cursor (the `place` tool) with several files: headless, drive it
|
||||
with `pointer_gesture` (a click places at 100% with the top-left corner there, a drag at the dragged size) and
|
||||
`press_key` (Left/Right/Up/Down cycle, Escape discards the current file). The place tool's state includes a
|
||||
read-only `sourceIndex`: the current file's zero-based position in the original load, or null when empty.
|
||||
read-only `sourceIndex`: the current file's zero-based position in the original load, or null when empty, and a
|
||||
read-only `total`: how many files the load held (0 when empty), which the app's cursor shows as `count/total`.
|
||||
It stays with that file when other files are placed or discarded; `current` indexes the remaining files.
|
||||
In the app, same-named files also keep their own queued size and password requirement. Choosing another PDF
|
||||
page after a cursor click places that page at its own size; a drag keeps the chosen box.
|
||||
@@ -12862,7 +12930,10 @@ no linked file, and `warnings` carries "an image couldn't be decoded and is miss
|
||||
images.
|
||||
|
||||
DWG drawings open and place (see DXF import) but can't be written: `document.formats` lists `dwg` and `dwt` as
|
||||
readable and not writable, and exporting to `dwg`, `dws` or `dwt` answers with the hint to export DXF. PICT files open and place (see PICT
|
||||
readable and not writable, and exporting to `dwg`, `dws` or `dwt` answers with the hint to export DXF. Web builds and
|
||||
FreeBSD on 64-bit ARM have no DWG decoder: there `document.formats` lists `dwg` and `dwt` as neither readable nor
|
||||
writable, File › Open, File › Place and `openExtensions` list `.dwg`, `.dws` and `.dwt` only for an installed importer
|
||||
plug-in that reads them, and a DWG drawing opens or places only through such a plug-in. PICT files open and place (see PICT
|
||||
import) but can't be written.
|
||||
|
||||
```json
|
||||
@@ -12893,7 +12964,7 @@ transparency resolve through layers and blocks. What is left out (viewports, ima
|
||||
vertices are missing, unknown entities) is listed in `warnings`. ASCII and binary DXF files are read.
|
||||
|
||||
DWG drawings (by content or the `.dwg` extension) open, place and answer `document.dxfInfo` the same way, with the
|
||||
same `dxf` options: craft-dwg converts the drawing to DXF (acadrust 0.6.6, MPL-2.0) and the DXF reader reads that.
|
||||
same `dxf` options, in builds with a DWG decoder (not web builds or FreeBSD on 64-bit ARM): craft-dwg converts the drawing to DXF (acadrust 0.6.6, MPL-2.0) and the DXF reader reads that.
|
||||
Drawing standards files (`.dws`) are read as DWG drawings, and drawing templates (`.dwt`, format `dwt`) too, except
|
||||
that a template opens as a new untitled document.
|
||||
In the desktop app and `vectorcraft-cli` the conversion runs in a copy of the program started with `--dwg-worker`, so
|
||||
@@ -12966,7 +13037,7 @@ downloads each image instead and links none).
|
||||
clip?}` decides how a relinked or updated file takes an image's place (default `bounds`: stretched into the old
|
||||
bounds; `clip` puts it in a clip group of the old bounds when it is larger).
|
||||
MCP clients must reopen the Placement Options dialog (`ui.placementOptionsDialog`) before confirming again after
|
||||
Undo, Redo, or a revert in the document where it opened.
|
||||
Undo, Redo, a canceled edit that put back an earlier state, or a revert in the document where it opened.
|
||||
The UI commands `links.editOriginal` and
|
||||
`links.reveal` open the linked file in its app or show it in its folder (desktop). Edit Original runs only from the app's window,
|
||||
except for a placed document, which opens in a tab. With the preference `editOriginalSystemDefaults` (Preferences ›
|
||||
@@ -13604,8 +13675,10 @@ and `embedIcc` (sRGB, the working CMYK profile or grey). BMP takes `depth` (1 is
|
||||
palette chosen by `reduction` and `dither`; 16, 24, or 32, which keeps transparency), `colorModel` (`rgb` or `gray`),
|
||||
`fileFormat` (`windows` or `os2`: 1, 4, 8 or 24 bits only), `rle` (RLE4/RLE8 for 4- and 8-bit Windows bitmaps) and
|
||||
`flipRows` (rows top-down, a negative height; not with `rle` or `os2`); impossible combinations are refused. Targa
|
||||
takes `depth`: 16 (a one-bit alpha), 24 (default) or 32 (with alpha). Formats and depths without alpha are flattened
|
||||
on white. TIFF, BMP and Targa files open again (a 16-bit Targa file with its one-bit alpha); `document.formats` lists
|
||||
takes `colorModel` (`rgb`, true color, or `gray`, grayscale) and `depth`: with `rgb` 16 (a one-bit alpha), 24 (default)
|
||||
or 32 (with alpha); with `gray` 8 (default) or 16 (an 8-bit alpha). Formats and depths without alpha are flattened on
|
||||
white. TIFF, BMP and Targa files open again (a 16-bit RGB Targa file with its one-bit alpha, a 16-bit gray one with its
|
||||
8-bit alpha); `document.formats` lists
|
||||
every option.
|
||||
|
||||
```json
|
||||
@@ -17525,6 +17598,9 @@ without `spacing` are errors that change
|
||||
nothing, and a call that changes no blend records no undo step. With no blend selected and no `id`, the call sets the
|
||||
spacing and orientation new blends start with. The Blend panel's Ramp and Shift sliders run it on the selected blends:
|
||||
a drag previews and its release records one undo step. Blend Options sends only the spacing or orientation set in the dialog.
|
||||
While Blend Options previews a selected blend, the canvas of the current window is not dimmed under the dialog, and the
|
||||
wheel over it still scrolls the view. Other dialogs with a Preview box on the canvas (envelope, path, Flare Tool,
|
||||
Justification, Proof Setup, Swatch Options, add-on and command dialogs) work the same way.
|
||||
|
||||
`object.blend.setEasing {id?, easingType?, ramp?, colorShift?}` sets one blend's easing and color shift (the
|
||||
first selected blend without `id`) and returns `{id, easingType, ramp, colorShift, changed}`; omitted values are kept.
|
||||
@@ -17897,7 +17973,9 @@ envelopes, graphs, symbols), are left out.
|
||||
- `addon.cleanup.check {scope?, kinds?}` changes nothing and lists `findings`: for each kind found, its `count`, the
|
||||
`ids` of the objects it is on (at most 1,000) and, for empty artboards, their indexes.
|
||||
- `addon.cleanup.show {kind, scope?}` selects the objects with that issue.
|
||||
- `addon.cleanup.fix {scope?, kinds?}` fixes the issues as one undo step and reports how many of each kind it fixed.
|
||||
- `addon.cleanup.fix {scope?, kinds?}` fixes the issues as one undo step and reports how many of each kind it fixed. When the fixes would delete the
|
||||
artboard an open Create Font Sheet… dialog uses, it returns an error and fixes nothing; close the dialog or leave
|
||||
`emptyArtboards` out of `kinds`.
|
||||
The kinds run in a fixed order, so art removed by one kind can leave a group that a later kind unwraps, and they
|
||||
run again (three rounds at most) while a round still fixes something.
|
||||
|
||||
@@ -19457,8 +19535,8 @@ enabled only when a selected image has a mask. → `{changed, ids}`
|
||||
|
||||
## Type Tools add-on
|
||||
|
||||
Type Tools is a built-in add-on for type: its commands are `addon.type.textTweaker`, `addon.type.releasePath` and `addon.type.numbers`, and
|
||||
in the desktop app it lives in Object › Plug-ins › Type Tools (#4924, #5532). Text Tweaker gives one character attribute to the characters letter by letter,
|
||||
Type Tools is a built-in add-on for type: its commands are `addon.type.textTweaker`, `addon.type.releasePath`,
|
||||
`addon.type.fontSheet` and `addon.type.numbers`, and in the desktop app it lives in Object › Plug-ins › Type Tools (#4924, #5532). Text Tweaker gives one character attribute to the characters letter by letter,
|
||||
from a start value to an end value along a shape, as one undo step; the text stays live and editable. Each value is set
|
||||
as `text.setRangeStyle` sets it (the Character panel), in its units and ranges ([formatting type](https://helpx.adobe.com/illustrator/using/formatting-type.html)), so on scaled
|
||||
type it is the size shown.
|
||||
@@ -19522,6 +19600,67 @@ Path Options' Preview does (#5360).
|
||||
{"name":"run_command","arguments":{"command":"addon.type.releasePath","params":{"mode":"path","keepOriginal":true}}}
|
||||
```
|
||||
|
||||
### Create Font Sheet
|
||||
|
||||
`addon.type.fontSheet` makes a font specimen sheet in the active document: a line of sample text set once in each
|
||||
font family the font menus list (the bundled, added and installed fonts), each entry labeled with its font's name, so
|
||||
the fonts can be compared on the artboard or printed.
|
||||
|
||||
- **Entries** are point type, one per family in the font menus' order (or in the order `families` gives), each named
|
||||
after its font. With `labels` on, an entry starts with a line naming its font in the document's normal type font, at
|
||||
the sample's size up to 9 pt, and the sample follows on the next line. With `allStyles` each style of a family gets
|
||||
its own entry, labeled with the family and style; otherwise the family's Regular is used, else its closest style.
|
||||
- **Layout:** the entries flow down the columns of the active artboard (or the one `artboard` names), inside `margin`, with `gap` between entries
|
||||
and between columns. Every line is aligned left, right-to-left samples too, so each starts at its column's left
|
||||
edge. A sample wider than its column runs on past it. When the artboard is full, the sheet continues
|
||||
on new artboards of the same size to the right of the rightmost artboard, 20 pt apart; with `newArtboards` off the
|
||||
later pages are laid out in the same places without artboards. A document without artboards lays the sheet out on a
|
||||
612 × 792 pt page at the origin and adds no artboards.
|
||||
- **Fonts that don't load:** a family whose font can't be loaded (text in it would be drawn in the fallback font), or
|
||||
with `allStyles` a style that can't (it would be drawn in the family's closest style), is left out, listed in
|
||||
`skipped` and named in `warning`, which the status bar shows. A composite font is left out the same way when a part
|
||||
that sets the sample text names a font or style that can't be loaded.
|
||||
- **Missing glyphs:** an entry whose font lacks a glyph needed by the sample text stays on the sheet, and is listed
|
||||
in `fallback` and named in `warning`.
|
||||
- Each row is as tall as the tallest laid-out entry needs, so a composite font whose part enlarges or raises the
|
||||
sample does not overlap the entry above it or reach into the margin.
|
||||
- The sheet is one group named Font Sheet, made in one undo step and selected. It goes where new art goes: the current
|
||||
layer, or, when that layer is locked or hidden, the topmost layer that is shown and unlocked. Nothing changes, and an
|
||||
error is returned, when no family matches, when there would be more than 5000 entries, when no font loads, when the
|
||||
margin, gap and columns leave no room for one entry, or when no layer is shown and unlocked.
|
||||
|
||||
| Parameter | Values (default) |
|
||||
|---|---|
|
||||
| `text` | one line of sample text, at most 1000 characters, without line or paragraph breaks or other control characters (`The quick brown fox jumps over the lazy dog`) |
|
||||
| `size` | the sample's size, pt 1…1296 (12) |
|
||||
| `filter` | only the families whose name contains this text, in any case; empty: every family |
|
||||
| `families` | instead of `filter`: these family names, in this order; each must be available and named once. Giving both is an error, even with an empty `filter` |
|
||||
| `allStyles` | false; true: one entry for each style of each family |
|
||||
| `labels` | true; false: the sample alone |
|
||||
| `columns` | whole number 1…50 (2) |
|
||||
| `gap` | pt 0…1000, between entries and between columns (12) |
|
||||
| `margin` | pt 0…1000, inside each page (36) |
|
||||
| `newArtboards` | true; false: the pages after the first get no artboards |
|
||||
| `artboard` | 0-based index of the artboard the first page is laid out on (the active artboard) |
|
||||
| `activeArtboard` | the journal records the active artboard here when `artboard` is left out, so a replay uses the same artboard; `artboard` goes ahead of it, and an action leaves it out |
|
||||
|
||||
In `addon.type.fontSheet`, a parameter given as `null` is the same as one left out and takes its default; any other
|
||||
value of the wrong type or out of range is an error. While the Create Font Sheet… dialog is open, Delete Artboard, Cut
|
||||
Artboard, Delete Empty Artboards and Artwork Cleanup's Empty Artboards return an error and change nothing when they
|
||||
would delete the artboard the dialog opened on, and so does a running script's `vc.run` of one of them (a script
|
||||
that does not catch the error ends with it); close the dialog first.
|
||||
|
||||
→ `{id, count, skipped: [family, or family and style…], fallback: [entry name…], artboards: [index…] (the artboards added), warning?}`.
|
||||
`fallback` lists entries kept on the sheet whose font lacks a glyph needed by the sample. Create Font Sheet… opens a dialog
|
||||
(`ui.menuDialog {command}`) whose fields are the command's parameters except `families`, `artboard` and `activeArtboard` (it lays the sheet out on the artboard that was active when it opened), with Preview, which starts
|
||||
off: switched on, it sets the whole sheet again after each change. OK is off while the sample text is empty. Plug-ins can't call the command, since the sheet lists the installed fonts as
|
||||
`text.fontList` does.
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"addon.type.fontSheet","params":{"text":"Hamburgefonstiv","size":18,"filter":"sans"}}}
|
||||
{"name":"run_command","arguments":{"command":"addon.type.fontSheet","params":{"families":["Inter","JetBrains Mono"],"allStyles":true,"columns":1}}}
|
||||
```
|
||||
|
||||
### Make Numbers Sequence
|
||||
|
||||
`addon.type.numbers` numbers the type objects among `ids` (or `id`, else the selection), groups included, from `start`
|
||||
|
||||
Reference in new issue
Block a user