1
$\begingroup$

I would like to, using only Python, relocate a linked library to another file. This is the equivalent of showing the "Blender file" content in the Outliner, right-clicking on the linked library and choosing "Relocate":

enter image description here

$\endgroup$
2
$\begingroup$

Going step by step in the native Blender code using a debugger, I was able to figure out the properties to give to the operator (which is wm.lib_relocate):

bpy.ops.wm.lib_relocate(
    library="cube-v02.blend",
    directory="C:\\Users\\someone\\Desktop\\",
    filename="cube-v01.blend"
)

Where:

  • library is the name of the library to relocate which seems to be the file name (without the directory part).
  • directory is the directory where the new library (blend file) is located.
  • filename is the file name of the blend file.
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.