getting Infos about Objects through Library


My goal is to get the names and types of every object in a extern file. I made two attempts:


scn =
lib = bpy.libraries.load(filename)
kandidaten = [ob for ob in lib.objects]
for i in range(0,len(kandidaten)):
    pseudoOb = lib.objects.append(kandidaten[i])
    ob =
    if ob.type != 'Lamp' and ob.type != 'Camera':

With this, I get the type and name correctly, but unlinking the objects is not enough. For example if there is a “Cube” in the file and I run this script, the object “Cube” still exists. If I add another Cube, its name is “Cube.001”. Additionaly I don’t want to load the whole object only for knowing the name and the type.


lib = bpy.libraries.load(filename)
potentielle = [ob for ob in lib.objects]

Well, this script is nice, if I only want to know the names. But after the script, I have no way to get the type, beacuse only the names were saved.

Please tell me a better way :slight_smile: