PDA

View Full Version : Reset camera pivot


spedler
03-27-2009, 05:59 PM
This is probably the shortest script on record, but I find it useful. There's an extremely handy command in R10.5 and above which allows you to set the active camera's pivot point, so that the camera can rotate around any point rather than just the active object (or world centre if there is no active object). By default the shortcut for this is the Insert key.

Unfortunately there doesn't appear to be a corresponding command to reset the pivot to the default - you have to go into the attribute manager for the camera and select Rotation->Default. This little script does the same thing but lets you assign a shortcut (I have it set to Shift+Ins). Here's the script:

// resets the camera pivot to its default
main(doc, op) {
var cam;
// get the active camera
cam = doc->GetRenderBaseDraw()#BASEDRAW_DATA_camera;
// now reset rotation to Default
cam#CAMERAOBJECT_MODE = 0;
}

Hope you find it useful.

govinda
03-29-2009, 05:49 PM
Hugely useful! I've been hoping someone in the coding world would see the need for this as much as I have.

CGTalk Moderation
03-29-2009, 05:49 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.