6
$\begingroup$

I am looking for a way to get a list of all the images loaded into Blender at that point. I want to use it as a check something like:

file = "name"
if file not in list.of.images:
   image = bpy.data.images.load(filepath)

know of any ways to do this, searched and searched and haven't been able to find anything.

$\endgroup$

1 Answer 1

8
$\begingroup$

If you just want to iterate over the images:

import bpy

for img in bpy.data.images:
    print("name=%s, filepath=%s" % (img.name, img.filepath))

Note this could contain 'render result' and materials which you might want to filter. See the docs to see what attributes could be interesting like 'file_format', 'filepath', 'filepath_from_user', 'filepath_raw'...

$\endgroup$
0

You must log in to answer this question.

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