From 1c3ca17654af4f7be160c3669a9c0ca61305c8ac Mon Sep 17 00:00:00 2001 From: aardschok Date: Mon, 25 Sep 2017 15:04:25 +0200 Subject: [PATCH 1/3] fixed out of sync --- colorbleed/maya/menu.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/colorbleed/maya/menu.py b/colorbleed/maya/menu.py index 236879e061..9cc5b5911d 100644 --- a/colorbleed/maya/menu.py +++ b/colorbleed/maya/menu.py @@ -47,7 +47,6 @@ def deferred(): def uninstall(): menu = _get_menu() - if menu: log.info("Attempting to uninstall ..") @@ -60,6 +59,10 @@ def uninstall(): def install(): + if cmds.about(batch=True): + print("Skipping colorbleed.menu initialization in batch mode..") + return + uninstall() # Allow time for uninstallation to finish. cmds.evalDeferred(deferred) From 63aa1e834ad54536834e0beecb7ce59b0ac01f90 Mon Sep 17 00:00:00 2001 From: aardschok Date: Mon, 25 Sep 2017 15:04:53 +0200 Subject: [PATCH 2/3] Added print for deadline --- colorbleed/maya/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/colorbleed/maya/__init__.py b/colorbleed/maya/__init__.py index b586027829..9cdf6e7d14 100644 --- a/colorbleed/maya/__init__.py +++ b/colorbleed/maya/__init__.py @@ -75,6 +75,7 @@ def install(): # Add any needed plugins for plugin in LOAD_AT_START: + print "Loading %s" % plugin if cmds.pluginInfo(plugin, query=True, loaded=True): continue cmds.loadPlugin(plugin, quiet=True) From dd197fee9acb93d8b89fd5bbe0ad95600ce8b013 Mon Sep 17 00:00:00 2001 From: aardschok Date: Tue, 26 Sep 2017 16:50:17 +0200 Subject: [PATCH 3/3] added logging, force load specific plugins at install --- colorbleed/maya/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/colorbleed/maya/__init__.py b/colorbleed/maya/__init__.py index 9cdf6e7d14..a1afac47ac 100644 --- a/colorbleed/maya/__init__.py +++ b/colorbleed/maya/__init__.py @@ -1,4 +1,5 @@ import os +import logging from maya import cmds @@ -9,6 +10,8 @@ from pyblish import api as pyblish from . import menu from . import lib +log = logging.getLogger("colorbleed.maya") + PARENT_DIR = os.path.dirname(__file__) PACKAGE_DIR = os.path.dirname(PARENT_DIR) PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins") @@ -17,7 +20,7 @@ PUBLISH_PATH = os.path.join(PLUGINS_DIR, "maya", "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "maya", "load") CREATE_PATH = os.path.join(PLUGINS_DIR, "maya", "create") -LOAD_AT_START = ["AbcImport", "AbcExport"] +LOAD_AT_START = ["AbcImport", "AbcExport", "mtoa"] # This is a temporary solution with the http.py clash with six.py # Maya has added paths to the PYTHONPATH which are redundant as @@ -75,12 +78,12 @@ def install(): # Add any needed plugins for plugin in LOAD_AT_START: - print "Loading %s" % plugin + log.info("Loading %s" % plugin) if cmds.pluginInfo(plugin, query=True, loaded=True): continue cmds.loadPlugin(plugin, quiet=True) - print("Installing callbacks ... ") + log.info("Installing callbacks ... ") avalon.on("init", on_init) avalon.on("new", on_new) avalon.on("save", on_save)