flame: improving loading in integrate batch plugin

This commit is contained in:
Jakub Jezek 2022-03-25 15:21:22 +01:00
parent a4f8cdb769
commit 585d53deee
No known key found for this signature in database
GPG key ID: D8548FBF690B100A
2 changed files with 11 additions and 9 deletions

View file

@ -115,10 +115,8 @@ class ExtractSubsetResources(openpype.api.Extractor):
"batch_group_loader_name")
# convert to None if empty string
if batch_group_loader_name:
batch_group_loader_name = str(batch_group_loader_name)
if batch_group_loader_name == "":
batch_group_loader_name = None
if batch_group_loader_name == "":
batch_group_loader_name = None
# get frame range with handles for representation range
frame_start_handle = frame_start - handle_start

View file

@ -66,6 +66,9 @@ class IntegrateBatchGroup(pyblish.api.InstancePlugin):
if _repr.get("load_to_batch_group") is not None
]
self.log.debug("__ loadable_representations: {}".format(pformat(
loadable_representations)))
# get representation context from the repre_id
representation_ids = [
repre["_id"]
@ -75,17 +78,20 @@ class IntegrateBatchGroup(pyblish.api.InstancePlugin):
repre_contexts = op_pipeline.load.get_repres_contexts(
representation_ids)
self.log.debug("__ repre_contexts: {}".format(pformat(
repre_contexts)))
# loop all returned repres from repre_context dict
for repre_id, repre_context in repre_contexts.items():
self.log.debug("__ repre_id: {}".format(repre_id))
# get loader name by representation id
loader_name = next(
(
repr["loader"]
for repr in loadable_representations
if repr["_id"] == repre_id
),
self.default_loader
)
)) or self.default_loader
# get loader plugin
Loader = next(
(
@ -118,8 +124,6 @@ class IntegrateBatchGroup(pyblish.api.InstancePlugin):
pformat(loadable_representations))
)
def _get_batch_group(self, instance, task_data):
frame_start = instance.data["frameStart"]
frame_end = instance.data["frameEnd"]