How to add your knowledge

Maya IFF

    Platforms

    Windows

    Alias for Windows can read Maya IFF files and save them as TIFF or Alias pix files.

    Description

    • The basic element of an IFF file is a block, sometimes called a chunk.
    • Each block has an identifier called a tag or ID and a block length to allow it to be skipped (in some cases the block length is missing and the end of the block is indicated by a special marker).
    • Several grouping block types allow the file to be structured as a hierarchy.

    How to Read Maya IFF files in Alias

    The Maya IFF file format is not recognized inside file lister as a usable format. You can use the commands file->show->pix or try to use an IFF file as a texture. Maya IFF files can be brought in as images planes for Cameras.

    To use IFF files as a texture you must enter the absolute path for the texture and not use the browse button to open file lister.

    Basic file structure

    The structure is based on the use of tags to identify blocks of data called chunks or structures of chunks called groups. Each tag is made up of four characters and is immediately followed by the size of the chunk or group that it describes coded on 4 bytes. Tags are handled as pseudo-character strings and all other data is written in big-endian format.

    Block type tags

    The main tag types are FORM, CAT, LIST and PROP.

    They come in several flavors, such as FOR4, FOR8, CAT4 and CAT8 to specify 4-byte or 8-byte alignment boundaries.

    • FORM defines a structure that is similar to a C struct, that is, an ordered set of structured data.
    • CAT defines a concatenation of independent objects with no order relation between them.
    • LIST is used to group objects with similar properties, avoiding redundancy as the common properties can be defined before the list in a PROP block. A List has an extra tag value to indicate what it is a list of.
    • PROP further defines the properties of objects.

    Groups

    Four tags are used to arrange blocks into groups: FORM, CAT, LIST, 
    and PROP. The first four characters following the size are used to 
    identify the type of the group. 
    

    The FORM defines a structure that is like a C struct.

      FORM 38 TEXT           
    										CHAR 6 "Times"           
    										CHAR 12 "Hello World"   
    		EOF
    

    is like

      struct Text t = {
               char *f = "Times";
               char *c = "Hello World";
      };
    

    The size of the group (38) equals the size of the data it contains (6 plus 12) plus the size of the headers (4 for TEXT, 8 for CHAR 6 and 8 for CHAR 12). In this case, the result is 6+12+4+8+8 = 38.

    As in C structures you can nest groups; for example:

      FORM 52 TEXT
               FORM 8 FONT
                       CHAR 6 "Times"
                       LONG 4 <12>
                       LONG 4 <0>
               CHAR 12 "Hello World"
       EOF
    

    or in C terms:

      struct Text t = {
               struct Font f = {
                       char *n = "Times";
                       int s = 12;
                       int d = 0;
               };
               char *string = "Hello World";
       };
    

    This example may not show that blocks are not constrained to use a unique data type and may contain the equivalent of a complete C structure.

    The FORM tag separates independent blocks of data that can be handled separately and specifies the meaning of each subunit.

    In the example above, the CHAR chunk in the FONT FORM does not mean the same thing as the CHAR chunk in the TEXT FORM. The FORM tag determines how you interpret an ordered set of data types.

    The CAT tag defines a concatenation of independent objects with no order relation between them. Two typical uses of CATs are for libraries of objects (pictures in Example 1) or clipboards (Example 2).

    Example 1:

      CAT 3632 PICT
               FORM 1234 PICT ...
               FORM 2378 PICT ...
      EOF
    

    Example 2:

    CAT 2130 CLIP
               FORM 1234 PICT ...
               FORM 876  DRAW ...
       EOF
    

    Searching through a structured file is generally greatly accelerated, even in a CAT that has no order amongst its members, through the knowledge of the size of every group or chunk specified in the header.

    The LIST tag is used to group objects with similar properties, avoiding redundancy. For example, a sequence of equal-sized images might be represented in the following way. One image would have a structure like:

      FORM .... PICT
               IHDR 32 (image size info)
               BODY ... (image data)
       EOF
    

    then a sequence of like sized images could be done as follows, sharing the common header information:

      LIST ... ANIM
               PROP 44 PICT
                       IHDR 32 (common size info)
               FORM ... PICT
                       BODY .... (data)
               FORM ... PICT
                       BODY .... (data)
               FORM ... PICT
                       BODY .... (data)
       EOF
    

    The information in a PROP construct is valid until the end of the LIST. It can be redefined locally in a FORM stastement. (In the above example the common IHDR is valid in all PICTs that don’t include an IHDR block of their own.)

    Alignment

    IFF blocks align to 2-byte boundaries. The size specified in the header does not take padding into account. Many computers typically align their memory on 4-byte or 8-byte boundaries. Flib uses eight extra TAGs to let you specify alignment information:

    • Thes four are used to align to 4-byte boundaries: FOR4, CAT4, LIS4 and PRO4.
    • These four are used to align to 8-byte boundaries: FOR8, CAT8, LIS8 and PRO8.