previous//next//start

Outfit Assembly Syntax

Structure

This is the overall structure of an outfit definition:

OUTFIT

      // the header part:  defines global outfit properties like NAME, gender restrictions etc.

      NAME "Sample Outfit"

     

      // list of subpart definitions. Each subpart defines one section/bone of a skeleton.
      // A subpart may also specify a mesh and its material

SubpartName:  DIM ...

              SRF ...

 

AnotherSubpartName:  ...etc.

 

END

 

Statements and Definitions

 

ADD

Used in subpart definitions.

This statement adds a colorizable "MMG" layer to the subpart. It accepts one string argument specifying the file name. If the texture file is stored at its default place in the <BW Tools Installation Folder>\ART\MMG folder, no path needs to be specified. Otherwise the full directory path must be given.

The MMG files are combinations of JPG files and colorizable area definition layers. A free tool for creating these files is available at http://www.moove.com/mpz/actors/mmg.zip

Example:

        // Define the size of the texture and fill it with black
        PAINT 512,512 "*none" rgb 0,0,0


        // Add a bump texture
        BUMP "shirt_bump.jpg"


        // Add the colorizable MMG layer
        ADD "shirt.mmg"

 

AXES

Used in subpart definitions.

This statement maps the geometrical (x,y,z) axes of a joint to the semantically defined axes flex, twist and pivot. The arguments are the axes names X Y Z, optionally prefixed with a minus sign.

Example:

    RightUprarm:
        AXES X -Y -Z

    LeftUprarm:
        AXES X Y Z
 

 

COLNAME...END

Used in the header part of the outfit definition.

Using this statement, the colorizable sections of an outfit can be named. The names will be displayed in the colorize dialog of the actor studio.

Example:

OUTFIT
    NAME "Shirt"
    MAXCOL 8
    COLNAME
        Chest
        Shoulder
        Collar
        Sleeve
        Side_Stripes
        Sleeve_2
        Chest_2
        Side_Stripes_2
    END

 

DIM

Used in subpart definitions.

Determines the bounding box dimensions of the subpart in centimeters. Legal values are three numbers for the x, y and z dimensions respectively.

Example:

RightForarm:
    DIM 9.24532 25.2309 9.70488

 

FROM

Used in subpart definitions.

The FROM statement specifies the parent of the subpart and the connection position of the joint in the parent bounding box. The first argument, a string, is the name of the parent subpart. The next three numbers define the distance of the attachment point of the joint in x,y and z directions in centimeters.

Example:

RightForarm:
    FROM RightUprarm -0.98 29.33 1.68

 

HEADPART

Used in subpart definitions.

Declares the subpart to be part of the head. This is useful hint for the system to correctly display hats, sunglasses and similar.

Example:

Frames:    DIM 16.4061 3.3148 14.2445
           ORIGIN 8.2036 -3.79402 1.72644
           FROM Head 0 0 0
           HEADPART

 

JOINT

Used in subpart definitions.

Use this statement to name the joint between this subpart and its parent. The argument is a string, which should be unique. Please study the assembly templates in <BW Tools Installation Folder>\Resources\AsmTemplates\Outfit for appropriate naming conventions.

Example:

RightShin: FROM RightThigh 0.5 38 1
           JOINT RightKnee
 

 

MAXCOL

Used in the header part of the outfit definition.

Determines the maximum number of colorizable areas for this outfit. The legal values are between 1 and 8.

OUTFIT
    NAME "Shirt"
    MAXCOL 8
 

 

NOCULL

Used in subpart definitions.

If defined, the mesh of the specified subpart will not be culled, i.e. the polygons will also be visible from the "wrong" side.

Example:

Glasses:   SRF "shades.3ds"
           NOCULL

 

NONBBOX

Used in subpart definitions.

Turns off the collision check for the subpart.

Example:

LongFlowingHair:    DIM 50 20 40
                    NONBBOX

 

ONLYFOR

Used in the header part of the outfit definition.

This statement assigns a gender sign to the final outfit icon. Legal arguments are MALE and FEMALE

Example:

OUTFIT
NAME "Miniskirt"
ONLYFOR FEMALE

 

ORIGIN

Used in subpart definitions.

Determines the pivot point of the subpart. The three arguments are numbers specifying the offset in centimeters from the lower left corner of the bounding box (i.e. minimum x, y and z coordinates) in x, y and z directions.

Example:

Abdomen:    DIM 29.00 13.20 22.50
            ORIGIN 14.50 0.00 10.50
 

 

PAINT

Used in subpart definitions.

This statement determines the material of the subpart. There are several variants of usage:

A material file, created with the material editor and stored in <BW Tools Installation Folder>\Resources\Materials folder, can be specified like this:

PAINT "ShinyRed.material"

or

PAINT "Misc\Fire.material"

Please observe that the immediate folder name containing the material must be supplied, but not the full path.

                    An untextured material can be created by specifying the diffuse RGB components:

PAINT DIFF 0.8 0.2 1

If the texture files are stored at their default places in the <BW Tools Installation Folder>\ART folder ( e.g. JPG files in <BW Tools Installation Folder>\ART\JPG etc. ), no path needs to be specified. Otherwise the full directory path must be given.

The system supports BMP, JPG, PNG, TGA and DDS file formats.

There are several possible combinations:

Simple texture mapping (diffuse map):

PAINT "SomeTexture.JPG"

Texture map with bump map texture. The bump map is a black/white height map:

PAINT "SomeTexture.JPG" BUMP "Scratches.TGA"

Texture map with bump map texture. The bump map is a normal map:

PAINT "SomeTexture.JPG" BUMP_NM "paper_nm.DDS"

Texture map with bump and gloss map textures:

PAINT "SomeTexture.JPG" BUMP "Scratches.TGA" GLOSS "Shiny.bmp"

Use the reserved texture name "*SKIN" to use the skin colors and textures as defined with the head editor. For example if the end user makes a head with a dark skin, the subparts with "*SKIN" will also get darker:

PAINT "*SKIN"

This is a special construct to create a background layer for colorizable parts with fixed dimensions. The ADD statement will add MMG layers to this background:

// Create a background layer with width = 512 and height = 256 pixels. Fill it with black color
PAINT 512, 256 "*none" RGB 0,0,0

 

RANGE

Used in subpart definitions.

The RANGE statement specifies recommended ranges for the joints. The system uses these values to display a green range in the posture editor and for certain internal calculations. The three number pairs are the lower and upper limits in degrees for flex, twist and pivot axes respectively.

Example:

LeftHand:    RANGE 240,120 270,180 240,120
 

 

REMOVER

Used in the header part of the outfit definition.

Sometimes it is useful to create outfits which will simply remove subparts from the actors rather than adding some. Use this statement to mark such outfits for the system.

Example:

OUTFIT
      NAME "Chest Remover"
      REMOVER


Chest: SRF NONE


END

 

SRF

Used in subpart definitions.

This statement determines the geometry of the subpart. There are three main variants of usage:

If the mesh files are stored at their default places in the <BW Tools Installation Folder>\ART folder ( e.g. 3DS files in <BW Tools Installation Folder>\ART\3DS etc.), no path needs to be specified. Otherwise the full directory path must be given.

The system supports X, SRX and 3DS file formats. A file must contain a single mesh without transformations.

Two special modifiers are available:

  • KEEPDIM: This is a flag to instruct the assembly compiler to use the original dimensions of a mesh file. If this flag is not specified, the system will fit the mesh into a box with standard dimensions (100 cm x 100 cm x 100 cm ).
  • KEEPNORMAL: This is a flag to instruct the assembly compiler to use the original vertex normals of a mesh file. If this flag is not specified, the system will automatically recreate the normals.

Example:

SRF "SomeMesh.3DS" KEEPDIM

 

Virtual subparts are without geometry. They are just part of the skeleton (bones) and influence meshes contained in other subparts. This is the syntax for declaring virtual subparts:

SRF NONE

 

These are meshes created algorithmically by the system. These objects are always fitted into a box with standard dimensions (100 cm x 100 cm x 100 cm ).

Creates a cube

Example:

SRF "*BOX"

 

Creates a cylinder

Example:

SRF "*CYLINDER"

 

Creates four quadrilaterals arranged as a frame

Example:

SRF "*FRAME"

 

Creates a generalized cylinder, i.e. a 3D line with thickness. The first argument is the number of the total points and must be >= 2. Then the list of point x, y and z coordinates follow. The next argument is the radius, defining the thickness. Axial tile size determine the tiling steps along the cylinder. Smoothing flag can be 0 or 1. The final value is a quality parameter between 0 and 100.

Example:

SRF "*GENCYL(3, 0,0,0 ,0,50,0, 50,70,0, 10, 30, 0, 75)"

 

Creates a quadrilateral

Example:

SRF "*QUAD"

 

Creates a sphere

Example:

SRF "*SPHERE"

 

Creates a 3D text object.

The first argument is the text itself. The additional arguments can be used to modify the font.

Example:

SRF "*TEXT(Hello World,Times New Roman,16)"

 

TO

Used in subpart definitions.

The TO statement allows to offset the connection point on the subpart side relative to the origin. This is usually 0 0 0, i.e. the joint ends exactly at the origin of the subpart.

Example:

LeftToes:
            FROM LeftFoot 0 7.4 -13.7
            TO 0 0 0
            JOINT LeftToes

 

WRAPS

Used in subpart definitions.

The WRAPS statement declares the list of subparts influencing this surface (also called the "bones"). In order to react to the wrapped subparts (bones), the mesh file must vertex "weight" information. For this purpose, BW Tools supports Microsoft .X files containing bones and influence values, i.e. weights. The recommended way is to create the meshes in 3D Studio Max® and use the subpart names as bone names. The mesh needs to be exported in .X format using one of the several available exporter plug-ins. For your convenience, we have included a sample 3D Studio Max® file with a corresponding assembly file ( <BW Tool installation folder>\ART\3DS\MAX\female jeans.max  and .asm ).

Example:

_ChestSkin:  SRF male_chest_for_cljacket.x
             WRAPS (chest,neck,RightJoint,LeftJoint,head)

previous//next//start


Would you like to provide us with your comments on this topic?