PDA

View Full Version : Edit camera path by TCL


rainypark
25th October 2011, 17:20
Hi,

I am trying to add a couple of views manually into a camera path by using the keyframe camera path editor.

I have tcl code as following:

set cp [create HxKeyframeCameraPath]
set cpe [create HxKeyframeCameraPathEditor]
$cpe attache $cp
$cp fire

for loop{
... set values to view position (px, py, pz) and direction (dx, dy, dz)

viewer 0 setCameraPosition $px $py $pz
viewer 0 setViewDirection $dx $dy $dz

$cp portKCPEButtons setValue 0 1
$cp portKCPEButtons send
$cp fire
}

The resulting camera position and orientation is correctly set, but the path connecting these cameras is wrong ( big local loops connecting the cameras instead of a smooth spline/cubic curve)

Can anybody tell me how to make smooth campath curve in TCL?

Thanks a lot!

Rainy

Daniel Lichau
4th November 2011, 12:54
Hi,

You need to "fire" the camera path editor also just after camera change so it can somehow take into account new camera position before adding new key:
...
viewer 0 setCameraPosition $px $py $pz
viewer 0 setViewDirection $dx $dy $dz

$cp fire
$cp portKCPEButtons setValue 0 1
$cp portKCPEButtons send

$cp fire
...

This happens quite often that you have to "fire" a module before modifying its ports to make it updated with previous changes it may depend on, while this does not appear when using modules interactively.

Hope this was not to late to help.

Daniel

rainypark
6th November 2011, 15:48
Dear Daniel,

Thanks so much for your help! I have another question:
After I add each camera as keyframe, the time automatically moves forward 10 units. Is it possible that I can control how much time the time moves forward ?(e.g. in interactive mode, I can mouse-click any position in time slider, or enter a value at the right-end edit box, to control the time next keyframe will be added).

Thanks in advance,

Rainy