# NAME

anim_sort - combine concatenated animation scripts into one script

# SYNOPSIS

anim_sort [-ic] < mixed.script > ordered.script

# DESCRIPTION

Note: anim_sort has been superceded in BRL-CAD release 5.0 by scriptsort, which sorts scripts much faster.

Anim_sort allows the user to combine several animation scripts into a single script suitable for input to rt. A convenient way to prepare a complicated animation script is to develop each part separately and then use anim_sort to combine the various parts. For example, suppose that view.script is an animation script controlling the movement of the virtual camera and the lighting, mill.script rotates the blades of a windmill, and quixote.script controls the movement of a knight. These scripts should first be concatenated together:

cat view.script mill.script quixote.script > mixed.script

Calling anim_sort with mixed.script on standard input would reorder the commands in mixed.script to make a viable script on standard output.

Each of the input files to be concatenated is expected to be a viable rt animation script, containing a series of frames of the following form:

    start framenumber;
    any number of semi-colon terminated commands for rt;
    end;
    any number of post-raytracing commands

Anim_sort reads the framenumber of the first start command, and uses this to as the first frame number of the output file. The commands of all frames in mixed.script with that framenumber are combined in the output frame. The post-raytracing commands following all frames with that framenumber are placed after the end; command of the output frame. This process is continued for each successive integer, until anim_sort reaches a framenumber which is not included in any of the original scripts.

For example, if view.script contained frames numbered from 5 to 20, mill.script contained frames from 0 to 10, and quixote.script contained frames numbered from 15 to 25, the output script would start at frame 5 (since view.script comes first in mixed.script ) and end with frame 25 (since frames 5 through 25 can be found somewhere in mixed.script ). If the user wanted to include frames 0 through 4, which are found only in mill.script , then mill.script should be concatenated onto the beginning of mixed.script instead of the middle. In the majority of animation situations, all of the input scripts would have identical frame numbers anyway.

The first input script may also contain some lines preceding the first start command, which are copied to the beginning of the output script. This is useful for commands such as 'viewsize', which are often specified before the sequence of animations begins.

# OPTIONS

-i
  Incremental mode. The frames of the output script are printed in a scrambled order which incrementally increases the time resolution of the animation. For example, the frames of an eight-frame script would be computed in the order: 0 4 2 6 1 3 5 7.
-c
  For most animation purposes, it is desirable to have a clean command immediately following the start command of each frame. The default behavior of anim_sort is to include one clean command following the start command of each frame. clean commands from the input files are ignored. If the -c flag is activated, then no clean commands are printed.

# SEE ALSO

rt(1), tabsub(1), anim_script(1)

# AUTHOR

Carl J. Nuzman

# "BUG REPORTS"

Reports of bugs or problems should be submitted via electronic mail to <devs@brlcad.org>.