0
$\begingroup$

I have a linked asset, with library override. The asset has an armature object. How can i retrieve the path of the linked object/armature ID? I use selected object as the test.

import bpy
print('-')
selected = bpy.context.selected_objects

for object in selected:
    objName = object.name
    object_data = object.data
    data_link_filepath = object_data.library.filepath
    
    print(f'objName             : {objName}')
    print(f'object_data         : {object_data}')
    print(f'data_link_filepath  : {data_link_filepath}')

This script works on geometry/mesh objects. In Armature case, It managed to get the armature object ID and the armature data ID. But it returns error when it comes to the object_data.library.filepath part. Somehow the object_data.library returns as None.

enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

When it is a library override, it is no longer directly linked so no library. You need: object_data.override_library.reference.library.filepath.

object.data.library.filepath works for mesh objects when the mesh data is linked.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .