Create a ticket

Q100413: Adding custom Rig Presets to the C_CameraSolver node


In the C_CameraSolver node in CaraVR, there is a list of preset rigs which can be used as a good basis to solve a 360 shot. 

This article describes how you can add your own rigs to this list, which should enable artists to use the same starting point for a particular rig. This allows solves between shots to be more consistent and solved more quickly.



In order to create a custom preset that would appear in your C_CameraSolver node, you need to add the specific rig to an file in your .nuke directory. This can be done by following the steps below:

1) Create a C_CameraSolver node, and solve it for the particular camera rig you would like to create a preset for, as shown below: 

More information about solving a shot can be found in our Online Help here: Solving Cameras

2) Select the C_CameraSolver node and in the Script Editor, run the following code:

node = nuke.selectedNode()
print repr(node.knobs()["cameraRig"].toScript())

This will print a similar result as below: 

The result is what you need to add to an file in your .nuke directory. Information about how to find your .nuke directory can be found here: Q100048: Nuke Directory Locations

4) Open the file from your .nuke directory in a text editor. If no file exists, then create one.

5) Add the following code to the file, replacing the 'toScriptResult' with the 'version....\n' result from running the previous code in the Script Editor, as above:

def setCustomCameraRig(rigNode):
  rigNode['rotate'].fromScript("0 0 0")
_gRigDefinitionPresets.append(("RigName", "setCustomCameraRig(nuke.thisNode())", "Rig tooltip"))

This will look something like:

NOTE: Changing the "RigName" and "Rig tooltip" strings in the final line of the example code will change the name of the rig preset and its tooltip inside Nuke. 

​6) Save the file

7) Close and Open Nuke, now when you create a C_CameraSolver node your custom preset should appear in the Preset drop down like: 

Was this article helpful?

We're sorry to hear that!

Please tell us why.
3 out of 6 found this helpful