Skip to content

Commit

Permalink
Merge pull request #493 from ynput/bugfix/the_scene_isn't_reset_corre…
Browse files Browse the repository at this point in the history
…ctly_when_starting_new_scene_after_loading_objects

Max: reset scene and clear undo buffer when starting new scene
  • Loading branch information
moonyuet committed May 16, 2024
2 parents ac66922 + 6b6c21b commit c133c97
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions client/ayon_core/hosts/max/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ def install(self):

self._has_been_setup = True

def context_setting():
return lib.set_context_setting()

rt.callbacks.addScript(rt.Name('systemPostNew'),
context_setting)
rt.callbacks.addScript(rt.Name('systemPostNew'), on_new)

rt.callbacks.addScript(rt.Name('filePostOpen'),
lib.check_colorspace)
Expand Down Expand Up @@ -163,6 +159,14 @@ def ls() -> list:
yield lib.read(container)


def on_new():
lib.set_context_setting()
if rt.checkForSave():
rt.resetMaxFile(rt.Name("noPrompt"))
rt.clearUndoBuffer()
rt.redrawViews()


def containerise(name: str, nodes: list, context,
namespace=None, loader=None, suffix="_CON"):
data = {
Expand Down

0 comments on commit c133c97

Please sign in to comment.