THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 15/11/2008 at 13:08, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.1
Platform: Windows ; Mac ;
Language(s) : C++ ;
---------
Hi,
I'm trying to implement a keyframe recording function. To do that, I iterate the frame range that should be recorded, set the scene time and then animate the document. After that, I create keyframes for the objects that should be recorded with a selfmade function (this is called in another part of the plugin).
But something doesn't work with BaseDocument::SetTime().
This is my code:
> LONG minFrame = doc->GetMinTime().GetFrame(doc->GetFps()); \> LONG maxFrame = doc->GetMaxTime().GetFrame(doc->GetFps()); \> LONG cFrame = minFrame; \> LONG cFPS = doc->GetFps(); \> LONG sVal = C_ZERO; \> \> while (cFrame <= maxFrame) \> { \> sVal = (LONG)((cFrame - minFrame) / (maxFrame - minFrame) \* 100); \> StatusSetBar(sVal); \> StatusSetText("Recording Frame " + LongToString(cFrame)); \> BaseTime cTime = BaseTime::BaseTime(cFrame, cFPS); \> doc->SetTime(cTime); \> doc->AnimateDocument(NULL, TRUE, TRUE); \> EventAdd(EVENT_FORCEREDRAW|EVENT_ANIMATE); \> DrawViews(DA_FORCEFULLREDRAW, NULL); \> cFrame++; \> }
And here's the problem: Keyframes are created fine, but not all frames are created. For example: if I record from Frame 0 to Frame 100, keyframes are missing at Frame 0, Frame 19 and Frame 91.
I guess, I set the scene time wrong with BaseTime cTime = BaseTime::BaseTime(cFrame, cFPS);. Got that method this thread.
Thanks in advance for any help!
Greetings,
Jack
Also, will this work in R11, too? I develop using the 10.1 SDK, but of course it should run in R11, too.