construct::opal::DefinitionAddTask
OPAL task construct.definition.add: create a new SDF definition in the active document from its own GLSL.
| Declared in | src/libs/libconstruct/construct/opal/DefinitionAddTask.hpp |
| Inherits | construct::opal::ConstructMutationTask |
| Group | construct |
Detailed description
The task takes the new definition in one of two forms (construct-definition-editor §DUO-2), and a call gives exactly one:
- definition, a map with at least an id. - source, the record text. It goes through the load path of a record, so its comments and the keys that the definition does not model stay.
It checks the data first, and fails with the state unchanged when both forms or neither are given, the text does not parse, or the GLSL does not compile. The change goes through the document's operation executor as a DefinitionAdd operation on the main thread, so it can be undone. The definition lives in the document. The task construct.definition.publish copies it to the user library.
See also DefinitionUpdateTask, DefinitionGetTask, DefinitionValidateTask.