prerendering for sequencer

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Tue Aug 30, 2005 12:51 pm
Location: Kemerovo, Siberia

prerendering for sequencer

Post by AkhIL »

I did simple script to increase sequencer functionality.

Idea is simple:

You select some _hard_ strip like scene or glow or even transitions which slowdowns playback and push rendering->sequencer preredner
script renders region where this hard strip located and puts rendered sequence over all strips. After it sequencer should play this sequence instead of rendering its source.

OK. But I have one problem.
BSE evaluates strips in _CRAZY_ order and I can't overlay part of timeline.

Please make some predictable order for strip rendering like render topmost strip.

This is cript listing:

Code: Select all

Name: 'Sequencer prerenderer'
Blender: 245
Group: 'Render'
Tooltip: 'renders selected strip to plain png sequence'

#   Author: IL'dar AKHmetgaleev aka AkhIL
#   e-mail: akhilman at gmail dot com
#   web:
#   This code is licensed under 
#   Creative Commons Attribution 3.0 Unported License

from Blender import *
scn = Scene.GetCurrent()
seq = scn.sequence

active_strip =

if not active_strip:
    print 'select one strip'
    raise Exception

start = active_strip.start \
        + active_strip.startOffset - active_strip.startStill
end = active_strip.start + active_strip.length - 1 \
        - active_strip.endOffset + active_strip.endStill

start = max(start,1)
end = max(end,1)

context = scn.getRenderingContext()

old_start = context.startFrame()
old_end = context.endFrame()
old_renderpath = context.renderPath
old_extensions = context.extensions
old_imagetype = context.imageType

context.renderPath = '//tmp/seq.prerender/'
context.extensions = True
context.imageType = Scene.Render.PNG


channel = max( map( lambda x:, seq ) ) + 1
data = ( context.renderPath, map(lambda x: '%04d.png'%x, range(start,end+1)))
strip =,start,channel) = "prerender"

context.renderPath = old_renderpath
context.extensions = old_extensions
context.imageType = old_imagetype


Posts: 0
Joined: Tue Jul 01, 2008 3:28 am

Re: prerendering for sequencer

Post by spamagnet »

AkhIL wrote:I did simple script to increase sequencer functionality.
That looks cool, thanks! I have been thinking about implementing a simple media management system for the Blender VSE, and this script might give me some ideas.

Post Reply