mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
still support get current context
This commit is contained in:
parent
52c5d6bd4b
commit
e02b686afe
1 changed files with 10 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ from openpype.lib.events import EventSystem
|
|||
from openpype.pipeline import (
|
||||
PublishValidationError,
|
||||
registered_host,
|
||||
legacy_io,
|
||||
)
|
||||
from openpype.pipeline.create import CreateContext
|
||||
|
||||
|
|
@ -414,6 +415,9 @@ class PublisherController:
|
|||
str: Project name.
|
||||
"""
|
||||
|
||||
if not hasattr(self.host, "get_current_context"):
|
||||
return legacy_io.active_project()
|
||||
|
||||
return self.host.get_current_context()["project_name"]
|
||||
|
||||
@property
|
||||
|
|
@ -424,6 +428,9 @@ class PublisherController:
|
|||
Union[str, None]: Asset name or None if asset is not set.
|
||||
"""
|
||||
|
||||
if not hasattr(self.host, "get_current_context"):
|
||||
return legacy_io.Session["AVALON_ASSET"]
|
||||
|
||||
return self.host.get_current_context()["asset_name"]
|
||||
|
||||
@property
|
||||
|
|
@ -434,6 +441,9 @@ class PublisherController:
|
|||
Union[str, None]: Task name or None if task is not set.
|
||||
"""
|
||||
|
||||
if not hasattr(self.host, "get_current_context"):
|
||||
return legacy_io.Session["AVALON_TASK"]
|
||||
|
||||
return self.host.get_current_context()["task_name"]
|
||||
|
||||
@property
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue