mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Code cosmetics
This commit is contained in:
parent
9f749edd8a
commit
ff6fe13e2a
2 changed files with 9 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue