mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
fix workdir setup and hierarchy preparation
This commit is contained in:
parent
2c21c28417
commit
de5716a193
2 changed files with 30 additions and 2 deletions
|
|
@ -82,7 +82,7 @@ class SyncToAvalon(BaseAction):
|
|||
'tasks': [{'name': ''}],
|
||||
'apps': apps,
|
||||
# TODO redo work!!!
|
||||
'template': {'work': '{root}/{project}/{hierarchy}/{asset}/work/{task}/{app}','publish':''}
|
||||
'template': {'work': '','publish':''}
|
||||
}
|
||||
|
||||
# Set project template
|
||||
|
|
|
|||
|
|
@ -9,6 +9,14 @@ import toml
|
|||
from avalon import io, lib, pipeline
|
||||
from avalon import session as sess
|
||||
|
||||
from app.api import (
|
||||
Templates
|
||||
)
|
||||
|
||||
t = Templates()
|
||||
|
||||
|
||||
|
||||
class AppAction(object):
|
||||
'''Custom Action base class
|
||||
|
||||
|
|
@ -226,7 +234,27 @@ class AppAction(object):
|
|||
os.environ["AVALON_ASSET"] = entity['parent']['name']
|
||||
os.environ["AVALON_TASK"] = entity['name']
|
||||
os.environ["AVALON_APP"] = self.identifier
|
||||
os.environ["AVALON_APP_NAME"] = self.executable
|
||||
os.environ["AVALON_APP_NAME"] = self.identifier + "_" + self.variant
|
||||
|
||||
|
||||
anatomy = t.anatomy
|
||||
io.install()
|
||||
hierarchy = io.find_one({"type":'asset', "name":entity['parent']['name']})['data']['parents']
|
||||
io.uninstall()
|
||||
if hierarchy:
|
||||
# hierarchy = os.path.sep.join(hierarchy)
|
||||
hierarchy = os.path.join(*hierarchy)
|
||||
|
||||
data = { "project": {"name": entity['project']['full_name'],
|
||||
"code": entity['project']['name']},
|
||||
"task": entity['name'],
|
||||
"asset": entity['parent']['name'],
|
||||
"hierarchy": hierarchy}
|
||||
|
||||
anatomy = anatomy.format(data)
|
||||
|
||||
|
||||
os.environ["AVALON_WORKDIR"] = os.path.join(anatomy.work.root, anatomy.work.folder)
|
||||
|
||||
# TODO Add paths to avalon setup from tomls
|
||||
if self.identifier == 'maya':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue