ratio
ratio
Additional Notes
With RT Unlimited enabled, ratio is returning half the value it should be returning. The value is correct when the clip is playing.
The problem most likely relates to frame reporting (mis-reporting?) first field values as 0.5.
The fix for this would then be to check frame for non-integer values and use a proxy value for frame and ratio (frame/duration) if any are found. The first frame will be reported as 0.5, so a stored value can be set on the first frame of every script.
Ratio and Frame are half-values when RT is enabled and the clip is either 100% or set to RT high. Duration is dynamically re-stated during RT playback, but frame and ratio are not, RT Unlimited High always uses half-frame values without correcting duration. Desktop preview always shows half-frame values without correcting duration.
My workaround stores frame -integer(frame) for the current and previous frames. These values are then checked and if either is not zero, I adjust the frame and ratio values like this:
RTFrame = frame * (fieldprocessing + 1);
RTRatio = RTFrame/duration;
The reason for that kludgy method is because stored values are not cleared when switching between RT and non-RT rendering, so RT values can break non-RT effects if they were previewed in RT first. Ugh.
In FXBuilder, Ratio will return 0 to 1, instead of 0 to almost 1.


Ratio returns a decimal value between 0 and 1 representing the current percent completion of the targeted effect. This value is usually used as the basis for transitions although it's available for all three types of FXScript effects. The value is equivalent to dividing the current frame into the total duration of frames. Ratio doesn't work when effects are applied to slugs or color mattes but does work on still images.
Ratio will never actually equal 1 although the last frame will be very, very close to 1. Because ratio is essentially frame/duration and frame counts from 0 while duration counts whole units (starting a 1) frame will always end slightly less than duration and ratio will never equal 1.