From e215e8c4bcd3f45361d1bada64642b91470cf964 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Dec 2020 18:25:27 +0100 Subject: [PATCH 1/2] fix missing local variable --- pype/lib/applications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 70b33d6edf..4970579108 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -245,11 +245,11 @@ class ApplicationTool: class ApplicationExecutable: def __init__(self, executable): default_launch_args = [] + executable_path = None if isinstance(executable, str): executable_path = executable elif isinstance(executable, list): - executable_path = None for arg in executable: if arg: if executable_path is None: From 37f6aa89621083f9303a9b500813ee0610746fd7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Dec 2020 18:25:59 +0100 Subject: [PATCH 2/2] CollectAnatomyContextData plugin is using `ApplicationManager` to get app name for templates --- .../global/publish/collect_anatomy_context_data.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pype/plugins/global/publish/collect_anatomy_context_data.py b/pype/plugins/global/publish/collect_anatomy_context_data.py index e1e6c12ee9..07e58d8cb7 100644 --- a/pype/plugins/global/publish/collect_anatomy_context_data.py +++ b/pype/plugins/global/publish/collect_anatomy_context_data.py @@ -15,6 +15,7 @@ Provides: import os import json +from pype.lib import ApplicationManager from avalon import api, lib import pyblish.api @@ -64,12 +65,12 @@ class CollectAnatomyContextData(pyblish.api.ContextPlugin): "username": context.data["user"] } - avalon_app_name = os.environ.get("AVALON_APP_NAME") - if avalon_app_name: - application_def = lib.get_application(avalon_app_name) - app_dir = application_def.get("application_dir") - if app_dir: - context_data["app"] = app_dir + app_manager = ApplicationManager() + app_name = os.environ.get("AVALON_APP_NAME") + if app_name: + app = app_manager.applications.get(app_name) + if app: + context_data["app"] = app.host_name datetime_data = context.data.get("datetimeData") or {} context_data.update(datetime_data)