mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
commit
ba28a135b0
2 changed files with 10 additions and 3 deletions
|
|
@ -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,11 +78,12 @@ def install():
|
|||
|
||||
# Add any needed plugins
|
||||
for plugin in LOAD_AT_START:
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue