THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 20/11/2008 at 17:43, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 11
Platform: Mac OSX ;
Language(s) : C.O.F.F.E.E ; XPRESSO ;
---------
Hi,
I've had success moving keyframes with both a COFFEE tag and also a COFFEE Xpresso node, in both the editor and renderer (picture viewer), with animation tracks, using this code:
main()
{
var doc = Input1->GetDocument(); // when in Xpresso
var obj = doc->FindObject("Cube");
var track = obj->GetFirstCTrack();
var myKey = track->GetCurve()->GetKey(0); // key 0 is first key
var time = new(BaseTime);
time->SetFrame(5,doc->GetFps()); // move to frame 5...
myKey->SetTime(track->GetCurve(),time);
}
However, when it comes to moving a keyframe on a Tag, the code works in a COFFEE tag in both the editor and renderer, but only in the editor with a COFFEE Xpresso node:
main()
{
var doc = Input1->GetDocument(); //when in Xpresso
var obj = doc->FindObject("Cube")->GetFirstTag();
var track = obj->GetFirstCTrack();
var myKey = track->GetCurve()->GetKey(0); // key 0 is first key
var time = new(BaseTime);
time->SetFrame(5,doc->GetFps()); // move to frame 5...
myKey->SetTime(track->GetCurve(),time);
}
... when rendering and using Xpresso the line 'var myKey...' throws the error (5) Incompatible values... NIL / OBJECT
Can anyone please shed any light on this?
Thanks
Jon