AnimCupboard: ID Management Pie #127

Merged
Demeter Dzadik merged 11 commits from Mets/blender-studio-pipeline:AnimCupboard-relationship-viewer into main 2023-07-19 14:43:14 +02:00
Showing only changes of commit 999c96138f - Show all commits

View File

@ -6,6 +6,7 @@ from bpy_extras import id_map_utils
import os import os
from ..utils import hotkeys from ..utils import hotkeys
from .relink_overridden_asset import OUTLINER_OT_relink_overridden_asset
class RelationshipOperatorMixin: class RelationshipOperatorMixin:
@ -61,6 +62,11 @@ class RelationshipOperatorMixin:
layout.separator() layout.separator()
datablocks = self.get_datablocks_to_display(datablock)
if not datablocks:
layout.label(text="There are none.")
return
for user in self.get_datablocks_to_display(datablock): for user in self.get_datablocks_to_display(datablock):
if user == datablock: if user == datablock:
# Scenes are users of themself for technical reasons, # Scenes are users of themself for technical reasons,
@ -226,16 +232,21 @@ class IDMAN_MT_relationship_pie(bpy.types.Menu):
# > # >
pie.operator( pie.operator(
OUTLINER_OT_list_dependencies_of_datablock.bl_idname, icon='LOOP_FORWARDS') OUTLINER_OT_list_dependencies_of_datablock.bl_idname, icon='LOOP_FORWARDS')
# ^
pie.operator('outliner.better_purge', icon='TRASH')
# V # V
pie.operator('outliner.better_purge', icon='TRASH')
# ^
pie.operator('outliner.id_operation', icon='FILE_REFRESH', pie.operator('outliner.id_operation', icon='FILE_REFRESH',
text="Remap Users").type = 'REMAP' text="Remap Users").type = 'REMAP'
# <V # ^>
id = OUTLINER_OT_relink_overridden_asset.get_id(context)
if id:
pie.operator('object.relink_overridden_asset', pie.operator('object.relink_overridden_asset',
icon='LIBRARY_DATA_OVERRIDE') icon='LIBRARY_DATA_OVERRIDE')
# <^
if id and id.override_library:
pie.operator('outliner.liboverride_troubleshoot_operation', icon='UV_SYNC_SELECT', pie.operator('outliner.liboverride_troubleshoot_operation', icon='UV_SYNC_SELECT',
text="Resync Override Hierarchy").type = 'OVERRIDE_LIBRARY_RESYNC_HIERARCHY_ENFORCE' text="Resync Override Hierarchy").type = 'OVERRIDE_LIBRARY_RESYNC_HIERARCHY_ENFORCE'