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);