Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Apple Final Cut Pro Legacy Q:How to create RT fx & Drop Shadow in FXScript?

  • Q:How to create RT fx & Drop Shadow in FXScript?

    Posted by Lars Fuchs on October 4, 2009 at 11:55 pm

    Hello all,

    I’ve created a simple script that adds a text label to a shot. Its based on the ‘Viewfinder’ filter. It works fine, but it won’t play back unrendered, while the ‘Viewfinder’ plays back fine unrendered. Does any one know what I should do so that my FXScript filter will playback in real time? I’ve pasted the code below. I’d also be grateful if anyone of you FCP gurus out there could tell me how to add a dropshadow option.

    Thanks in advance!

    Here’s the code:

    scriptid "Shotnumber" //DO NOT LOCALIZE
    filter "Shot Number G"; //Based on "Viewfinder" Filter
    group "Video";
    fullFrame;

    input str, "Shot #", text, "S010";
    input fontname, "Font", FontList, "Arial";
    input fontsize, "Size", slider, 40, 8, 1000 ramp 80 detent 20;
    input scolor, "Color", color, 255, 255, 0, 0;
    input origin, "Location", point, -0.32, 0.28;

    InvalEntireItem
    RenderEachFrameWhenStill

    code
    float w, h, a, d, aspect;
    point framesize, originpt, poly[4];
    string snumstr;

    dest = src1;
    resetText;
    scolor.a = 255;

    dimensionsof(dest, framesize.x, framesize.y);

    fontsize *= framesize.h/640;
    setTextFont(fontname);
    setTextSize(fontsize);
    setTextStyle(kplain);
    setTextJustify(kleftjustify);

    boundsof(dest, poly);

    originpt = framesize;
    originpt *= origin;

    aspect = aspectof(dest)

    measurestringplain(str, w, h, a, d, aspect);
    makerect(poly, originpt.x, originpt.y, w, a+d);
    drawstringplain(str, poly, dest, scolor, aspect);

    Lars Fuchs replied 16 years, 8 months ago 1 Member · 1 Reply
  • 1 Reply
  • Lars Fuchs

    October 5, 2009 at 1:29 am

    Follow-up: on page 7 of the Using FxScript pdf, I found this

    Tip:
    It’s possible to create filters of your own that work in real time. You must make sure that the Realtime According To Budget option in the Real-Time Effects (RT) pop-up menu in the Timeline is not selected. This allows your own FXScript filters, transitions, and generators
    to run in real time.

    So setting my RT options to “Unlimited” (obviously the FXScript pdf I’m reading is a bit out of date!) gave me an orange render bar rather than red. Joy! Now, just need to figure out the DropShadow. Can anyone help there?

    Thanks

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