From e13fb230f2d711ab494e56ef65e6871f1fe3a4a7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 19 May 2021 14:40:14 +0200 Subject: [PATCH 1/3] use AVALON_APP to get host name if is available --- openpype/plugins/publish/collect_anatomy_context_data.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openpype/plugins/publish/collect_anatomy_context_data.py b/openpype/plugins/publish/collect_anatomy_context_data.py index 5b955a0592..5c4bc6cb75 100644 --- a/openpype/plugins/publish/collect_anatomy_context_data.py +++ b/openpype/plugins/publish/collect_anatomy_context_data.py @@ -71,6 +71,10 @@ class CollectAnatomyContextData(pyblish.api.ContextPlugin): app = app_manager.applications.get(app_name) if app: context_data["app"] = app.host_name + # Use AVALON_APP as first if available it is the same as host name + # - only if is not defined use AVALON_APP_NAME (e.g. on Farm) and + # set it back to AVALON_APP env variable + host_name = os.environ.get("AVALON_APP") datetime_data = context.data.get("datetimeData") or {} context_data.update(datetime_data) From 85abe800392979be139a36a7da75c59acbafe3f4 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 19 May 2021 14:40:33 +0200 Subject: [PATCH 2/3] use AVALON_APP_NAME if AVALON_APP is not available --- .../publish/collect_anatomy_context_data.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/openpype/plugins/publish/collect_anatomy_context_data.py b/openpype/plugins/publish/collect_anatomy_context_data.py index 5c4bc6cb75..ce23aa82bf 100644 --- a/openpype/plugins/publish/collect_anatomy_context_data.py +++ b/openpype/plugins/publish/collect_anatomy_context_data.py @@ -65,16 +65,18 @@ class CollectAnatomyContextData(pyblish.api.ContextPlugin): "username": context.data["user"] } - 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 # Use AVALON_APP as first if available it is the same as host name # - only if is not defined use AVALON_APP_NAME (e.g. on Farm) and # set it back to AVALON_APP env variable host_name = os.environ.get("AVALON_APP") + if not host_name: + app_manager = ApplicationManager() + app_name = os.environ.get("AVALON_APP_NAME") + if app_name: + app = app_manager.applications.get(app_name) + if app: + host_name = app.host_name + context_data["app"] = host_name datetime_data = context.data.get("datetimeData") or {} context_data.update(datetime_data) From cebcfb4a1517d6ae73783cacd892dc2047c4a185 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 19 May 2021 14:40:54 +0200 Subject: [PATCH 3/3] set host name back to AVALON_APP as it's used across other plugins --- openpype/plugins/publish/collect_anatomy_context_data.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openpype/plugins/publish/collect_anatomy_context_data.py b/openpype/plugins/publish/collect_anatomy_context_data.py index ce23aa82bf..f121760e27 100644 --- a/openpype/plugins/publish/collect_anatomy_context_data.py +++ b/openpype/plugins/publish/collect_anatomy_context_data.py @@ -76,6 +76,7 @@ class CollectAnatomyContextData(pyblish.api.ContextPlugin): app = app_manager.applications.get(app_name) if app: host_name = app.host_name + os.environ["AVALON_APP"] = host_name context_data["app"] = host_name datetime_data = context.data.get("datetimeData") or {}