Render Elements 0.6.2

Thanks to Francky, who found a bug where not all post effect settings were being recorded. Particularly in Vray, textures in the environment slots were not being recorded or restored correctly. To fix this, I ended up having to recode the way render settings are saved/recalled. Not sure if this will affect projects with previous versions of the plugin or not. In the end, though, this will be more stable and ensure ALL render settings get recorded.

Previously, I was recording render settings like so…

BaseDocument* doc = GetActiveDocument(); if(!doc) return FALSE;
RenderData* rd = doc->GetActiveRenderData();
RenderData* newRD = RenderData::Alloc();

//Copy contents of rd to newRD
newRD->SetName(REname);
BaseContainer settings = rd->GetData();
BaseContainer* newSettings = newRD->GetDataInstance();
settings.CopyTo(newSettings, NULL);
//Copy VideoPost Plugins
PluginVideoPost* pvp = rd->GetFirstVideoPost();
while(pvp!=NULL)
{
if(pvp == NULL) break;
LONG type = pvp->GetType();
PluginVideoPost* newpvp = PluginVideoPost::Alloc(type);
BaseContainer pvpSettings = pvp->GetData();
BaseContainer* newpvpSettings = newpvp->GetDataInstance();
pvpSettings.CopyTo(newpvpSettings, NULL);
newRD->InsertVideoPost(newpvp, NULL);
pvp = pvp->GetNext();
}

doc->InsertRenderData(newRD, doc->GetFirstRenderData()); //data to insert, render data to insert after
doc->SetActiveRenderData(rd);

Now, it’s as easy as…

BaseDocument* doc = GetActiveDocument(); if(!doc) return FALSE;
RenderData* rd = doc->GetActiveRenderData();
RenderData* newRD = RenderData::Alloc()

newRD->SetName(REname);

rd->CopyTo(newRD, NULL, NULL); //Copy contents of rd to newRD

doc->InsertRenderData(newRD, doc->GetFirstRenderData()); //data to insert, render data to insert after
doc->SetActiveRenderData(rd);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s