In this tutorial we will discuss about how to create a camera object and some cool things you can do with said object. Be sure you check out the Render an Image Tutorial so that you know how to set up and color a data object.

The Simple Way

The simplest way to create a static camera is by framing the scene in the Scene View window. To do this, place your mouse anywhere in the Scene View area, and press the "Esc" key on your keyboard to exit out of selection mode. Then, on a three-button mouse, click and drag with the left mouse button to tumble, the right button to dolly, and the middle scroll wheel to pan. Once you have the scene framed, select the yellow “no cam” dropdown in the top right corner of the Scene View, and select "New Camera". This creates a camera, looking at exactly what you see in the Scene View.

More Advanced Methods

In the GUI: Place your mouse anywhere in the Network View wendow and press the Tab key on your keyboard. This well bring up the TAB Menu. You can navigate to Render->Camera, or just type "camera", select Camera, and click to put down the Camera node.

With the camera selected in the Network View, in the Parameters View, one can edit many parameters, including "Translate" and "Rotate", and "Resolution" under the "View" tab.

One can also translate/rotate the camera directly in the Scene View. To do this, mouse over the Scene View and press T on the keyboard to translate, or R to rotate. You also select the translation/rotation icons in the Selector and Handle Controls to the left of the Scene View.

Click and drag the camera in the Scene View to put it in the desired position. To preview what the camera is seeing, select the yellow "no cam" dropdown in the top right corner of the Scene View, and select the camera name in the dropdown menu.

Now we are going to do a bit of coding. Open the Python Shell in the “Windows” menu.

In the Python shell, type the following:

objNode = hou.node('/obj')
camNode = objNode.createNode('cam', ‘cameraName’)
This will create a camera called “cameraName”, with default properties. To update any of the properties, first find the name of the property you want to change. The easiest way to find the parameter name is by mousing over the parameter in the UI. A popup will appear that tells you this name. In this figure, mousing over “Resolution” displays the information “Parameters: resx resy”.

We can now take these names and update the resolution by typing:

camNode.parm(‘resx’).set(1920)
camNode.parm(‘resy’).set(1080)


More about Shaders

Previous Tutorial

Simple Analysis Plots

Next Tutorial