Blender Kitsu: Add option to Exclude Collections from Output Collection #120

Merged
Nick Alberelli merged 9 commits from :feature/exclude-output-collections into main 2023-07-13 19:54:03 +02:00
Showing only changes of commit 1ef927d419 - Show all commits

View File

@ -460,6 +460,7 @@ class KITSU_OT_anim_update_output_coll(bpy.types.Operator):
if coll_comp in coll_childs:
childs.append(coll_comp)
# TODO check why this only returns some collections after running operator once
return [coll for coll in missing if coll not in childs]
def draw(self, context):
@ -477,6 +478,10 @@ class KITSU_OT_anim_update_output_coll(bpy.types.Operator):
self.output_coll.children.unlink(collection)
bpy.context.view_layer.update()
parents = self.get_collections(context)
if self.exclude_collections:
parents = [
col for col in parents if not col.blender_kitsu_exclusions.exclude
]
for coll in parents:
self.output_coll.children.link(coll)
logger.info("%s linked in %s", coll.name, self.output_coll.name)