Skip to content

Commit

Permalink
clean up the on_before_open function
Browse files Browse the repository at this point in the history
  • Loading branch information
moonyuet committed May 6, 2024
1 parent 7a028c4 commit 695dedb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions client/ayon_core/hosts/max/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,12 @@ def on_task_changed():
def on_before_open():
project_name = get_current_project_name()
workdir_path = os.getenv("AYON_WORKDIR")
if os.path.exists(workdir_path):
if not os.path.exists(workdir_path):
create_workspace_mxp(workdir_path, project_name)
if rt.pathConfig.getCurrentProjectFolder() != workdir_path:
mxp_filepath = os.path.join(workdir_path, "workspace.mxp")
if os.path.exists(mxp_filepath):
rt.pathConfig.load(mxp_filepath)
rt.pathConfig.doProjectSetupStepsUsingDirectory(workdir_path)
rt.pathConfig.setCurrentProjectFolder(workdir_path)
mxp_filepath = os.path.join(workdir_path, "workspace.mxp")
rt.pathConfig.load(mxp_filepath)
rt.pathConfig.doProjectSetupStepsUsingDirectory(workdir_path)
rt.pathConfig.setCurrentProjectFolder(workdir_path)


def load_custom_attribute_data():
Expand Down

0 comments on commit 695dedb

Please sign in to comment.