-
FXScript frame variable
I’m delving into FXScript for the first time. I want a video generator that writes the current frame number on each frame. When I run this in FXBuilder, it works, with the number increasing. However, when I save the script as a plug-in, restart Final Cut, and put the generator on the timeline, the frame number stays at zero all the time (the duration is shown correctly). Why isn’t the frame number incremented?
Here’s the script:
float a, d, w, h, i;
point framesize, fbox[4];
string fnum, dur, lbl;resetText;
fontcolor.a = 255;dimensionsof(dest, framesize.x, framesize.y);
fontsize /= 320/framesize.x;setTextFont(fontname);
setTextSize(fontsize);
setTextjustify(kleftjustify);NumToString(frame,fnum,kInteger);
NumToString(duration,dur,kInteger);lbl = fnum + “/” + dur;
measurestringplain(lbl, w, h, a, d, aspectof(dest));
makerect(fbox, 0, 0, w, a);
drawstringplain(lbl, fbox, dest, fontcolor, aspectof(dest));