//- // ========================================================================== // Copyright (C) 1995 - 2005 Alias Systems Corp. and/or its licensors. All // rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files are provided by Alias // Systems Corp. ("Alias") and/or its licensors for the exclusive use of the // Customer (as defined in the Alias Software License Agreement that // accompanies this Alias software). Such Customer has the right to use, // modify, and incorporate the Data into other products and to distribute such // products for use by end-users. // // THE DATA IS PROVIDED "AS IS". ALIAS HEREBY DISCLAIMS ALL WARRANTIES // RELATING TO THE DATA, INCLUDING, WITHOUT LIMITATION, ANY AND ALL EXPRESS OR // IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. IN NO EVENT SHALL ALIAS BE LIABLE FOR ANY DAMAGES // WHATSOEVER, WHETHER DIRECT, INDIRECT, SPECIAL, OR PUNITIVE, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, OR IN EQUITY, // ARISING OUT OF ACCESS TO, USE OF, OR RELIANCE UPON THE DATA. // ========================================================================== //+ #include int main (int argc, char *argv[]) { EtChannel *channelList; EtChannel *channel; EtInt numCurves; EtInt i; EtKey * key; EtTime time; /* make sure we have been given the name of a .anim file */ if (argc < 2) { fprintf (stderr, "##### Usage: %s .anim file\n", argv[0]); exit (-1); } /* read in the list of channels */ channelList = engineAnimReadCurves (argv[1], &numCurves); if (channelList == kEngineNULL) { fprintf (stderr, "##### Unable to parse %s\n", argv[1]); exit (-1); } /* print the list of keys for each chanel */ channel = channelList; while (channel != kEngineNULL) { if (channel->curve != kEngineNULL) { printf ("%s {\n", channel->channel); /* channel name */ for (i = 0; i < channel->curve->numKeys; i++) { key = &(channel->curve->keyList[i]); printf (" %g %g %g %g %g %g\n", key->time, key->value, key->inTanX, key->inTanY, key->outTanX, key->outTanY ); } printf ("}\n"); } channel = channel->next; } /* evaluate the channels for 180 frames */ for (time = 0; time <= 180.0; time++) { channel = channelList; while (channel != kEngineNULL) { if (channel->curve != kEngineNULL) { /* Note: evaluation is in seconds (hence the / 24.0) */ printf ("%s %g %g\n", channel->channel, time / 24.0, engineAnimEvaluate (channel->curve, time / 24.0) ); } channel = channel->next; } } /* free up the channel list */ engineAnimFreeChannelList (channelList); return (0); }