Take the 2-minute tour ×
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It's 100% free, no registration required.

Is it possible to automate the sequencer so that each time I render an animation into image files in a folder, the newly rendered image files would be inputted into the sequencer in a specific arrangement or something like this?:

  1. Load images 1-300 and place in sequencer
  2. Load images 1-300, again, and place after first image sequence
  3. Apply backwards effect to the second image sequence

If not an option in blender, is there a way to create a script to do this? Often I will rerender the same animation with a different setting or something, but every time I have to manually apply what was described above. I'm not necessarily asking for a solution specified to this example, but for all examples like this. Is there something that would work to automate this process?

Any help is appreciated. If what I am describing is unclear I can further describe it.

share|improve this question

2 Answers 2

up vote 6 down vote accepted

Yes, blenders sequencer has full Python API access so it can be used to do quite advanced video editing both from the UI or in background mode (headless).

import os

from bpy import context
scene = context.scene

path = "/my_path/to/images"
files = os.listdir(path)
files.sort()

# create the sequencer data
scene.sequence_editor_create()

seq = scene.sequence_editor.sequences.new_image(
        name="MyStrip",
        filepath=os.path.join(path, files[0]),
        channel=1, frame_start=1)

# add the rest of the images.
for f in files[1:300]:
    # note, for 2.71, `push` will be named `append`
    # to better fit with the Python API.
    seq.elements.push(f)

# reverse if you want
seq.use_reverse_frames = False

The rest I'm sure you can work out.

share|improve this answer

Yes, It is quite possible (ideasman42 already gave an example of the Sequencer API usage).

You can also setup the automation logic that will create/update your sequencer using a render complete handler. In your addon, You can register the sequencer setup handler to run after render completes.

@bpy.app.handlers.persistent
def process_in_sequencer(self, context):
    <logic goes here>

bpy.app.handlers.render_complete.append(process_in_sequencer)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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