1
$\begingroup$

I have a model with the material set up, but I wish to change an image texture on this model for each frame. In the past I have set up an image texture node and mix shader for each texture but this is time consuming.

I wish to automate the process a little and have it so that blender sets the number of frames to be rendered to the number of textures / image files in any chosen folder and for it to load each texture for each frame.

I believe this should be doable in python but I am rather new to scripting in python. Is anyone able to point me in the right direction for this?

$\endgroup$
2
$\begingroup$

Use an image sequence as input for your Image Texture node then render an animation.

enter image description here

When clicking the folder button in the Image Texture node to browse for files make sure you tick the option Detect Sequences to the bottom left of the File Browser.

enter image description here

Pick all images in the folder and set them up as an animated texture sequence, adjust the sequence speed so it matches on picture per scene frame.

enter image description here

You will have to make sure your image files have consistent naming and identical file format, so Blender can detect them as a sequence. That means a base name similar across all files, plus a numbering scheme. Say something along the lines of Base_File_####.extension.

$\endgroup$
  • $\begingroup$ Thank you, this is a significant upgrade to what I was using before. Is there any way to modify the node that allows it to read every single image file in a single folder? $\endgroup$ – Yoshihara Apr 16 at 13:05
  • $\begingroup$ Why not just batch rename files? It is probably a lot easier, there are dozens of automated renaming utilities around. $\endgroup$ – Duarte Farrajota Ramos Apr 16 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.