From 2bc1f67fedcb991bb97032fd412b6cafa7e6c7e4 Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Thu, 25 Apr 2019 22:41:27 +0100 Subject: [PATCH] Launch workfiles app on Maya launch. --- pype/maya/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pype/maya/__init__.py b/pype/maya/__init__.py index 6b971c8bca..0c00efb8ec 100644 --- a/pype/maya/__init__.py +++ b/pype/maya/__init__.py @@ -6,6 +6,7 @@ from maya import utils, cmds, mel from avalon import api as avalon, pipeline, maya from avalon.maya.pipeline import IS_HEADLESS +from avalon.tools import workfiles from pyblish import api as pyblish from ..lib import ( @@ -115,11 +116,21 @@ def on_init(_): override_toolbox_ui ) safe_deferred(override_component_mask_commands) + safe_deferred(launch_workfiles_app) if not IS_HEADLESS: safe_deferred(override_toolbox_ui) +def launch_workfiles_app(*args): + workfiles.show( + os.path.join( + cmds.workspace(query=True, rootDirectory=True), + cmds.workspace(fileRuleEntry="scene") + ) + ) + + def on_before_save(return_code, _): """Run validation for scene's FPS prior to saving""" return lib.validate_fps()