PDA

View Full Version : Light cache Flythrough auto Mblur


M!ke
11-25-2010, 11:01 PM
Well as the title tries to explain here is a short script that automatically switches on and off the motion blur when rendering the allmighty STRAT'S IR+LC camera animation method.
I wrote it cause I forgot so many times to switch it on or off when launching renders prepasses.

Here is how to set it up (only takes 1 or 2 min) :

first create a coffee tag on whatever object and copy paste this (between the stars) :
**************************************************
main(doc,op)
{
var LCMAP_PREPASS_NAME = "CAM_LCMAP"; // Replace here CAM_LCMAP by your default Light cache prepass name
var RD = doc->GetFirstRenderData();
do
{
if (RD->GetName()==LCMAP_PREPASS_NAME)
{
var LCMAP=RD;
if (LCMAP->GetBit(BIT_ARDATA)==1)
{
var tg = op->GetFirstTag();
while (tg)
{
if(tg->GetType()==1020898)
{
tg#VRAYPHYSICALCAMERATAG_MBLURON=TRUE;
break;
}
tg=tg->GetNext();
}
}
else
{
var tg = op->GetFirstTag();
while (tg)
{
if(tg->GetType()==1020898)
{
tg#VRAYPHYSICALCAMERATAG_MBLURON=FALSE;
break;
}
tg=tg->GetNext();
}
}
}
RD=RD->GetNext();
}
while(RD);

}
************************************************** *****


Now just replace at line 3 :

CAM_LCMAP by your default LC prepass rendersetting name (you probably have one, or if you don't, try to use this name for LC prepasses).

http://www.ov3rconcept.com/Ressources/LCSCRIPT.jpg

It's done, now simply save the C.O.F.F.E.E tag you just set up in your presets, and apply it to any physical camera to get it work !

When the render setting CAM_LCMAP (or the name you just gave) is activated, Mblur is activated too. As soon as another render setting is activated it is disabled.

May sound like a stupid idea, but I forgot it so many times... now I'm quiet until it is fixed !

M!ke

STRAT
11-26-2010, 08:18 AM
nice one!