May 15, 2011

Display by frame

Little C.O.F.F.E.E script that allow to change objects every frame.

It's quite simple :
It compares the name of the group with the number of the frame and if it matches, the group is displayed.

Simply create a C.O.F.F.E.E tag with the following code on Nulls (groups) witch name are corresponding to the frame during witch they'll be activated (!?!)

****************************************

main(doc,op)
{
var dirframe = op->GetName();               //gets group name
var test = int(evaluate(dirframe));            //converts group name to int
var t = doc->GetTime();                           //get current frame
var frame = t->GetFrame(doc->GetFps()); //get current frame

if(test==frame){   //if group's name = frame number ---> group is active
        op#ID_BASEOBJECT_VISIBILITY_EDITOR=2;
        op#ID_BASEOBJECT_VISIBILITY_RENDER=2;
        }
else{                   //else group is disabled
        op#ID_BASEOBJECT_VISIBILITY_EDITOR=1;
        op#ID_BASEOBJECT_VISIBILITY_RENDER=1;
        }
}
**************************************


Check example file here ---> DISPLAY BY FRAME

Might be used or tweaked for other uses.

Mike

No comments:

Post a Comment