Code cosmetics

This commit is contained in:
Toke Stuart Jepsen 2023-01-17 16:05:58 +00:00
parent 9f749edd8a
commit ff6fe13e2a
2 changed files with 9 additions and 6 deletions

View file

@ -43,11 +43,9 @@ class AddLastWorkfileToLaunchArgs(PreLaunchHook):
return
# Determine whether to open workfile post initialization.
if self.data["app"].host_name == "maya":
project_name = self.data["project_name"]
settings = get_project_settings(project_name)
if self.host_name == "maya":
key = "open_workfile_post_initialization"
if settings["maya"][key]:
if self.data["project_settings"]["maya"][key]:
self.log.debug("Opening workfile post initialization.")
self.data["env"]["OPENPYPE_" + key.upper()] = "1"
return

View file

@ -1,5 +1,6 @@
import os
import shutil
from functools import partial
from openpype.settings import get_project_settings
from openpype.pipeline import install_host
@ -18,8 +19,12 @@ print("Starting OpenPype usersetup...")
key = "OPENPYPE_OPEN_WORKFILE_POST_INITIALIZATION"
if bool(int(os.environ.get(key, "0"))):
cmds.evalDeferred(
"cmds.file(os.environ[\"AVALON_LAST_WORKFILE\"], open=True,"
" force=True)",
partial(
cmds.file,
os.environ["AVALON_LAST_WORKFILE"],
open=True,
force=True
),
lowestPriority=True
)