Updating with AnimateDocument()
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/06/2007 at 13:24, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9.603
Platform: Windows ;
Language(s) : C++ ;---------
Hey Guys,
I have a plugin that loops through a specified amount of frames within the active document, uses the ModelingCommandData struct to run the Current State to Object command on the active object for each frame. As the plugin makes the document loop through all of the frames the viewport does not update. Now the AnimateDocument() function sounds like it should update all values when called, while the EventAdd() function will update the editor. I am calling both of these commands for each frame in my loop, but nothing updates until the loop ends. Any ideas on whats going wrong? Thanks in advance for any help.
One thing that I should mention is that I have also tried AnimateObject(), which seems to do the same thing.Here is some sample code:
ModelingCommandData mcd; mcd.doc = doc while(currentTime < rangeMaxTime) { currentTime = doc->GetTime(); doc->AnimateDocument(NULL, TRUE, TRUE); EventAdd(); mcd.op = doc->GetActiveObject(); if(!SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT, mcd)) return TRUE; //finish rest of commands //Go to the next frame CallCommand(12414); }