TF

REC2CHAN: Alias REC motion file to Houdini channel file.

(1998R1 channel tool documentaiton.)


Main Page

Document index

BCHAN importing
REC2CHAN -o outfile.bchan file1.rec file2.rec ...

REC2CHAN converts one or more Alias motion files (REC) into a single Houdini binary channel file for importing into SOP channels or reading as a file source in the CHOPs tool.

Example commands:
% rec2chan -o mouth.bchan jawls.rec jawos.rec jawrs.rec lipps.rec llpds.rec llpus.rec

% rec2chan eyebl.rec eyebr.rec -o eyes.bchan

The -o option may be used anywhere in the command line to specify the output. One output must be specified and the rest of the arguments are assumed to be inputs. The output file will be the length of the longest input track, and all the other tracks will be padded with zeros if they are shorter.

For more information on using .bchan files with Houdini, see the tutorial, Importing into Houdini.

REC2CHAN catches and reports the following fatal errors:

  • Command line contains an unknown option
  • a REC file is not parsable.
  • No tracks were found in the input files.
  • A memory allocation failed.
  • A file operation failed.


Engineering notes:
There are three components to the program: the REC file parser, the BCHAN header writer, and the main program file which accumulates tracks, and then outputs them all into the destination file.

ep_rec.c
This file contains a two-pass file parser for REC motion files. After opening the file parse_recfile() calls check_rec() to determine how many samples it contains. It then allocates an array of floats, rewinds the file and calls rule_rec() to load the track information.

er_bchan.c
This file contains the single routine bcwrite_header() for formatting and writing out the Houdini 64 byte BCHAN header. The first four bytes of the header are set to "chan", and the third long word contains the number of channels and the channel length. The rest of the header is set to zero.

main.c
This file contains the program's main() and the functions: newht() and writebch(). Input files are parsed, and then added to the track list with newht(). When the command line has been completely scanned, writebch() is called to write the track list to the output file. This function first scans through the list of channels and determines the longest one, then writes the BCHAN header, and then starts stepping through time & the channels, writing out values or zeros when a particular channel has run out of entries before the end of the file.


Archives:

FTP: REC2CHAN Executable (gzip'd).
FTP: REC2CHAN Source files (tar'd & gzip'd).


©1998 Twin Forces, Inc. All rights abandoned.
Comments to woolstar@twinforces.com.
ÿ