Converts an SMPTE timecode string into a frame number, taking into account the SMPTE_Offset value of the active clip.
The SMPTE_Offset value of the active clip specifies the timecode start for the data on the clip. It is there so that frame 1 of your data corresponds to the starting timecode of your take. Without it, your frame numbers would end up large and cumbersome.
If you want to ignore the SMPTE_Offset in the computation, specify the
-ignoreOffset flag. You may wish to do this when computing a SMPTE_Offset of your own, for instance. In that situation, you wouldn't want the existing offset value in the computation.
The frames (FF) portion of the timecode string should go from 0 to 24, 25, or 30 depending on the current timecode standard (Film, PAL, and NTSC respectively). As your scene rate may be at a frame rate that is a higher multiple of those standard rates (e.g. 120 fps for NTSC), the sub-frame portion indicates the "in between frame" of the frame passed in.
|string||yes||The timecode value to convert to a frame number.|
|Name||Flag arguments||Argument type||Exclusive to||Comments|
|0||—||—||By default, the active clip's SMPTE_Offset value is removed from the timecode argument to produce a final frame value. This flag causes the offset to be ignored causing a straight timecode-to-frames conversion.|
// Set the timecode offset of the active clip
setProperty "SMPTE_Offset" "01:23:45:12(2)" -onMod "TheActiveClip";
// Now convert a the value at exactly the one hour mark into a frame
int $frameNumber = `smpteToFrame "01:00:00:00(0)"`;