mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
reverting enhancing UX of sequence or asset frame data collection
This commit is contained in:
parent
4ae8e7fa77
commit
fbafc420aa
2 changed files with 19 additions and 25 deletions
|
|
@ -2,18 +2,18 @@ import pyblish.api
|
|||
from openpype.pipeline import OptionalPyblishPluginMixin
|
||||
|
||||
|
||||
class CollectMissingFrameDataFromAssetEntity(
|
||||
class CollectFrameDataFromAssetEntity(
|
||||
pyblish.api.InstancePlugin,
|
||||
OptionalPyblishPluginMixin
|
||||
):
|
||||
"""Collect Missing Frame Range data From Asset Entity
|
||||
"""Collect Frame Data From AssetEntity found in context
|
||||
|
||||
Frame range data will only be collected if the keys
|
||||
are not yet collected for the instance.
|
||||
"""
|
||||
|
||||
order = pyblish.api.CollectorOrder + 0.491
|
||||
label = "Collect Missing Frame Data From Asset Entity"
|
||||
label = "Collect Frame Data From Asset"
|
||||
families = ["plate", "pointcache",
|
||||
"vdbcache", "online",
|
||||
"render"]
|
||||
|
|
@ -23,7 +23,9 @@ class CollectMissingFrameDataFromAssetEntity(
|
|||
def process(self, instance):
|
||||
if not self.is_active(instance.data):
|
||||
return
|
||||
missing_keys = []
|
||||
|
||||
asset_data = instance.data["assetEntity"]["data"]
|
||||
|
||||
for key in (
|
||||
"fps",
|
||||
"frameStart",
|
||||
|
|
@ -31,14 +33,5 @@ class CollectMissingFrameDataFromAssetEntity(
|
|||
"handleStart",
|
||||
"handleEnd"
|
||||
):
|
||||
if key not in instance.data:
|
||||
missing_keys.append(key)
|
||||
keys_set = []
|
||||
for key in missing_keys:
|
||||
asset_data = instance.data["assetEntity"]["data"]
|
||||
if key in asset_data:
|
||||
instance.data[key] = asset_data[key]
|
||||
keys_set.append(key)
|
||||
if keys_set:
|
||||
self.log.debug(f"Frame range data {keys_set} "
|
||||
"has been collected from asset entity.")
|
||||
instance.data[key] = asset_data[key]
|
||||
self.log.debug(f"Collected Frame range data '{key}':{asset_data[key]} ")
|
||||
|
|
@ -9,7 +9,7 @@ class CollectSequenceFrameData(pyblish.api.InstancePlugin):
|
|||
start and end frame respectively
|
||||
"""
|
||||
|
||||
order = pyblish.api.CollectorOrder + 0.2
|
||||
order = pyblish.api.CollectorOrder + 0.490
|
||||
label = "Collect Sequence Frame Data"
|
||||
families = ["plate", "pointcache",
|
||||
"vdbcache", "online",
|
||||
|
|
@ -18,21 +18,22 @@ class CollectSequenceFrameData(pyblish.api.InstancePlugin):
|
|||
|
||||
def process(self, instance):
|
||||
frame_data = self.get_frame_data_from_repre_sequence(instance)
|
||||
|
||||
if not frame_data:
|
||||
# if no dict data skip collecting the frame range data
|
||||
return
|
||||
|
||||
for key, value in frame_data.items():
|
||||
if key not in instance.data:
|
||||
instance.data[key] = value
|
||||
self.log.debug(f"Collected Frame range data '{key}':{value} ")
|
||||
instance.data[key] = value
|
||||
self.log.debug(f"Collected Frame range data '{key}':{value} ")
|
||||
|
||||
test_keys = {key: value for key, value in instance.data.items() if key in frame_data}
|
||||
self.log.debug(f"Final Instance frame data: {test_keys}")
|
||||
|
||||
|
||||
def get_frame_data_from_repre_sequence(self, instance):
|
||||
repres = instance.data.get("representations")
|
||||
parent_entity = instance.data.get("assetEntity")
|
||||
|
||||
if not parent_entity:
|
||||
self.log.warning("Cannot find parent entity data")
|
||||
return
|
||||
asset_data = instance.data["assetEntity"]["data"]
|
||||
|
||||
if repres:
|
||||
first_repre = repres[0]
|
||||
|
|
@ -58,5 +59,5 @@ class CollectSequenceFrameData(pyblish.api.InstancePlugin):
|
|||
"frameEnd": repres_frames[-1],
|
||||
"handleStart": 0,
|
||||
"handleEnd": 0,
|
||||
"fps": parent_entity["data"]["fps"]
|
||||
"fps": asset_data["fps"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue