THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/07/2008 at 06:59, xxxxxxxx wrote:
Cinema 4D Version: 10.5
Platform: Windows ;
Language(s) : C++ ;
I am currently working on a command plugin and trying to create and animate a camera from there.
I am guessing that I can simply add a CameraObject to the scene. What do I do though to
- set the camera's Pan, Tilt, Roll and other parameters
- set these for a specific frame to animate the camera?
On 23/07/2008 at 02:54, xxxxxxxx wrote:
You can set the orientation and position of any object in Cinema4D with SetPos() and SetRot(). Alternatively you can set the object's matrix with SetMg() or SetMl() (global or local matrix).
To set object parameters you have to change the object's container. Get the container, the ID of the parameter and call the according Set function. Check the example below, it changes the projection mode of the camera.
> \> BaseContainer \*data = cam->GetDataInstance(); \> data->SetLong(CAMERA_PROJECTION, Pparallel); \> \> cam->Message(MSG_UPDATE); \> \> EventAdd(); \>
\> BaseContainer \*data = cam->GetDataInstance(); \> data->SetLong(CAMERA_PROJECTION, Pparallel); \> \> cam->Message(MSG_UPDATE); \> \> EventAdd(); \>
You have to create tracks to animate objects. Check the CTrack/CCurve/CKey classes. CTrack::Alloc creates new tracks. Check the SDK docu and the Morphmixer SDK exmple for creating tracks and keys.
On 13/08/2008 at 02:01, xxxxxxxx wrote:
Many thanks Matthias,
I found the CTrack/CCurve/CKey mechanism in the SDK and it works like a charm.