texture copy now works without registered_root

This commit is contained in:
iLLiCiTiT 2020-03-30 14:17:14 +02:00
parent 03c1285f2d
commit 50bd855fb1

View file

@ -46,25 +46,25 @@ class TextureCopy:
return asset
def _get_destination_path(self, asset, project):
root = api.registered_root()
PROJECT = api.Session["AVALON_PROJECT"]
project_name = api.Session["AVALON_PROJECT"]
hierarchy = ""
parents = asset['data']['parents']
if parents and len(parents) > 0:
hierarchy = os.path.join(*parents)
template_data = {"root": root,
"project": {"name": PROJECT,
"code": project['data']['code']},
"silo": asset.get('silo'),
"asset": asset['name'],
"family": 'texture',
"subset": 'Main',
"hierarchy": hierarchy}
anatomy = Anatomy()
anatomy_filled = os.path.normpath(
anatomy.format(template_data)['texture']['path'])
return anatomy_filled
template_data = {
"project": {
"name": project_name,
"code": project['data']['code']
},
"silo": asset.get('silo'),
"asset": asset['name'],
"family": 'texture',
"subset": 'Main',
"hierarchy": hierarchy
}
anatomy_filled = Anatomy(project_name).format(template_data)
return os.path.normpath(anatomy_filled['texture']['path'])
def _get_version(self, path):
versions = [0]