[Blender_Kitsu] Add Operators to cleanup Animation Files #38
@ -326,6 +326,21 @@ class KITSU_OT_anim_enforce_naming_convention(bpy.types.Operator):
|
|||||||
)
|
)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
class KITSU_OT_remove_override_hidden_collections(bpy.types.Operator):
|
||||||
|
bl_idname = "kitsu.remove_override_hidden_collections"
|
||||||
|
bl_label = "Cleanup Override Collections"
|
||||||
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
bl_description = ("Unlink any Collection with Name 'OVERRIDE_HIDDEN' from current scene")
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
remove_name = 'OVERRIDE_HIDDEN'
|
||||||
|
scene_cols = context.scene.collection.children
|
||||||
|
cols = [col for col in scene_cols if remove_name in col.name]
|
||||||
|
for col in cols:
|
||||||
|
scene_cols.unlink(col)
|
||||||
|
self.report({"INFO"}, f"Removed Collection '{col.name}'",)
|
||||||
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class KITSU_OT_anim_update_output_coll(bpy.types.Operator):
|
class KITSU_OT_anim_update_output_coll(bpy.types.Operator):
|
||||||
bl_idname = "kitsu.anim_update_output_coll"
|
bl_idname = "kitsu.anim_update_output_coll"
|
||||||
@ -389,6 +404,7 @@ classes = [
|
|||||||
KITSU_OT_anim_check_action_names,
|
KITSU_OT_anim_check_action_names,
|
||||||
KITSU_OT_anim_update_output_coll,
|
KITSU_OT_anim_update_output_coll,
|
||||||
KITSU_OT_anim_enforce_naming_convention,
|
KITSU_OT_anim_enforce_naming_convention,
|
||||||
|
KITSU_OT_remove_override_hidden_collections
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,6 +100,10 @@ class KITSU_PT_vi3d_anim_tools(bpy.types.Panel):
|
|||||||
row = box.row(align=True)
|
row = box.row(align=True)
|
||||||
row.operator("kitsu.anim_enforce_naming_convention", icon="SORTALPHA")
|
row.operator("kitsu.anim_enforce_naming_convention", icon="SORTALPHA")
|
||||||
|
|
||||||
|
row = box.row(align=True)
|
||||||
|
row.operator("kitsu.remove_override_hidden_collections", icon="OUTLINER_COLLECTION")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ---------REGISTER ----------.
|
# ---------REGISTER ----------.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user