4
$\begingroup$

Kind of like a TV, CCTV, or the portal for Portal and Portal 2, so I can see what the camera is seeing on an object. I don't care whether its a material or a modifier, or something like that, even if someone will make a script that is a node or whatever as long as it works, nothing specific as in how I would go about it.

$\endgroup$
  • $\begingroup$ I'm not looking for an effect, I'm looking for a way to see the camera on an object. $\endgroup$ – chabad360 Mar 3 '16 at 3:43
  • 1
    $\begingroup$ What do you want to view, or visualize? Do you just want to see what part of the scene the camera can see? $\endgroup$ – David Mar 3 '16 at 4:10
  • $\begingroup$ yes (I have a gut feeling that this is only possible with a custom pynode, and I havent gotten around to learning it python) $\endgroup$ – chabad360 Mar 3 '16 at 4:21
  • $\begingroup$ maybe related: blender.stackexchange.com/questions/7812/… $\endgroup$ – cegaton Mar 3 '16 at 4:35
  • $\begingroup$ yes, that would work but I want it in cycles. $\endgroup$ – chabad360 Mar 3 '16 at 20:31
6
$\begingroup$

I think you have two options: one in "real time" and another two-stepped.

The two steps workflow

This is the simplest one. You have your scene with two cameras and a screen in which we are going to see the view of one of the cameras.

The first step is rendering the view of the CCTV camera so you have an image sequence of what camera is seeing. For this, select the camera Ctrl Numpad 0 to make it the scene's active camera. Then render the scene.

Note that this render might have the same aspect ratio than your screen object.

After the render, simply add the image sequence as a texture on your screen material. Make the other camera the active one and render.

The "real time" workflow

With this workflow, which involves the compositor, you'll be able to see the real view of the CCTV camera in one F12 push.

Having your scene with the two cameras and the screen, these are the steps. (Also I've provided an example .blend below)

  1. As a scene can only have one active camera in any given frame, we need another scene for rendering the CCTV camera. So create a new scene with Linked Object Data. Doing so, if you change datablock related stuff in any scene, it changes in both. But not transformations so I recommend waiting until the end to start this workflow. enter image description here

  2. In this new scene (lets call it CCTV scene) select your CCTV camera and make it the active one by Ctrl Numpad 0 it.

  3. If necessary, change that scene's render dimensions to match the screen's aspect ratio.
  4. In the main scene select the screen object and move it to another layer alone. Press M and hold Shift when you select the new layer so you can have it in both layers. Doing this you'll have your main render as expected.
  5. Now go to the Render Layers tab add a new layer, name it "Screen". Enable only the layer where the screen object is and, in the Passes panel, enable the UV pass. enter image description here

  6. Now lets go to the Compositor.

  7. Add the three render layers: the main one and the Screen one from the main scene and the main render layer from the CCTV scene.
  8. Connect the CCTV node image output into the image input of a Map UV node. Then connect the UV output from the Screen render layer to the UV input of the Map UV node.
  9. Now Add the output of that Map UV node to the main render layer. enter image description here

And here is the example file:

$\endgroup$
  • 1
    $\begingroup$ Any suggestions how to handle multiple cameras/screens? In my case the "main" scene is static, possibly masking the uvs using a mask and multiply node? $\endgroup$ – Teris Jun 26 '17 at 21:15
  • $\begingroup$ I have to manage multiple instances of this too. Is there any way to make this work with the Material Nodes instead of the Compositor? $\endgroup$ – RobotUnderscore Jun 29 '17 at 23:41
  • $\begingroup$ @RobotUnderscore I'm afraid you can't. I think you might need to use the first approach, but rendering as many CCTV cameras as screens you have in your scene. $\endgroup$ – Antonio Buch Aug 1 '17 at 14:55
  • $\begingroup$ Blend file doesn't render in Blender 2.79 $\endgroup$ – Jubei Jul 18 '18 at 9:47
  • 1
    $\begingroup$ @Jubei Works fine for me in 2.79a. $\endgroup$ – B Layer Sep 23 '18 at 12:25
-1
$\begingroup$

Did you try the compositor?

Just create a camera that points at what you want, render that camera into a file and use that file as a texture on the monitor displaying the "camera feed".

Technically, yes, this will make the "feed" lag behind one frame, but really nobody will notice.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.