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 init.py 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()
This will print a similar result as below:
The result is what you need to add to an init.py file in your .nuke directory. Information about how to find your .nuke directory can be found here: Q100048: Nuke Directory Locations
4) Open the init.py file from your .nuke directory in a text editor. If no init.py file exists, then create one.
5) Add the following code to the init.py file, replacing the 'toScriptResult' with the 'version....\n' result from running the previous code in the Script Editor, as above:
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 init.py 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:
We're sorry to hear that!Please tell us why.