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

@ -2,7 +2,7 @@ from avalon import api
import pype.maya.plugin
import os
import pymel.core as pm
import json
from pypeapp import config
class AssProxyLoader(pype.maya.plugin.ReferenceLoader):
@ -50,13 +50,8 @@ class AssProxyLoader(pype.maya.plugin.ReferenceLoader):
proxyShape.dso.set(path)
proxyShape.aiOverrideShaders.set(0)
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)
presets = config.get_presets(project=os.environ['AVALON_PROJECT'])
colors = presets['plugins']['maya']['load']['colors']
c = colors.get(family)
if c is not None:
@ -165,13 +160,8 @@ class AssStandinLoader(api.Loader):
label = "{}:{}".format(namespace, name)
root = pm.group(name=label, empty=True)
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)
presets = config.get_presets(project=os.environ['AVALON_PROJECT'])
colors = presets['plugins']['maya']['load']['colors']
c = colors.get('ass')
if c is not None: