I have a script that inserts three images (Image1, Image2, Image3) into a blend and then renders the video. It works great. The images show up exactly when and where they are supposed to.
The problem is that I want to be able to run the script as loop, picking up a different set of images each time through the loop. I have that part working just fine except...
The new images (Image1.001 - Image1.00n, Image2.001 - Image2.00n, Image3.001 - Image3.00n) simply overlay each other. Since I am using .png images with transparencies, this is a real problem. To be clear, these are foreground images, not a texture or anything similar.
I have tried everything I can find to delete, remove or replace the original images with the new ones via my script. Nothing I have found and tried has worked. I have to believe there is a way to do this.
Here is the relevant part of the code:
import bpy import csv import sys csv_path = sys.argv file = open(csv_path, 'rU') reader = csv.reader(file) fnt = bpy.data.fonts.load('../fonts/Helvetica-Bold.ttf') s = bpy.context.scene sed = s.sequence_editor sequences = sed.sequences header = next(reader) # 1st line is header` data = [ ] for row in reader: name0 = row pic2 = 'gfx/'+ row # car(s) pathout = 'renders/proj003/' + row + '.m4v' f = s.objects['Text'] f.data.body = name0 frame_start2 = 202 frame_end2 = 266 image_strip2 = sequences.new_image("Image2", pic2, 5, frame_start2) image_strip2.frame_final_end = frame_end2 image_strip2.blend_type = 'ALPHA_OVER' bpy.context.scene.render.filepath = pathout bpy.ops.render.render(animation=True) bpy.ops.wm.quit_blender()
Image1 Image1.001 Image1.002
Note that 'Text' is replaced properly.