mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
adding and loading maya mel workspace through openpype project setting
This commit is contained in:
parent
decc112518
commit
d4eeabad7e
3 changed files with 7 additions and 5 deletions
|
|
@ -59,7 +59,7 @@ class MayaHost(HostBase, IWorkfileHost, ILoadHost):
|
|||
self._op_events = {}
|
||||
|
||||
def install(self):
|
||||
project_settings = get_project_settings(os.getenv("AVALON_PROJECT"))
|
||||
project_settings = get_project_settings(legacy_io.active_project())
|
||||
# process path mapping
|
||||
dirmap_processor = MayaDirmap("maya", project_settings)
|
||||
dirmap_processor.process_dirmap()
|
||||
|
|
@ -536,7 +536,7 @@ def on_task_changed():
|
|||
lib.update_content_on_context_change()
|
||||
|
||||
msg = " project: {}\n asset: {}\n task:{}".format(
|
||||
legacy_io.Session["AVALON_PROJECT"],
|
||||
legacy_io.active_project(),
|
||||
legacy_io.Session["AVALON_ASSET"],
|
||||
legacy_io.Session["AVALON_TASK"]
|
||||
)
|
||||
|
|
@ -548,7 +548,7 @@ def on_task_changed():
|
|||
|
||||
|
||||
def before_workfile_save(event):
|
||||
project_name = os.getenv("AVALON_PROJECT")
|
||||
project_name = legacy_io.active_project()
|
||||
workdir_path = event["workdir_path"]
|
||||
if workdir_path:
|
||||
create_workspace_mel(workdir_path, project_name)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
from openpype.settings import get_project_settings
|
||||
|
||||
from openpype.api import Logger
|
||||
|
||||
def create_workspace_mel(workdir, project_name):
|
||||
dst_filepath = os.path.join(workdir, "workspace.mel")
|
||||
|
|
@ -15,7 +15,8 @@ def create_workspace_mel(workdir, project_name):
|
|||
|
||||
# Skip if mel script in settings is empty
|
||||
if not mel_script:
|
||||
return
|
||||
log = Logger.get_logger("create_workspace_mel")
|
||||
log.debug("File 'workspace.mel' not created. Settings value is empty.")
|
||||
|
||||
with open(dst_filepath, "w") as mel_file:
|
||||
mel_file.write(mel_script)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
{
|
||||
"type": "text",
|
||||
"multiline" : true,
|
||||
"use_label_wrap": true,
|
||||
"key": "mel_workspace",
|
||||
"label": "Maya MEL Workspace"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue