Scripting API
Editing the stack
from ArtisanPlugin.Scripting import ReliefApi as relief
Once a relief project exists, its stack can be reworked without rebuilding it: mute a layer to compare two versions of a signet face, drop a texture below the dome it was meant to modulate, or throw the whole recipe away and start again. Every one of these calls edits the document’s saved project and writes it straight back, so run them inside a Transaction for one-step undo.
All four operation-level methods take the operation id — the Guid returned by an Add* call or read from Operations()[i].Id. It is not a document object id. An id that is not in the stack throws No relief operation with id <id>; see ReliefApi.Operations()., and every one of them throws This document has no relief project; create one with SetupProject/Add* or the ArtisanRelief command. when there is no project at all.
Enable or disable an operation
relief.SetOperationEnabled(operationId, enabled)
| Parameter | Default | Meaning |
|---|---|---|
operationId | — | The operation id |
enabled | — | False mutes the layer, True restores it |
Returns nothing. This is the panel’s eye toggle: a disabled operation stays in the stack, keeps its index and its combine mode, and is skipped when the height field is evaluated — so it neither contributes to the bake nor fails it if its references have gone missing.
Change how an operation merges
relief.SetOperationCombine(operationId, combine)
| Parameter | Default | Meaning |
|---|---|---|
operationId | — | The operation id |
combine | — | "Add", "Subtract", "ZMax", "ZMin", "Absolute" or "Multiply" — case-insensitive; unknown names throw listing the vocabulary |
Returns nothing. The mode describes how this layer merges into whatever the operations below it have already built, so the same mode on the same layer gives a different result at a different index. The full vocabulary is on The project stack.
Reorder an operation
relief.MoveOperation(operationId, newIndex)
| Parameter | Default | Meaning |
|---|---|---|
operationId | — | The operation id |
newIndex | — | The target position; 0 is applied first |
Returns nothing. The operation is lifted out of the stack and re-inserted at newIndex, so the indices of everything between shift by one — read Operations() again rather than assuming the other positions held.
newIndex is validated against the stack before the operation id is looked up: outside 0 … OperationCount - 1 it throws newIndex must be between 0 and <n>., so a bad index is reported even when the id is also wrong.
Remove an operation
relief.RemoveOperation(operationId)
| Parameter | Default | Meaning |
|---|---|---|
operationId | — | The operation id |
Returns nothing. The layer is dropped and everything above it shifts down one index; the id is gone for good. Removing the last remaining operation leaves the project with an empty stack — the project itself survives, workbench settings included, ready for the next Add*. Deleting the saved project entirely is ClearProject.
Clear the project
relief.ClearProject()
Takes no parameters and returns nothing. It deletes the document’s saved relief project outright — settings, workbench and every operation, including the sculpt and smooth layers painted in the panel. There is nothing to confirm and no error when the document had no project.
Meshes already produced by Bake() are ordinary Rhino meshes with no link back to the project, so they are left exactly where they are.