How to hide an object from one of the stereoscopic cameras?

I’m digging the 2.75 stereoscopic camera built into Blender, but I was wondering…is there any way to hide an object from one of the stereoscopic cameras?

For example, let’s say I want a particular plane object to be only visible by the left camera, but not the right. Is there a way to do this?

Not that I know of… Is there a reason why you want your eyes not to be able to focus on the object?

Yes, the reason is because I want to put stereo images/stereo videos inside of a stereo scene. I could do that with my stereoscopic workflow add-on, but if it’s not possible to do that out of the box with 2.75, I’ll dig into the source and code my own solution.

I have had the chance to play with them but have you tried having the camera itself render the image?

I’m not sure what you mean. I want to use the stereo camera to render the image, but I want to make certain objects invisible to one of the cameras – but not the other.

I only know a little bit about render layers, but I was thinking it would be possible to do something with that, but it seems that multiview is treated as a subset of layers.

It doesn’t seem possible use a Light Path node on a material so that a material would be visible to the left or right camera…though maybe there’s some clever way to incorporate that.

I haven’t had time to explore this further – and won’t have time to dig into the code for this at the moment – but if anyone has any suggestions, I’m all ears.

This is pretty straightforward, actually.

You are right that you’ll need render layers. Here’s the basic method:

  1. Put the object[s] you want to hide for one eye on layer 2.
  2. Put everything else on layer 1.
  3. Set up TWO render layers.
    — The first one (“ALL_LAYERS”) enables all layers.
    — The second one (“HIDE_LAYER_2”) disables the second layer in the “Layer” section:


When you render, Blender will make two versions of your animation:

  • one with everything, and
  • a second with everything except for the stuff on Layer 2.

In your compositing nodes, bring in both render layers (duplicate the standard input), and add the new “View Switch” node (or “Switch View” – it’s listed as both in different places). The “View Switch” node can extract a specific “eye” from the stereoscopic render.

Pipe the “ALL_LAYERS” render into one eye, and the “HIDE_LAYER_2” render into the other, like so:


That’s it! Reasonably straightforward, though your render time is going to double, more or less. I’ve attached the .blend file from this example to this post.

By the way, I just made a 30-minute tutorial to introduce some of the new Stereoscopic features in Blender, in case those interested in your stereoscopic workflow want to get oriented to what the Blender folks have been up to: youtu.be/e3I4OwLuZag

cheers

Attachments

Stereoscopic_HideObject.blend (721 KB)

Thank you for the detailed response. I’ll experiment with this, just to get more familiar with render layers. I will also check out your video, as that sounds like it will be really helpful.

Unfortunately, I don’t see the above workaround as the ultimate solution for me, as doubling the rendering time is unacceptable in my workflow. I regularly render 20 second animation clips that take several days – with seven computers with GTX 480s running 24x7. I cannot imagine doubling the time (and electricity) it already takes to render things, just for this one feature.

You can enable/disable the left and right eyes independently. Thus you can render in three steps:

  1. only left eye with the object visible

  2. only right eye with the object invisible

  3. compositing

That said, the compositor shouldn’t render the renderlayer that is not being used in the nodetree. If it does I’m afraid it may be an issue in the compositor design, not so much of multiview. It’s worthy reporting as a bug though.

And by the way, I thought no one was aware of the View Switch node. I’m glad people found its usage :wink: I hope the multiview documentation is doing its job properly.