Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Apple Final Cut Pro Legacy FXScript frame variable

  • FXScript frame variable

    Posted by Bob Wyttenbach on December 8, 2010 at 8:15 pm

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

    Bob Wyttenbach replied 15 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Matt Lyon

    December 9, 2010 at 6:26 pm

    Hey Bob, I’m a little too rusty to help you with your specific code, but…

    Have you tried inspecting the source code of the built in timecode generator/timecode reader effects to see how they go about accomplishing this?

    Matt Lyon
    Editor
    Toronto

  • Bob Wyttenbach

    December 9, 2010 at 11:31 pm

    It took me a while to find and edit the built-in timecode generator, but that helped. I think the key was adding RenderEachFrameWhenStill before the code section.

    Bob

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy