add reset max file and clear undo buffer in the callback of starting new scene

This commit is contained in:
Kayla Man 2024-05-08 21:42:04 +08:00
parent de241369ff
commit 4d502a5548
2 changed files with 7 additions and 7 deletions

View file

@ -6,12 +6,9 @@ import json
from typing import Any, Dict, Union
import six
import ayon_api
from ayon_core.pipeline import (
get_current_project_name,
get_current_folder_path,
get_current_task_name,
colorspace
)
from ayon_core.settings import get_project_settings

View file

@ -52,11 +52,8 @@ class MaxHost(HostBase, IWorkfileHost, ILoadHost, IPublishHost):
self._has_been_setup = True
def context_setting():
return lib.set_context_setting()
rt.callbacks.addScript(rt.Name('systemPostNew'),
context_setting)
on_post_open)
rt.callbacks.addScript(rt.Name('filePostOpen'),
lib.check_colorspace)
@ -163,6 +160,12 @@ def ls() -> list:
yield lib.read(container)
def on_post_open():
lib.set_context_setting()
rt.resetMaxFile(rt.Name("noPrompt"))
rt.clearUndoBuffer()
def containerise(name: str, nodes: list, context,
namespace=None, loader=None, suffix="_CON"):
data = {