mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
(hotfix) project modules were not loading into shelfs
This commit is contained in:
parent
d40d691191
commit
0e0dea3123
1 changed files with 18 additions and 11 deletions
|
|
@ -1,18 +1,25 @@
|
|||
import os
|
||||
import sys
|
||||
from pypeapp import config
|
||||
from pype.maya import lib
|
||||
import pype.maya.lib as mlib
|
||||
from maya import cmds
|
||||
|
||||
def build_shelf():
|
||||
presets = config.get_presets()
|
||||
shelf_preset = presets['maya'].get('project_shelf')
|
||||
if shelf_preset:
|
||||
project = os.environ["AVALON_PROJECT"]
|
||||
|
||||
for k, v in shelf_preset['imports'].items():
|
||||
sys.modules[k] = __import__(v, fromlist=[project])
|
||||
print("starting PYPE usersetup")
|
||||
|
||||
lib.shelf(name=shelf_preset['name'], preset=shelf_preset)
|
||||
# build a shelf
|
||||
presets = config.get_presets()
|
||||
shelf_preset = presets['maya'].get('project_shelf')
|
||||
|
||||
cmds.evalDeferred("build_shelf()")
|
||||
|
||||
if shelf_preset:
|
||||
project = os.environ["AVALON_PROJECT"]
|
||||
|
||||
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'], preset=shelf_preset)")
|
||||
|
||||
|
||||
print("finished PYPE usersetup")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue