reverting the functionality

- sequencial original frame data should be optional plugin
- sequential data are added if activated
- asset data frame data are not optional anymore and are added only if missing
This commit is contained in:
Jakub Jezek 2023-09-27 13:37:01 +02:00
parent 5b1cbfaa67
commit e90d227a23
No known key found for this signature in database
GPG key ID: 730D7C02726179A7
4 changed files with 31 additions and 22 deletions

View file

@ -1,11 +1,7 @@
import pyblish.api
from openpype.pipeline import OptionalPyblishPluginMixin
class CollectFrameDataFromAssetEntity(
pyblish.api.InstancePlugin,
OptionalPyblishPluginMixin
):
class CollectFrameDataFromAssetEntity(pyblish.api.InstancePlugin):
"""Collect Frame Data From AssetEntity found in context
Frame range data will only be collected if the keys
@ -18,14 +14,9 @@ class CollectFrameDataFromAssetEntity(
"vdbcache", "online",
"render"]
hosts = ["traypublisher"]
optional = True
def process(self, instance):
if not self.is_active(instance.data):
return
asset_data = instance.data["assetEntity"]["data"]
missing_keys = []
for key in (
"fps",
"frameStart",
@ -33,6 +24,14 @@ class CollectFrameDataFromAssetEntity(
"handleStart",
"handleEnd"
):
instance.data[key] = asset_data[key]
self.log.debug(
f"Collected Frame range data '{key}':{asset_data[key]} ")
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.")

View file

@ -1,22 +1,32 @@
import pyblish.api
import clique
from openpype.pipeline import OptionalPyblishPluginMixin
class CollectSequenceFrameData(
pyblish.api.InstancePlugin,
OptionalPyblishPluginMixin
):
"""Collect Original Sequence Frame Data
class CollectSequenceFrameData(pyblish.api.InstancePlugin):
"""Collect Sequence Frame Data
If the representation includes files with frame numbers,
then set `frameStart` and `frameEnd` for the instance to the
start and end frame respectively
"""
order = pyblish.api.CollectorOrder + 0.490
label = "Collect Sequence Frame Data"
order = pyblish.api.CollectorOrder + 0.4905
label = "Collect Original Sequence Frame Data"
families = ["plate", "pointcache",
"vdbcache", "online",
"render"]
hosts = ["traypublisher"]
optional = True
def process(self, instance):
if not self.is_active(instance.data):
return
frame_data = self.get_frame_data_from_repre_sequence(instance)
if not frame_data:

View file

@ -346,10 +346,10 @@
}
},
"publish": {
"CollectFrameDataFromAssetEntity": {
"CollectSequenceFrameData": {
"enabled": true,
"optional": true,
"active": true
"active": false
},
"ValidateFrameRange": {
"enabled": true,

View file

@ -350,8 +350,8 @@
"name": "template_validate_plugin",
"template_data": [
{
"key": "CollectFrameDataFromAssetEntity",
"label": "Collect frame range from asset entity"
"key": "CollectSequenceFrameData",
"label": "Collect Original Sequence Frame Data"
},
{
"key": "ValidateFrameRange",