mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merge pull request #789 from pypeclub/feature/use_app_manager_in_collector
Use app manager in context collector
This commit is contained in:
commit
75339ffbdc
2 changed files with 8 additions and 7 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue