The FXScript Reference

For Final Cut Pro created by Joe Maller

FXScript Bugs

Use this page to comment on FXScript Bugs that don't fit into other sections, or link to items which have bug reports in their comments.

Additional Notes

Precision issues

I noticed a frustrating inequality with floating point numbers. FXScript reports the following as false:

30 * (1000/1001) == 30 * 1000/1001

It should be true. FXScript's results, reported with kfloat6 show the following.

30 * (1000/1001) = 29.970032;
30 * 1000/1001  =  29.970030;


This might just have something to do with inhererent floating point precision in the OS or on the Mac processors.

MySQL seems to be able to handle this, holding the results as equal to at least 20 decimal places.

select 30 * (1000/1001) = 30 * 1000/1001;
+-----------------------------------+
| 30 * (1000/1001) = 30 * 1000/1001 |
+-----------------------------------+
|                                 1 |
+-----------------------------------+


It's something to watch out for and to consider when relying on equalities and comparisons which arrive at a result by different means.

GetLimits and Transitions

GetLimits returns a useless offset for clip1 of transitions.

The outgoing clip offset matches the first visible frame of that instance of the clip, which in almost all cases occurs before the transition starts. This would be fine if there was a way to determine the first-frame offset of the transition itself. Because this isn't possible, the actual offset of the current frame in clip1 is unknown and apparently unknowable.

This behavior is also reflected by getTimeCode and GetTimecodeStringFromClip.

Fade in and Fade out in one plugin?

Joe,
Is there a way to make a fade in/fade out effect for applying to a clip? There is a similar way in Avid (sorry for the bad word) that you can add a lower third graphic, and then with a single click add the fade in at the beginning and a fade out at the end, all at one time. The duration of each fade is independent so I can fade in at 20 frames and out at 30, for example. It works on any clip, but I used it mostly for titles. It was a major timesaver.
Is this possible in FXScript?

bob

FXScript Error: Divide by Zero.

I recently tried printing to video and this message appeared: "FXScript Error: Divide by Zero." What does it mean and what is the easiest way of overcoming this error? Thanks.

New extension for plugin files..?

there seems to be a new ".fcfcc" file extension for fxscript filters, so older filters will not neccesarily load into fcp5+ (some do, some don't). Wot a PITA having to resave all my plugins as .fcfcc files.

Aslo the "save as plugin dialogue" is buggful: it often appends weird garbage to the end of the file name.

BTW Tomas, that error means exactly what it says: somewhere in your script you're telling the computer to divide something by zero. Look at anywhere in your script where you use division and see if the denominator (or is it numerator..? -the bit below the line in the fraction anyway) could have the value zero.
-stephen

fxscript error: Unknown error

I recently finished a 90 minute project. and I upgraded from FCPHD to FCP5.03, today I needed to make a few minor changes to my file and loaded the project for the first time in FCP5, after it opened every few minutes I get a "fxscript error: Unknown error" on the screen and it refuses to render. the poject contains 40 scenes and ever other scene has about 10 seconds worth of these errors. I try'd going back to the nested sequences and they are corrupted also. If I have to go back and recapture all of the files it will literally take me 2 weeks working 8 hours a day to get back to the place I was before I upgraded. Does anyone have any suggestions?