fixing avalon_tools_env to tools_env

This commit is contained in:
Jakub Jezek 2018-11-16 19:34:04 +01:00
parent 47e36bb432
commit ac6e321685

View file

@ -65,7 +65,7 @@ class AppAction(object):
self.session.event_hub.subscribe(
'topic=ftrack.action.discover and source.user.username={0}'.format(
self.session.api_user
), self._discover
), self._discover
)
self.session.event_hub.subscribe(
@ -199,7 +199,7 @@ class AppAction(object):
response = self.launch(
self.session, *args
)
)
return self._handle_result(
self.session, response, *args
@ -245,7 +245,8 @@ class AppAction(object):
anatomy = t.anatomy
io.install()
hierarchy = io.find_one({"type": 'asset', "name": entity['parent']['name']})['data']['parents']
hierarchy = io.find_one({"type": 'asset', "name": entity['parent']['name']})[
'data']['parents']
io.uninstall()
if hierarchy:
# hierarchy = os.path.sep.join(hierarchy)
@ -263,9 +264,11 @@ class AppAction(object):
# TODO Add paths to avalon setup from tomls
if self.identifier == 'maya':
os.environ['PYTHONPATH'] += os.pathsep + os.path.join(os.getenv("AVALON_CORE"), 'setup', 'maya')
os.environ['PYTHONPATH'] += os.pathsep + \
os.path.join(os.getenv("AVALON_CORE"), 'setup', 'maya')
elif self.identifier == 'nuke':
os.environ['NUKE_PATH'] = os.pathsep + os.path.join(os.getenv("AVALON_CORE"), 'setup', 'nuke')
os.environ['NUKE_PATH'] = os.pathsep + \
os.path.join(os.getenv("AVALON_CORE"), 'setup', 'nuke')
# config = toml.load(lib.which_app(self.identifier + "_" + self.variant))
env = os.environ
@ -279,8 +282,8 @@ class AppAction(object):
tools_attr = [os.environ["AVALON_APP_NAME"]]
for parent in reversed(parents):
# check if the attribute is empty, if not use it
if parent['custom_attributes']['avalon_tools_env']:
tools_attr.extend(parent['custom_attributes']['avalon_tools_env'])
if parent['custom_attributes']['tools_env']:
tools_attr.extend(parent['custom_attributes']['tools_env'])
break
tools_env = acre.get_tools(tools_attr)
@ -426,7 +429,7 @@ class BaseAction(object):
self.session.event_hub.subscribe(
'topic=ftrack.action.discover and source.user.username={0}'.format(
self.session.api_user
), self._discover
), self._discover
)
self.session.event_hub.subscribe(
@ -448,7 +451,8 @@ class BaseAction(object):
)
if accepts:
self.logger.info(u'Discovering action with selection: {0}'.format(args[1]['data'].get('selection', [])))
self.logger.info(u'Discovering action with selection: {0}'.format(
args[1]['data'].get('selection', [])))
return {
'items': [{
'label': self.label,