On 07/03/2016 at 01:55, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R17
Platform: Windows ;
Language(s) : C++ ;
---------
Hello.
I have my own renderer and whenever i have to render a C4D document for a specific frame (lets say frame 20), I use doc->ExecutePasses(thread, TRUE, TRUE, TRUE, BUILDFLAGS_EXTERNALRENDERER) to calculate the animation. The variables doc and thread are taken from VideoPostStruct parameter of VideoPost's Execute method.
I have an effect that requires the object global matrices of future frames.
So whenever I have to pass any object's matrix in my renderer, i do the following as well:
BaseTime original_time = doc->GetTime();
Int32 fps = doc->GetFps();
doc->SetTime(BaseTime(future_frame , fps)); //set future frame
doc->ExecutePasses(threa, TRUE, TRUE, TRUE, BUILDFLAGS_EXTERNALRENDERER);
Matrix object_matrix = object.GetMg();
doc->SetTime(original_time); //revert frame
doc->ExecutePasses(NULL, TRUE, TRUE, TRUE, BUILDFLAGS_EXTERNALRENDERER);
Is this the correct way to get the required global matrix from an object in specific future frame ?
If I have hair in my scene, I execute passes for every frame from 0 to future_frame.
Thank you for your time.