mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-29 01:34:29 +01:00
A plug-in of the new kind `generator` draws art from its parameters alone. plugin.generate runs it and adds its art as a generated art object: a group that keeps the plug-in's id and name, the parameters and the transform since the art was drawn. Object › Plug-ins lists each generator, and Object › Plug-ins › Edit Generated Art… (plugin.editGenerated) runs it again with changed parameters and replaces the art as one undo step, placed, stroke-scaled and pattern-transformed as the old art was. Parameters that change nothing run nothing and make no undo step. Object › Expand makes the object an ordinary group. plugin.generatedInfo reports an object's plug-in, parameters and state. - Given parameters are checked against the manifest: an undeclared name, a number outside its range (each number of a numberList too) and text past its maxLength are errors. Parameters are capped at 64 KiB of JSON, art at 16 MiB, and the output is checked before the document changes. - The native file keeps the plug-in id, name, parameters, transforms, scales and a SHA-256 of the art's JSON. Opening a file never runs a plug-in: a missing plug-in, a plug-in of another kind, a damaged saved field or a hash mismatch keeps the art as the file has it. The open's warnings name the plug-in, except for damaged fields, which get one warning that names no plug-in. A damaged object stays damaged when saved again. - plugin.run of a generator is an error naming plugin.generate. - import_fuzz replaces each saved field with arbitrary JSON. Docs: docs/plugins.md (Generators), docs/mcp.md, docs/target-app-parity.md.