I'm using the following to iterate across the objects in another Blender file so I can append certain objects to the current scene:

files = []
with bpy.data.libraries.load(full_path) as (data_from, data_to):
    for name in data_from.objects:
        if not 'Camera' in name and not 'Light' in name:
            if  not "." in name:
                files.append({'name': name})
bpy.ops.wm.append(directory=full_path+"/Object/", files=files)

As you can see, I am filtering out the objects with 'Camera' and 'Light' in their name. That works fine. I am also trying to filter out objects with a period in their name, but that does not work. There is 1 known named object with a period in the name I do not want appended, yet this method or looking for the specific name does not filter that object away. I've experimented with objects with periods in their names, and I cannot figure out why any objects in other Blender files that have periods in their name will get appended despite my filtering logic above. Any ideas?

  • 1
    $\begingroup$ Your logic is correct and works in my sample test set. What is the actual name that doesn't work for you? $\endgroup$ Jul 11, 2022 at 0:06
  • $\begingroup$ I have a copy of another model named "femaleAvatar.tuck". I've gotten into the habit of making the names of temp items the name of their source, with ".tuck" appended. The off thing here, my use of "femaleAvatar.tuck" was temporary; in the source blender file I am appending models from, "femaleAvatar.tuck" was deleted. I used the File->Cleanup options after deleting, as well as the File->External Data options in the hope the apparently not deleted model would be finally deleted. But upon use of append() as shown above, here comes "femaleAvatar.tuck" again. $\endgroup$ Jul 11, 2022 at 15:50
  • $\begingroup$ I tried testing for "femaleAvatar.tuck" in my first version of the above, and it was as if that conditional did not exist... $\endgroup$ Jul 11, 2022 at 15:56
  • $\begingroup$ Maybe share a file with an example? $\endgroup$
    – Blunder
    Jul 11, 2022 at 16:54
  • $\begingroup$ I can't share the original, a work file. And trying to recreate does not exhibit the issue. Something with this blender file, I don't understand. Hate this kind of voodoo bs. $\endgroup$ Jul 12, 2022 at 18:16


You must log in to answer this question.

Browse other questions tagged .