Desired script for "wiggle" rendering for 3D

I’ve seen some “wigglegrams” – still images with 1 or 2 quick-changing frames which make an item look 3D without glasses or anything like that. I’m wondering if it is possible to write a python script that uses two cameras. For even number of frames, it would render from camera 1; for odd, camera 2. That way the animation would still render, but it would get some wiggle effect to make it look 3D.

Am I crazy? How difficult or easy would it be to implement this?

Something like this, but animated.

mini Python idea: your f (from range) is I think an integer so to check even or oneven use % :wink:

if f % 2 :
   #1 is True thus ONEVEN
   #0 is False  thus Even

Another way
Set the frame step to 2.
Render animation with start frame 1… eg 1,3,5,… with camera_odd
render animation with start frame 2 with camera_even

scene.frame_step = 2
scene.frame_start = 1 = camera_odd
bpy.ops.render.render(animation=True, write_still=True)
scene.frame_start = 2 = camera_even

I used app.handlers for this

import bpy

def cam_switch(scene):
    f = bpy.context.scene.frame_current
    if not f % 2:['Camodd']

#to remove last added handler type in console

After running this script when you ‘play animation’ or render it ,it will alternate between ‘Cameven’ and ‘Camodd’

The only comment I would add to Brenel’s solution is that you do not want to reference bpy.context directly. A scene is provided to you, make use of it. (very minor, but can prevent crashing during rendering)

import bpy

def cam_switch(scene):
    f = scene.frame_current
    if not f % 2:['Camodd']

remove the not before f%2 and swich eventuall odd and even part :wink:

Isn’t it easy enough to just render with Frame Step 2, first with camera A from frame 1, then with camera B from frame 2?
To be honest I suspect the result will mostly be headache-inducing. Here’s a superquick test…

maybe it works better at some other framerate? With some sort of frame blending?