Stereo Camera Python Script for Blender 2.5

Hi,

I just updated my Stereoscopic Camera Script for Blender 2.6, it is stable and works very well so far. Comments are welcome.

http://www.noeol.de/s3d/gui.png

Blender 2.6 Script (Update: Apr/2/2012):
http://www.noeol.de/s3d/stereoscopic_camera_1_6_7.py

Video tutorial: http://www.youtube.com/watch?v=HFhKxocDqnA

Web: www.noeol.de

bye

Sebastian

I tried your skript for 2.49
Basically it is great, also your page is awesome holds lot of useful information.
I used your script some time ago, sadly it didn´t satisfy my needs.

Its static, not working for animations, I can´t change the zeroplane via animation.
Also I sometimes got objects too close, so divergent looking would be needed, so I would need to get the zeroplane near in the animation and thus lessen the eye seperation.
Also linking the cameras is not what I like in animated scenes, I like them in one scene and then render one eye with the farm, check the animation for glitches, then render the other eye.
not output them via compositor which is not working with e.g. loki and rendering L/R each pass to find out I can redo it because of a glitch :stuck_out_tongue:

Another problem is, if you got vast exterior scenes and you got to shrink your scene by 0.1 to avoid zbuffer issues it gets messy with the shiftX (i know its the approximated version, but satisfyable) the values get too small =)

Maybe you´d like to adapt it to a camera constraint =) Thats what I was working on but I had to stop due to a lack of time =(

Great would be a constraint similar to the track to constraint on a center camera, which controls the 2 stero cams, aiming at an empty representing the zeroplane.
You can select an intended default eye seperation (i mostly use 6.5cm) and the shiftX gets calculated based on the distance of the target object. so you can animate the targetobject and the shift gets adapted accordingly, and if the zeroplane gets too near, the eye seperation lessens to ensure convergent looking.

At least thats the idea.

Another question. Do you know anything about “ghostbusting”?
I ran in the problem that I barely found any papers or informations on how to do it. And with Cineplexx Digital Cinemas its a huge problem… the good cinema projectors automatically adapt the images to prevent ghosting between the stereo images… The Digital servers in the Cineplexx cinemas all over europe use another tech and don´t have it.

And yes, there is a stereo 3D spot running in the constantine film group cinemas, that was actually done with Blender, at least in Austria =) As you are from Germany, you might have seen it too on Pro7.

I just wonder how long it is until they finally proof that stereo 3D is rather unhealthy… =)

Still, all my nagging aside, for stills your skript is the best there is unless you want to get your calculator out :slight_smile:

@arexma
thanks for your reply,
it’s right, you can’t anim the stereo camera itself (focal dist, cam separation), but this doesn’t mean that you only can do stills. I just want to make that clear for the other readers, of course you can create stereo animations in Blender with this script.

Adding keyframes to anim the stereo parameters is possible (in 2.49b) but I couldn’t find a comfortable to use and easy way to implement this in my old script, so I decided to focus only on the 2.5 version.

A lot changed in Blender 2.5 and anim the parameters (properties) is much more easier. But everything in Blender 2.5 (and the Python API) is still ALPHA, so programing is sometimes a little frustrating, but there are more and more good examples to understand the new concept.

How ever, I still working on my script and to anim the stereo parameters is my main goal.

Here is the last result/test:

Script: http://www.noeol.de/s3d/BStereoOffAxisCamera_0_5_2.py (only for Blender 2.5 ALPHA!)

Note: only works with a Build >= r28503 (Download at: www.graphicall.org)

Video: http://www.noeol.de/s3d/video_04.php (Flash or H.264)

In this script version it is possible to animate the parameters, but it is not very handy yet (the user has to set the keyframes manually) and I think this is not the best/right way to do so. But it works :wink:

Question:
Does anybody know how to trigger a python function (or operator) every single frame at the render process???

Sebastian

not working on Blender 2.5 beta

@mythcat

download the new Blender 2.5.3 beta version:
BStereoOffAxisCamera_0_5_4.py

or

BStereoOffAxisCamera_0_5_5.py for Blender 2.5.4 beta

This version can be register as an Blender Add-On and
shows the near and far plane parallax in pixel or degree.

Thanks for your great demonstration how to make red-blue stereo film!

Hello Noeol Thanks for updating this script, I use it a lot and was hoping to be able to use it in 2.5, now I can ! Great work.

How can I blend the two images and generate a 3d anaglyph video on MacOSX 10.6.4 ?

Hi Jenifer, it’s actually very easy, but I hope this will work in 10.6.4, because I only have MacOS 10.5.8

Take a look at this demo blend file: http://www.noeol.de/s3d/stereo_anim_comp_254.blend

If you hit Animation, Blender will create an uncompressed 100 frames quicktime video in the same directory as the blend file. This file is about 27 MB. If you want to compress an anaglyph video, be carefull, because a bad compression will destroy the stereo effect. The best way is to use the Quicktime Animation Codec.

The demo blend file contains also a workflow to create side-by-side images. Just connect the File Output Node instead the Viewer Node to save the png images in the same directory as the blend file. (Note to understand the side-by-side calculation: final side-by-side output = 1440px = left/right image width = 720px = Translation: 720/2 = +/-360px)

To do the whole render process for both views in one operation, I linked all objects into two new Blender Scenes, one for the Left-Camera with this camera as the active one and one for the Right-Camera with that as the active one … in the compositor you can then take the left- and right-scene as different render-inputs … see the blend file above.

hey noel,
great script so far!! I have a question… Is it possible that those left and right cameras copy the depth of field distance value of the main camera? I think this is important if you use dof in your videos!
Nevertheless, great work! :smiley:

Hi ndee,

thanks for the hint.

The new script (same version, same link) has four more lines, which copies the ‘dof_distance’ and ‘dof_object’ values of the center-camera.

wow!! that was quick!! thanks for your response!!

Playing around with the stereoscopic effect!! This looks great!!!
Is it possible to key the offset of the left and right camera?
Or do I always have to press the button “set stereo camera” ?

Hi ndee,

yes it’s possible, look at the vimeo video tutorial at 4:50

Press ‘Set Stereo Camera’ then set a (first) keyframe for:

  1. the ‘Stereo Window’ (LocSize)
  2. Left and Right Camera (Loc)
  3. ShiftX for the Left and Right Camera (with the mouse over the input and press ‘i’)

Go some frames ahead, change the Stereo Parameter (Camera Separartion or/and Focal Distance)
and press again ‘Set Stereo Camera’ then set the next keyframe for 1.-3. and so on …

Is it possible to use this script for 3d other than analglyphs?

If anyone has any questions about Christianity, please feel free to PM me.

of course!

the analgyph part was just an example, because everyone can see this result

in the compositor you can combine the left and right image to a side-by-side or over-under etc. output

The new script (v1.6.7) comes now with some stereoscopic Node-presets (Side-by-Side, Side-by-Side squashed, Above-Under, Red-Cyan, Amber-Blue and Interlaced) I hope this helps with the compositing.

Link: http://www.noeol.de/s3d/stereoscopic_camera_1_6_7.py

Web: http://www.noeol.de/s3d (incl. Video)

Hallo noeol, missing a link to v1.6.4 ? Or add comment above?

Fantastic camera rig, Sebastian, exactly what I was looking for. Test this in Cycles:

http://farm8.staticflickr.com/7159/6423258243_21cee08a5d_z.jpg

Would it be possible to setup environment/desktop where L and R camera are side by side and rendering LIVE in Cycles? Anyhow, your compositing preset is brilliant.

  • Jimmy Gunawan

You are damned good.:yes:
even I can almost follow your video. Really clear, really communicative. Thank you.