1
$\begingroup$

enter image description here

As my project folder structure and naming convention were reorganized, missing libraries and collections occurred. To recover them collectively, I'm trying append into list the missing libraries and collections, but the API seems to have no properties related to missing. Maybe I couldn't find it in the API? Or is there any way to get them with other programming techniques?

$\endgroup$

1 Answer 1

2
$\begingroup$

Look at the library filepaths.

Iterate over the libraries, for any that do not exist in saved filepath, convert the filepath and reload.

import bpy
from pathlib import Path

for lib in bpy.data.libraries:
    p = Path(bpy.path.abspath(lib.filepath))
    if not p.exists():
        
        print("Missing:", lib.filepath)
        # convert filepath 
        lib.filepath = "/some/converted/path"
        # with new valid path
        lib.reload()
$\endgroup$
1
  • $\begingroup$ It's very helpful! Meanwhile, is there a way to detect a disconnected collection? (Marking the red circle of the attached image) $\endgroup$ Feb 6, 2021 at 16:26

You must log in to answer this question.

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