mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
get "asset" and "task" from context
This commit is contained in:
parent
f9732a8385
commit
910b7d7120
1 changed files with 6 additions and 5 deletions
|
|
@ -3,6 +3,8 @@
|
||||||
Requires:
|
Requires:
|
||||||
session -> AVALON_ASSET
|
session -> AVALON_ASSET
|
||||||
context -> projectName
|
context -> projectName
|
||||||
|
context -> asset
|
||||||
|
context -> task
|
||||||
|
|
||||||
Provides:
|
Provides:
|
||||||
context -> projectEntity - Project document from database.
|
context -> projectEntity - Project document from database.
|
||||||
|
|
@ -13,20 +15,19 @@ Provides:
|
||||||
import pyblish.api
|
import pyblish.api
|
||||||
|
|
||||||
from openpype.client import get_project, get_asset_by_name
|
from openpype.client import get_project, get_asset_by_name
|
||||||
from openpype.pipeline import legacy_io, KnownPublishError
|
from openpype.pipeline import KnownPublishError
|
||||||
|
|
||||||
|
|
||||||
class CollectContextEntities(pyblish.api.ContextPlugin):
|
class CollectContextEntities(pyblish.api.ContextPlugin):
|
||||||
"""Collect Anatomy into Context."""
|
"""Collect entities into Context."""
|
||||||
|
|
||||||
order = pyblish.api.CollectorOrder - 0.1
|
order = pyblish.api.CollectorOrder - 0.1
|
||||||
label = "Collect Context Entities"
|
label = "Collect Context Entities"
|
||||||
|
|
||||||
def process(self, context):
|
def process(self, context):
|
||||||
legacy_io.install()
|
|
||||||
project_name = context.data["projectName"]
|
project_name = context.data["projectName"]
|
||||||
asset_name = legacy_io.Session["AVALON_ASSET"]
|
asset_name = context.data["asset"]
|
||||||
task_name = legacy_io.Session["AVALON_TASK"]
|
task_name = context.data["task"]
|
||||||
|
|
||||||
project_entity = get_project(project_name)
|
project_entity = get_project(project_name)
|
||||||
if not project_entity:
|
if not project_entity:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue