edit#
Group authoring writes into one commit and one editor Undo step: with plupy.edit("Place crates"):.
| Parameter | Type | Meaning |
|---|---|---|
label | str | Human-readable Undo label |
Entering the context manager yields None. Reads inside the group include staged changes. Normal exit validates and commits the group; exiting through an exception discards it.
- Nested edit groups are rejected with
PlupyError. - A rejected host write fails the entire group, even if the script catches the error.
- Read-only lookup failures do not by themselves mark a group failed.
- Stop, project close or an unfinished invocation discards its open group.
- Earlier committed edits remain when a later group fails. Python variables, files and subprocess side effects are outside authoring rollback.
- External authoring changes during a run reject subsequent stale requests; rerun against current data.
Without a group, each successful assignment or editing method commits immediately. Editor commits participate in Undo. Headless commits save immediately; their in-memory Undo history ends when the process exits. There is no extra save() call.
For a script that creates or changes many items together, use one edit group to share the final save and Undo step. Each write is still validated and immediately visible to subsequent reads; grouping does not make scene construction a single bulk operation.
edit(label)Usage and examples
Related types#
Source#
- _live.py:2272