Reading/Writing of a material's textures?

(ectizen) #1

I am currently attempting to write a script that needs to read from and write to a material’s textures (not the uv mapped stuff). In particular, I’m trying to change the image filename.

I’ve spent quite some time exploring the API, trying to find the necessary stuff, and reached the conclusion that these textures simply aren’t accessible. Would this be correct?

(jms) #2

Yes, it’s correct. One of big problems to write a good exporter.


(eeshlo) #3

Well, you can change the image name, but that doesn’t change the actual file of course…
You can get a list of all images used (material and uv) with:

from Blender import Image
imagelist = Image.Get()

Don’t try to use this with print btw, it will crash Blender. To print the image name use this:

from Blender import Image
for image in Image.Get():

(ectizen) #4

I actually did find Image.Get (and crashed Blender many times :wink: ) but it doesn’t help at this time. However your post in here has given me hope that Plan B (modifying the .blend externally) might work. Thanks!