command
knob_values(values)
Context manager to set knob values temporarily.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values | dict[Knob, Any] | Dictionary of knob and value pairs to set. | required |
Returns:
| Type | Description |
|---|---|
None | Generator to yield the context manager. |
Source code in client/ayon_nuke/api/command.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
undo_chunk(name='')
Context manager to wrap multiple actions into a single undo chunk.
The name of the undo chunk can either be given when entering the block, or updated later using the nuke.Undo.name(name) method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | Name of the undo chunk. | '' |
Examples:
As a context manager:
>>> with undo_chunk("Load Image"):
>>> # do multiple actions here
>>> ...
As a decorator:
>>> @undo_chunk("Load Image")
>>> def load_image():
>>> # do multiple actions here
>>> ...
Source code in client/ayon_nuke/api/command.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
viewer_update_and_undo_stop()
Lock viewer from updating and stop recording undo steps
Source code in client/ayon_nuke/api/command.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |