home *** CD-ROM | disk | FTP | other *** search
- /*
- * $VER: FieldRender.ifx 2.5 (11.04.96)
- * Copyright © 1992-1996 Nova Design, Inc.
- * Written by Thomas Krehbiel
- *
- * Convert a series of frames into "field rendered" frames. This can be used
- * in a sequence with other scripts, but should be done as the last step before
- * rendering and/or saving. For example:
- *
- * Load.ifx
- * <a bunch of effects>
- * FieldRender.ifx
- * Render_Amiga.ifx
- * SaveRenderedAs_ANIM.ifx
- *
- * This script is generally only useful when the output frames are destined
- * for video tape. (Ie. the "field rendering" technique is expressly for the
- * purpose of smoothing out video playback at 30fps.)
- *
- * NOTE: Due to current limitations of AutoFX, a field at the beginning of the
- * animation and a field at the end of the animation are lost.
- *
- * Inputs:
- * Word(Arg(1),1) = Frame number (1 - N)
- * Word(Arg(1),2) = Main filename ("-" if not specified)
- * Word(Arg(1),3) = Swap filename ("-" if not specified)
- * Word(Arg(1),4) = Sequence number
- * Word(Arg(1),5) = Total number of frames (N)
- * Word(Arg(1),6) = Alpha filename ("-" if not specified) [2.1]
- *
- * Returns:
- * 0 if successful, non-zero on failure
- *
- */
-
- /*
- * What we want to do is combine frames like this:
- *
- * # Even Odd
- *
- * 2 A field 1 + B field 0
- * 3 B field 1 + C field 0
- * 4 C field 1 + D field 0
- * 1 D field 1 + A field 0
- *
- */
-
- /*
- *
- */
-
- OPTIONS RESULTS
-
- filename = WORD(ARG(1),2)
- framenum = WORD(ARG(1),1)
- framemax = WORD(ARG(1),5)
-
- fieldreverse = 0 /* change to 1 to reverse the fields */
-
- Hook DeInterlace /* break current frame into two fields; field 1
- is now in swap buffer, field 0 in main */
-
- IF fieldreverse THEN Swap
-
- IF framenum = 1 THEN DO
-
- RenameBuffer '"FirstEvenField"'
- Buffer2Back
- Swap
- RenameBuffer '"PreviousOddField"'
- Buffer2Back
-
- END
-
- ELSE DO
-
- RenameBuffer '"CurrentEvenField"'
- Buffer2Back
- Swap
- RenameBuffer '"CurrentOddField"'
- Buffer2Back
-
- SelectBuffer '"PreviousOddField"'
- Swap
- SelectBuffer '"CurrentEvenField"'
-
- Hook Interlace /* this replaces CurrentEvenField */
- RenameBuffer '"CurrentFrame"'
-
- SelectBuffer '"PreviousOddField"'
- KillBuffer Force /* delete old PreviousOddField */
-
- SelectBuffer '"CurrentOddField"'
- RenameBuffer '"PreviousOddField"'
-
- SelectBuffer '"CurrentFrame"'
-
- END
-
- EXIT 0
-