From e08c0279664493e601038ed494d3eba2ed312c0f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 2 Feb 2021 18:12:35 +0100 Subject: [PATCH] layer name "anim" has different data preparation and uses it's children groups to export --- .../publish/extract_bg_main_groups.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pype/plugins/standalonepublisher/publish/extract_bg_main_groups.py b/pype/plugins/standalonepublisher/publish/extract_bg_main_groups.py index 40c7f48007..04511ff723 100644 --- a/pype/plugins/standalonepublisher/publish/extract_bg_main_groups.py +++ b/pype/plugins/standalonepublisher/publish/extract_bg_main_groups.py @@ -120,6 +120,31 @@ class ExtractBGMainGroups(pype.api.Extractor): continue filebase = "{:0>2}_{}".format(layer_idx, layer_name) + if layer_name.lower() == "anim": + if not layer.is_group: + self.log.warning("ANIM layer is not a group layer.") + continue + + children = [] + for anim_idx, anim_layer in enumerate(layer): + anim_layer_name = anim_layer.name.replace(" ", "_") + filename = "{}_{:0>2}_{}{}".format( + filebase, anim_idx, anim_layer_name, output_ext + ) + children.append({ + "index": anim_idx, + "name": anim_layer.name, + "filename": filename + }) + to_export.append((anim_layer, filename)) + + json_data["children"].append({ + "index": layer_idx, + "name": layer.name, + "children": children + }) + continue + filename = filebase + output_ext json_data["children"].append({ "index": layer_idx,