Merge pull request #5064 from ynput/bugfix/OP-6045_Disable-Collect-Frames-fixing-fix

Global: collect_frame_fix plugin fix and cleanup
This commit is contained in:
Jakub Ježek 2023-06-01 16:43:14 +02:00 committed by GitHub
commit ffecaf9ab6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,41 +35,47 @@ class CollectFramesFixDef(
rewrite_version = attribute_values.get("rewrite_version") rewrite_version = attribute_values.get("rewrite_version")
if frames_to_fix: if not frames_to_fix:
instance.data["frames_to_fix"] = frames_to_fix return
subset_name = instance.data["subset"] instance.data["frames_to_fix"] = frames_to_fix
asset_name = instance.data["asset"]
project_entity = instance.data["projectEntity"] subset_name = instance.data["subset"]
project_name = project_entity["name"] asset_name = instance.data["asset"]
version = get_last_version_by_subset_name(project_name, project_entity = instance.data["projectEntity"]
subset_name, project_name = project_entity["name"]
asset_name=asset_name)
if not version:
self.log.warning("No last version found, "
"re-render not possible")
return
representations = get_representations(project_name, version = get_last_version_by_subset_name(
version_ids=[version["_id"]]) project_name,
published_files = [] subset_name,
for repre in representations: asset_name=asset_name
if repre["context"]["family"] not in self.families: )
continue if not version:
self.log.warning(
"No last version found, re-render not possible"
)
return
for file_info in repre.get("files"): representations = get_representations(
published_files.append(file_info["path"]) project_name, version_ids=[version["_id"]]
)
published_files = []
for repre in representations:
if repre["context"]["family"] not in self.families:
continue
instance.data["last_version_published_files"] = published_files for file_info in repre.get("files"):
self.log.debug("last_version_published_files::{}".format( published_files.append(file_info["path"])
instance.data["last_version_published_files"]))
if rewrite_version: instance.data["last_version_published_files"] = published_files
instance.data["version"] = version["name"] self.log.debug("last_version_published_files::{}".format(
# limits triggering version validator instance.data["last_version_published_files"]))
instance.data.pop("latestVersion")
if self.rewrite_version_enable and rewrite_version:
instance.data["version"] = version["name"]
# limits triggering version validator
instance.data.pop("latestVersion")
@classmethod @classmethod
def get_attribute_defs(cls): def get_attribute_defs(cls):