How do you automatically render every other frame?

(Martin) #1

I have a complex physics-based animation which is much too long for my requirements and I’d like to render every other frame so that the result runs in half the time. i’d rather not sit at the PC hitting render every few minutes.

I’ve tried setting the frames-per-second in the render options to 12fps but it still renders every frame, playing the resulting film at half speed.

Any ideas, folks?

0 Likes

(Mmph!) #2

render them to PNG files, and delete the odd ones.

0 Likes

(BlackBoe) #3

Or you could scale the IPOs down to half the size. In the NLA.

This really shouldn’t be in ‘news and discussion’

0 Likes

(Martin) #4

My mistake, wrong forum, apologies - could an admin please delete or move?

0 Likes

(osxrules) #5

There is a Render Python module where you can invoke the renderer. You’d just use a mod function to choose the step size, something like:

import Blender
from Blender import *
from Blender.Scene import Render
import os

scn = Scene.GetCurrent()
context = scn.getRenderingContext()

Render.EnableDispWin()
context.enableExtensions(1)
context.setImageType(Render.PNG)
path = ‘/testdir/’
try: os.makedirs(str(path))
except OSError: pass
context.setRenderPath(path)
for i in xrange(Blender.Get(‘endframe’)-Blender.Get(‘staframe’)):
>if Blender.Window.GetKeyQualifiers() == Blender.Window.Qual[‘CTRL’]: break
>if i%2==0:
>>Blender.Set(‘curframe’,i)
>>context.render()
>>print ‘saving render%05d.png’%i
>>context.saveRenderedImage(‘render%05d.png’%i)

Replace the arrows with a tab each and run the script. Hold control between frames if you want to stop the render. It will output to your root directory in a folder called testdir and as PNG images. It uses %2 so renders every odd frame so change these values as necessary.

0 Likes

(san_diego_james) #6

definately no python needed. as was mentioned, open the ipo window, scale the ipo’s on the x axis to one half size. in other words, if the Ipo has “vertexes” starting from frame 1 and ending on frame 200 then when you scale it down on the “time axis” (x axis) to half the size, it will end on frame 100 (approx). so now everything will happen twice as fast, or in 100 frames instead of 200. now go and set the “fps” to 12 (or 1 half of the original) and render the animation.
the whole process should take about 20 seconds to do.

sorry for bumping this “non news” thread, but hey, we’re blenderheads, not mayanites

0 Likes

(Duoas) #7

Good Grief you people like to do things the hard way…

Just press F10 twice and change the Map New value to 50…

:rolleyes:

[edit] oh yeah, don’t forget to halve your FPS (as you already have)…

0 Likes

(IamInnocent) #8

Duoas

The problem is: same animation twice as fast.
Your remapping solution is by far the best use of Blender available functions, although I dont’t see why it would be necessary to touch to the FPS?

Maybe you really meant halving of the number of frames?

J.

0 Likes

(macouno) #9

No not fps… Duoas is right… the “map value”

read this page: http://download.blender.org/documentation/htmlII/x7775.html

It’s called the: Animation/Playback Sub-context

http://download.blender.org/documentation/htmlII/PartRE/buttons/gfx/buttonpanel75.png

0 Likes

(simhar) #10

i had the same problem some weeks ago…

but couldn’t get the answer. in MAYA there is a good attribute in the render settings called “by frame” - it renders just the second, third, fourth, etc. frame of an animation WITHOUT changing the basic animation. so…

by frame = 1 - every frame
by frame = 2 - every 2nd frame
by frame = 3 - every 3rd frame

it’s great! like i said, you don’t have to change the basic animation, it’s great for previews

shouldn’t be to difficult to code it for blender… yes, this is a suggestion :smiley:

S.

0 Likes

(IamInnocent) #11

Well, now you have one.
I am a bit surprised that even in this thread it took so long to come to something that I thought had to be of common knowledge to experienced users.

. in MAYA there is a good attribute in the render settings called “by frame” - it renders just the second, third, fourth, etc. frame of an animation WITHOUT changing the basic animation. so…

by frame = 1 - every frame
by frame = 2 - every 2nd frame
by frame = 3 - every 3rd frame

Well, it has the advantage of being simpler to understand but, by the look of it, it is definitely less powerful than the Blender mapping feature.
For example, how could you use your ‘by frame’ command to accelerate the anim by 2.45 for example? In Blender all there is to do is to divide the default ‘Map New’ value of 100 by the accelerating factor of 2.45 (IOW enter the expression ‘100/2.45’ in the ‘Map New’ field). Unless one want a pause at the end of the anim, the number of frames should be divided by the same factor.

To slow down the anim OTOH one just has to multiply the ‘Map New’ default value of 100 by the right factor. Want 5.34 times slower? Just multiply ‘Map New’ by 5.34. Likely you’ll want to increase the number of frames by the same factor.

NOTE:
Blender seems to drop the decimal part in fields that usually are set by whole numbers. I cannot tell if, internally, the decimal fraction is taken into account. If not the mapping is not all that precise but precision should be enough for most, if not just any, uses.

J.

0 Likes

(Duoas) #12

Glad to be of help.

Yes, the Map Old and Map New values change number of frames as a ratio. So if your animation were 100 frames long and you changed the map new to 50, your animation becomes half as many frames long (50). That is, 50 is one half of 100. I could get the same effect by giving an old value of 2 and a new value of 1. Or 80 and 40…

As a consequence of redefining the meaning of a ‘frame’ you have also modified the time it takes to complete your animation (in this example, you’ve halved it). Hence, you must also halve the number of frames per second – that is, make it take the same amount of time to display half as many frames in the resultant animation.

Sorry to play Captain Obvious… :eyebrowlift2:

IamInnocent: I haven’t really looked at the precision, but I imagine that internally Blender just divides the old by the new and uses the resulting double-precision to section the animation into frames… but in any case I agree that the modification is at best crude… It is, however, more capable than simhar’s Maya method.

-michael

0 Likes

(Martin) #13

That’s wonderfully helpful, I had no idea this function existed! Will post the result tomorrow when it’s finished rendering (in Finished Projects, ha ha)

0 Likes

(dukytyme) #14

This is one of the things I love about the Blender community; the amazing problems and solutions. You people are beyond cool.

Though, I am still afraid to try any of the new features, or big projects, I bookmark all of the cool ideas for the day I do.

Thanks much.

0 Likes

(mattebb) #15

Well, the map old and map new are right for this situation, but as a side note - animation timing is really a different feature to skipping frames, and skipping frames can be very useful and powerful in its own right, which Blender isn’t capable of.

Max has a similar feature, and we use it a lot at work when getting client approval on animation renders. For example, sometimes we’ll render every even frame (002.png, 004.png, 006.png, etc), get client approval on that, then render the remaining odd frames to fill in. Saves a lot more time than rendering the entire sequence only for the client to come back and ask for changes, and have to do it all over again.

Anyway, not that relevant to this thread except that there are things that Blender can learn from other ways of doing things too :slight_smile:

0 Likes

(osxrules) #16

It depends how you define ‘capability’. It’s possible via running a simple script as I posted earlier. Saving UV layouts is done via a script so Blender is no more capable of saving a UV layout as it is at skipping frames.

0 Likes

(IamInnocent) #17

Good points both.

J.

0 Likes