Named undo blocks#279
Conversation
There was a problem hiding this comment.
best to view this without whitespace.
Most of the lines only have an change in indentation
BigRoy
left a comment
There was a problem hiding this comment.
Nice, I like it.
Is there a reason why you only updated load_clip.py and not the other loaders?
|
|
||
|
|
||
| @contextlib.contextmanager | ||
| def undo_step(name: str = ""): |
There was a problem hiding this comment.
Where does the step terminology come from?
If just something you came up with - can we make it chunk instead? Only reason is then at least it matches with ayon-maya and ayon-fusion, ayon-silhouette, ayon-cinema4d
| @@ -180,59 +180,59 @@ def load(self, context, name, namespace, options): | |||
| inpanel=False | |||
| ) | |||
|
|
|||
There was a problem hiding this comment.
Previously this also stopped the active viewer. Is it safe without that? @jakubjezek001
| name = container.get("name") or read_node.name() | ||
| name = f"Update: {name} v{old_version} -> v{version_name}" | ||
| nuke.Undo.name(name) | ||
|
|
| if version := container.get("version"): | ||
| undo_name = f"Remove: {name} v{version}" | ||
| else: | ||
| undo_name = f"Remove: {name}" |
There was a problem hiding this comment.
Let's simplify this - I really would like to remove version as container data in Nuke in time anyway - it's not standard practice to have that imprinted. So let's avoid using it here.
Let's name it purely by the name here.
Changelog Description
wrap
load,updateanddeleteinto named undo stepsAdditional review information
This PR adds a new context manager which can be used to wrap functions into a single named Undo-Step.
This improves readability when users look at their undo/redo steps
Note:
For now I've only updated the
LoadCliploader. Once the general Idea/Implementation is approved I'm happy to roll it out to other loaders tooload

update

delete

Testing notes:
LoadCliploader)