A switcher node with stereo camera rigs

   2238   5   2
User Avatar
Member
3 posts
Joined: Dec. 2013
Offline
Hi, I have a multiple stereo cameras and would like to use a switcher node to change the 3D view with the cameras. A couple of problems I have are:
  • 1) The view becomes always stereo since I could not connect an individual camera (left, center or right inside a stereo camera) to the switcher.

    2) I would like to have an overlay to show a camera name with the switcher node. The overlay works with a font node in left camera, but, cannot hook the camera directly up to the switcher, so never display it on the switcher's view.
    Would be greatly appreciated if anyone know how I could solve those issues. Thanks.
User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
I made a simple DA to switch between subCameras(Left - Center - Right) of the Stereo Camera for you.

Maybe Houdini has a very very simple tool for this aim,But I don't know right now :?

I this DA I used this python script to set viewport to specify subCamera from Stereo :

hou.ui.paneTabOfType(hou.paneTabType.SceneViewer).curViewport().setCamera(hou.node(“../cam1”))

You can use this code in the CallBack script from Buttons (or etc)

To use this DA ,You can install attached otl file to your project 8)

Attachments:
JK_Switch_SubCamera.zip (21.3 KB)

https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Staff
1449 posts
Joined: July 2005
Offline
Hi Taz,

the way the Switcher OBJ node works with Stereo Camera Rig HDA is like this:
- switcher takes the node on the input specified with Switch Camera parameter
- since it's an HDA, it asks it for the representative node to determine the HDA's type and capabilities
- the Stereo Camera Rig specifies ‘stereo_camera’ child node as Representative Node in the Operator Type Properties Editor (in RMB > Type Properties on that node)
- since ‘stereo_camera’ is the native stereo camera operator, it gives the stereo image in the viewport

So it's tricky to access the left/right sub-cameras from the switcher. Joker's example is probably the path to go.

You could adapt these scripts to work with Switcher OBJ by adding these buttons on switcher node itself in Edit Parameter Interface and perhaps save the final node as a gallery entry for reuse. The scripts could query the “Switch Camera” parameter value, access the corresponding input node (stereo cam rig), construct the path to the left/right sub-cameras and then continue on with the example code to set the viewport to the chosen sub-camera.
User Avatar
Member
3 posts
Joined: Dec. 2013
Offline
Hi Joker and Rafal,

Thank you so much for your suggestions and explanations! The scripting method would be a perfect solution for my purpose.
User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
Your welcome my friend

I made it more complete than previous Digital Asset and add some extra options and code for this.

If you like to learn more about Python Script ,You can download attached otl file and use it

Attachments:
JK_Switch_SubCamera.otl (22.9 KB)

https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
3 posts
Joined: Dec. 2013
Offline
Joker,

That was a nice addition to the example!! I am a newbie in here, so everyday I learn something new. Thanks, again!
  • Quick Links