Setting keyframes with COFFEE

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 10/04/2009 at 11:35, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   11 
Platform:    Mac  ;  Mac OSX  ; 
Language(s) :   C.O.F.F.E.E  ;

---------
I'm trying to set keyframes for the currently active object by calling: CallCommand(12410); It works as long as I change the object position, rotation or scale. But, if the object is stationary, calling CallCommand(12410); doesn't set any keyframes. What do I need to do to make sure a keyframe is set, even if the object is not changing?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 10/04/2009 at 14:31, xxxxxxxx wrote:

Hi Rui.
Quick test and it works here, both with scriptmanager or with a Coffee Tag.

Cheers
Lennart

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 10/04/2009 at 14:43, xxxxxxxx wrote:

Well, so try this sample file. http://www.ruimac.com/files/Anim_Test.c4d.zip It should set a keyframe for the sphere object as soon as you add an asterisc to the beginning of its name. Then, it will delete the asterisc from the beginning of the name. It is set to only save position keyframes, but you can delete the lines that do that. Anyway, it is not working and I don't understand why 😞 Rui Batista

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 10/04/2009 at 17:17, xxxxxxxx wrote:

Hm. I guess you need to put in a AnimateDocument() or AnimateObject().
Putting the code into the ScriptManager and it runs fine.
So I guess the ScriptManager does a internal one frame animation
of some sort.

Cheers
Lennart

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 10/04/2009 at 17:24, xxxxxxxx wrote:

Well, I tried putting a AnimateDocument() and an AnimateObject() and it still didn't work 😞 Any more sugestions? Rui Batista

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/04/2009 at 11:52, xxxxxxxx wrote:

I'm not sure if there's a COFFEE equiv, but after the AnimateDocument(), see if you can:
DrawViews(DA_FORCEFULLREDRAW, NULL);

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/04/2009 at 12:00, xxxxxxxx wrote:

...my C++ code that does general scene animation basically uses this sequence (inside a loop) :
//----------------------------------------------------------------
// animate the document to the next frame
//----------------------------------------------------------------
StopAllThreads();
BaseTime stime = BaseTime::BaseTime(frame, fps);
pDoc->SetTime(stime);
pDoc->AnimateDocument(NULL, TRUE, TRUE);
EventAdd();
#ifdef _R10p1_SDK_
DrawViews(DA_FORCEFULLREDRAW, NULL);
#else
DrawViews(DA_FORCEFULLREDRAW);
#endif
// process this frame/scene here

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/04/2009 at 12:00, xxxxxxxx wrote:

Still no cigar 😞 This is what I have now:
> doc->AnimateDocument(ANIMATE_QUICK); EventAdd(EVENT_ANIMATE|EVENT_FORCEREDRAW); CallCommand(12410); // record a keyframe EventAdd(TIMELINE_CHANGED);
And it stll doesn't work 😞 This is probably a bug. Rui Batista

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/04/2009 at 12:17, xxxxxxxx wrote:

Sorry, I may not be much help (I haven't done any COFFEE), but if you're calling the equivelent of RecordKey(), you might end up needing to change your process somewhat and get the CCurves and call AddKey() on the curves directly.  This thread has more details, but may or may not apply to you.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/04/2009 at 03:44, xxxxxxxx wrote:

The problem here is that COFFEE doesn't allow the creation of keyframes. So, there is no RecordKey() or AddKey() in COFFEE. That is why I must use the direct call to CallCommand(12410); It is working fine if I do it inside a script made in the Script Manager. But not if I use it inside a COFFEE tag. Limitation? Bug? Ignorance? 😉

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/04/2009 at 07:06, xxxxxxxx wrote:

Howdy,

I'm not sure, but I think the key recording commands don't work from tags anymore in R11. :o(

If you look at this thread:
Autokey function
... I had been using the AutoKey() function in c++ from a tag in R9 and R10, but there was a change in R11 and that function didn't work anymore from the tag. I ended up writing my own auto key function so the keys could be set from the tag.

I find it odd that CTrack, CCurve and CKey classes were added to R11 COFFEE, but the AddKey() and InsertKey() functions were not included in the CCurve class.

Adios,
Cactus Dan