actual library fix

This commit is contained in:
Nathan
2025-08-20 17:28:21 -06:00
parent c6d90bf343
commit ee7e2b8168
3 changed files with 713 additions and 23 deletions

12
ui.py
View File

@@ -43,10 +43,22 @@ class DYNAMICLINK_PT_main_panel(Panel):
obj = context.active_object
if obj:
box.label(text=f"Selected: {obj.name}")
# Check if object itself is linked
if obj.library:
box.label(text=f"Linked from: {obj.library.filepath}")
row = box.row()
row.operator("dynamiclink.replace_linked_asset", text="Replace Asset")
# Check if object's data is linked
elif obj.data and obj.data.library:
box.label(text=f"Data linked from: {obj.data.library.filepath}")
row = box.row()
row.operator("dynamiclink.replace_linked_asset", text="Replace Asset")
# Check if it's a linked armature
elif obj.type == 'ARMATURE' and obj.data and hasattr(obj.data, 'library') and obj.data.library:
box.label(text=f"Armature linked from: {obj.data.library.filepath}")
row = box.row()
row.operator("dynamiclink.replace_linked_asset", text="Replace Asset")
else:
box.label(text="Not a linked asset")
else: