removed old logic for get representation

This commit is contained in:
aardschok 2017-10-23 10:51:12 +02:00
parent cf24e3978f
commit cb4e0323ef

View file

@ -12,7 +12,7 @@ from collections import OrderedDict, defaultdict
from maya import cmds, mel
from avalon import maya, io
from avalon import api, maya, io
from cb.utils.maya import core
@ -688,22 +688,6 @@ def remove_id(node):
cmds.deleteAttr("{}.cbId".format(node))
def get_representation_file(representation, template=TEMPLATE):
"""
Rebuild the filepath of the representation's context
Args:
representation (dict): data of the registered in the database
template (str): the template to fill
Returns:
str
"""
context = representation["context"].copy()
context["root"] = os.environ["AVALON_PROJECTS"]
return template.format(**context)
def get_reference_node(path):
"""
Get the reference node when the path is found being used in a reference
@ -813,8 +797,8 @@ def assign_look_by_version(nodes, version_id):
"name": "json"})
# Load file
shader_filepath = get_representation_file(shader_file)
shader_relation = get_representation_file(shader_relations)
shader_filepath = api.get_representation_path(shader_file["_id"])
shader_relation = api.get_representation_path(shader_relations["_id"])
reference_node = get_reference_node(shader_filepath)
if reference_node is None: