convert presets to pype2.0 way

This commit is contained in:
Milan Kolar 2019-04-10 00:12:09 +02:00
parent 7fe8d02abf
commit 698c59c8ea
14 changed files with 55 additions and 128 deletions

View file

@ -1,6 +1,6 @@
from avalon.maya import lib
from avalon import api
import json
from pypeapp import config
import os
import maya.cmds as cmds
@ -26,14 +26,6 @@ class VRayProxyLoader(api.Loader):
except ValueError:
family = "vrayproxy"
preset_file = os.path.join(
os.environ.get('PYPE_STUDIO_TEMPLATES'),
'presets', 'tools',
'family_colors.json'
)
with open(preset_file, 'r') as cfile:
colors = json.load(cfile)
asset_name = context['asset']["name"]
namespace = namespace or lib.unique_namespace(
asset_name + "_",
@ -54,6 +46,9 @@ class VRayProxyLoader(api.Loader):
if not nodes:
return
presets = config.get_presets(project=os.environ['AVALON_PROJECT'])
colors = presets['plugins']['maya']['load']['colors']
c = colors.get(family)
if c is not None:
cmds.setAttr("{0}_{1}.useOutlinerColor".format(name, "GRP"), 1)