mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
29 lines
805 B
Python
29 lines
805 B
Python
import os
|
|
from pype.api import get_project_settings
|
|
import pype.hosts.maya.api.lib as mlib
|
|
from maya import cmds
|
|
|
|
|
|
print("starting OpenPype usersetup")
|
|
|
|
# build a shelf
|
|
settings = get_project_settings(os.environ['AVALON_PROJECT'])
|
|
shelf_preset = settings['maya'].get('project_shelf')
|
|
|
|
|
|
if shelf_preset:
|
|
project = os.environ["AVALON_PROJECT"]
|
|
|
|
icon_path = os.path.join(os.environ['OPENPYPE_PROJECT_SCRIPTS'],
|
|
project, "icons")
|
|
icon_path = os.path.abspath(icon_path)
|
|
|
|
for i in shelf_preset['imports']:
|
|
import_string = "from {} import {}".format(project, i)
|
|
print(import_string)
|
|
exec(import_string)
|
|
|
|
cmds.evalDeferred("mlib.shelf(name=shelf_preset['name'], iconPath=icon_path, preset=shelf_preset)")
|
|
|
|
|
|
print("finished OpenPype usersetup")
|