mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
🔧 wip use FileLocation for transfers
This commit is contained in:
parent
5b2d8590e6
commit
39a9239743
2 changed files with 16 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ from ayon_core.pipeline.publish import (
|
|||
get_publish_template_name,
|
||||
)
|
||||
from ayon_core.pipeline.traits import Persistent, Representation
|
||||
from pipeline.traits import FileLocation
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import logging
|
||||
|
|
@ -146,6 +147,12 @@ class IntegrateTraits(pyblish.api.InstancePlugin):
|
|||
instance.data["versionEntity"] = version_entity
|
||||
|
||||
# 7) Get transfers from representations
|
||||
for representation in representations:
|
||||
# this should test version-less FileLocation probably
|
||||
if representation.contains_trait(FileLocation):
|
||||
self.log.debug(
|
||||
"Representation: %s", representation)
|
||||
|
||||
# 8) Transfer files
|
||||
# 9) Commit the session to AYON
|
||||
# 10) Finalize represetations - add integrated path Trait etc.
|
||||
|
|
@ -306,7 +313,7 @@ class IntegrateTraits(pyblish.api.InstancePlugin):
|
|||
all_version_data = self.get_version_data_from_instance(instance)
|
||||
version_data = {}
|
||||
version_attributes = {}
|
||||
attr_defs = self._get_attributes_for_type(instance.context, "version")
|
||||
attr_defs = self.get_attributes_for_type(instance.context, "version")
|
||||
for key, value in all_version_data.items():
|
||||
if key in attr_defs:
|
||||
version_attributes[key] = value
|
||||
|
|
@ -435,6 +442,11 @@ class IntegrateTraits(pyblish.api.InstancePlugin):
|
|||
),path)
|
||||
return path
|
||||
|
||||
def get_attributes_for_type(
|
||||
self, context: pyblish.api.Context, entity_type: str) -> dict:
|
||||
"""Get AYON attributes for the given entity type."""
|
||||
return self.get_attributes_by_type(context)[entity_type]
|
||||
|
||||
def get_attributes_by_type(
|
||||
self, context: pyblish.api.Context) -> dict:
|
||||
"""Gets AYON attributes from the given context."""
|
||||
|
|
|
|||
|
|
@ -108,6 +108,9 @@ def mock_context(
|
|||
frame_end=SEQUENCE_LENGTH,
|
||||
frame_padding=4,
|
||||
frame_regex=r"^img\.(\d{4})\.png$",
|
||||
frame_in=0,
|
||||
frame_out=SEQUENCE_LENGTH - 1,
|
||||
frames_per_second=25
|
||||
),
|
||||
FileLocation(
|
||||
file_path=sequence_files[0],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue