THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/03/2006 at 07:14, xxxxxxxx wrote:
Cinema 4D Version: 9.52XL
Platform: Mac OSX ;
Language(s) : C.O.F.F.E.E ; XPRESSO ;
I'm very new to C.O.F.F.E.E. and was wondering if it was possible to connect a var to user data (or vis versa) like one does in Xpresso. I'm trying to modify the 'Infinate Rotation' expression to be able to control and keyframe the speed through user data.
I did a quick search here, found 1 not very similar post that wasn't answered so I thought I'd post my own
On 08/03/2006 at 12:12, xxxxxxxx wrote:
Add your UserData fader on the Cube (it is the operator).
Replace "2.0" (After var the_Speed = )
In the top it sais:
main ( the_Document , the_Object )
Making a new script it is more common to use:
main ( doc , op ).
Then it would be:
var the_Speed = op#ID_USERDATA:1;
If you add another UserData fader it would be:
var whatever = op#ID_USERDATA:2;
On 08/03/2006 at 12:33, xxxxxxxx wrote:
I read through the C.O.F.F.E.E. html file and I'm going to go through the tutorials when I get a free weekend.
Thanks again (Tak in Swedish, no?) and I love SteadyCamPro!
On 09/03/2006 at 12:10, xxxxxxxx wrote:
OK, so I made the modifications and it works.
-I didn't update the code to the more recent and proper stuff though as I kept getting an error.
My problem now is that when I keyframe a rotation speed, then, farther down the timeline, keyframe a different (slower) speed, the interpolation counter-rotates the object. I don't think this is a code problem but posted below is the relevant C.O.F.F.E.E.
Anyone have an idea?
main ( the_Document, the_Object)
var the_Orientation = vector ( 0, 0, 0 );
var the_Rotation = vector ( 0, 1, 0 );
var the_Speed = the_Object#ID_USERDATA:1;
var the_Object_Rotation = Mix ( the_Orientation, the_Rotation, the_Document->GetTime ( )->GetSecond ( ) * the_Speed );
the_Object->SetRotation ( the_Object_Rotation );