The FXScript Reference

For Final Cut Pro created by Joe Maller

Clip

input varName, "UIName", Clip

Fps returns the current frame rate of the source clip. This value does not take interlacing into account, and always returns 30 for NTSC video and 25 for PAL video. Note that these are integer values even though the actual NTSC frame rate is 29.97.

Even though interlaced clips show an fps of 30, they're calculated at a frame rate of 60, since each field is treated as a frame. Dividing the field-corrected number of frames by fps will yield the length of a clip in seconds.

Additional Notes

Clip - imagewell problems

I found a problem with the clip input's imagewells. I wrote an effect that needs another clip as input. We applied the effects about 50 times on a timeline without issues.

But occasionally AFTER I APPLIED THE EFFECT FROM A "FAVOURITES" COPY the imagewells get mixed up between different copies of the same effect on the same timeline:

I'd drag an input clip into one effect's imagewell, and it would change the input source on another effect, and vice versa - like these two effects were accessing the same imagewell.

It does seem that this bug does not occur when the effect is applied from it's original place in the effects bin, and not from the favourites bin.

I went back to the fxscript code and made sure that all my buffers are initialised properly before use. Any other ideas how to prevent this?

Clip - relinking

After applying our effects with imagewells to a typical timeline's subtitles, we have to reconnect the subtitles (TGA files with alpha) to new versions. If you throw away the previous subtitles, FCP has to reconnect media to the new subtitles - that works.

Except for all the subtitles in imagewells. They all have to be re-inserted manually.

Is there any way that we can reconnect the clips in our effect's imagewell automatically - while FCP reconnects the media?

Getting size

If DimensionsOf only works for images and GetNativeSize only works for non-input clips then how do you get the dimensions of a clip dropped into an image well?

Getting size

OK it seems that you can't and the user would have to enter the dimensions of the image manually.