On 09/11/2015 at 04:49, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R13-R16
Platform: Mac ;
Language(s) : C++ ;
---------
Hi!
I've been trying to change the current render RenderData without success.
There's a few posts talking about this, they seem to work if I change the GetDocumenit() RenderData, but, if I want to change the current render, when it starts, it will not affect it.
It's a VideoPost plugin, I tried this code inside Message() listening to MSG_MULTI_RENDERNOTIFICATION, Alloc() and Execute(). If I print the RenderData pointer on Message() and Execute(), it's the same, but the values I've set are not passed to Execute().
> This is my code:
>
> // Document (persistent)
>
> RenderData *rd = GetActiveDocument()->GetActiveRenderData();
>
> rd->GetDataInstance()->SetBool( RDATA_STEREO, true );
>
> rd->GetDataInstance()->SetFloat( RDATA_XRES, 100.0f );
>
> rd->Message(MSG_UPDATE);
>
> // Current render?
>
> RenderNotificationData* rnd = (RenderNotificationData* )data;
>
> rd = rnd->doc->GetActiveRenderData();
>
> rd->GetDataInstance()->SetBool( RDATA_STEREO, true );
>
> rd->GetDataInstance()->SetFloat( RDATA_XRES, 100.0f );
>
> rd->Message(MSG_UPDATE);
>
> // rd->SetDirty( DIRTYFLAGS_DATA );
>
> rnd->doc->Message(MSG_UPDATE); // not sure if need this
>
> GetActiveDocument()->Message(MSG_UPDATE); // not sure if need this
>
> EventAdd();
There's 2 reasons I want to do that.
One is to force a low-res render on a demo version.
The other is to enable Stereo when certain conditions . The render is not stereo per se, but I use stereo channels to render the scene multiple times from multiple angles. I'm not sure if there's another way to do it, but I really need to render each frame multiple times and then combine them in the end, so the stereo workflow is perfect for that. I can tell the user to turn ON stereo but it sounds hacky, I would like to turn it on and off without having to force him into doing it.
If it's not possible, can I somehow abort the render? Then I can display a dialog asking to turn it on manually and try again.
Or better, I set the document RenderData, abort and trigger a new render.