bw logo

Chapter 22. .model

Defined in various sub-folders under the resource tree <res> (for example, <res>/environments, <res>/flora, <res>/sets/vehicles, etc...), the .model file format specification is illustrated below:

<root>

  ?<parent>           file.model   </parent>
  ?<extent>           float        </extent>
  [<nodefullVisual>   file.visual  </nodefullVisual>
  |<nodelessVisual>   file.visual  </nodelessVisual>
  |<billboardVisual>  file         </billboardVisual>
  ]

   <! if nodeless or nodefull !>
  ?<batched>  false </batched>

   <! if billboard !>
  [<source>
    +<model>   file.model  </model>
    ?<width>   float       </width>
    ?<height>  float       </height>
    *<dye>
       <matter>        string                   </matter>
       <tint>          string                   </tint>
      *<property_name> float float float float  </property_name>
     </dye>
   </source>
  |
   <boundingBox>
    ?<min>  float float float  </min>
    ?<max>  float float float  </max>
   </boundingBox>
  ]

  ?<material>
     EffectMaterial 1
   </material>

  <! endif !>

  *<animation>

     <! if nodefullVisual !>
    ?<name>          string      </name>
     <nodes>         string      </nodes>
    ?<firstFrame>    integer     </firstFrame>
    ?<lastFrame>     integer     </lastFrame>
    ?<alpha>
       *<nodeName>  float        </nodeName>
     </alpha>
    ?<cognate>       string      </cognate>

     <! if nodelessVisual !>
     <name>          string      </name>
    +<visual>        file.visual </visual>

     <! if billboardVisual !>
     <name>          string      </name>
     <frameCount>    integer     </frameCount>

     <! endif !>

    ?<frameRate>     float       </frameRate>

   </animation>

  *<action>

     <name>           string       </name>
    ?<animation>      string       </animation>
    ?<blendInTime>    float        </blendInTime>
    ?<blendOutTime>   float        </blendOutTime>
    ?<filler>        [true|false]  </filler>
    ?<blended>       [true|false]  </blended> 
    ?<track>          integer      </track>
    ?<isMovement>    [true|false]  </isMovement>
    ?<isCoordinated> [true|false]  </isCoordinated>
    ?<isImpacting>   [true|false]  </isImpacting>

    ?<match>

      ?<trigger>
        ?<minEntitySpeed>    float         </minEntitySpeed>
        ?<maxEntitySpeed>    float         </maxEntitySpeed>
        ?<minEntityAux1>     float         </minEntityAux1>
        ?<maxEntityAux1>     float         </maxEntityAux1>
        ?<minModelYaw>       float         </minModelYaw>
        ?<maxModelYaw>       float         </maxModelYaw>
        ?<capsOn>            list_of_ints  </capsOn>  
        ?<capsOff>           list_of_ints  </capsOff> 
       </trigger>

      ?<cancel>
        ?<minEntitySpeed>    float         </minEntitySpeed>
        ?<maxEntitySpeed>    float         </maxEntitySpeed>
        ?<minEntityAux1>     float         </minEntityAux1>
        ?<maxEntityAux1>     float         </maxEntityAux1>
        ?<minModelYaw>       float         </minModelYaw>
        ?<maxModelYaw>       float         </maxModelYaw>
        ?<capsOn>            list_of_ints  </capsOn>  
        ?<capsOff>           list_of_ints  </capsOff> 
       </cancel>

      ?<scalePlaybackSpeed>  [true|false]   </scalePlaybackSpeed>
      ?<feetFollowDirection> [true|false]   </feetFollowDirection>
      ?<oneShot>             [true|false]   </oneShot>
      ?<promoteMotion>       [true|false]   </promoteMotion>

     </match>

   </action>

  *<dye>
     <matter>    string  </matter>
     <replaces>  string  </replaces>

    *<tint>
       <name>    string  </name>
       <! if nodefullVisual or nodelessVisual !>
       <material>
         EffectMaterial 2
       </material>
      *<property>
         <name>     string                  </name>
        ?<controls> integer                 </controls>
        ?<mask>     integer                 </mask>
        ?<future>   integer                 </future>
        ?<default>  float float float float </default>
       </property>
       <! if billboardVisual !>
      *<dye>
         <matter>   string  </matter>
         <tint>     string  </tint>
        *PropertiesList
       </dye>
     </tint>
   </dye>

</root>

Grammar of model file

1

For details, see EffectMaterial section.

2

For details, see EffectMaterial section.

The list below describes the tags in the model file:

  • action1

    Tag for action section.

  • alpha (section animation) — If nodefullVisual

    Tag for animation layer data.

  • animation (section action)

    Name of animation played by action.

  • batched — If nodefullVisual or nodelessVisual

    Indicates that the model allows batch rendering. This can improve performance if there are several instances of a model appearing in the game.

  • billboardVisual

    Name of the texture file for the billboard.

  • blended (section action)

    Deprecated. Tag <track> should be used instead.

  • blendInTime (section action)

    Time to blend in the animation.

  • blendOutTime (section action)

    Time to blend out the animation.

  • boundingBox — If billboardVisual

    Minimum and maximum XYZ coordinates of the model's bounding box.

  • cancel1 (section action/match)

    Group of conditions that must be met before Action Matcher cancels the action.

  • capsOff1

    • Section action/match/cancel

      User-defined flags that cannot be matched to cancel the action.

    • Section action/match/trigger

      User-defined flags that cannot be matched to trigger the action.

    Group of conditions that must be met before Action Matcher cancels the action.

  • capsOn1

    • Section action/match/cancel

      User-defined flags that must be matched to cancel the action.

    • Section action/match/trigger

      User-defined flags that must be matched to trigger the action.

    Group of conditions that must be met before Action Matcher cancels the action.

  • cognate (section animation) — If nodefullVisual

    Name of this animation's cognate animation.

    Cognate animations are used when models need to coordinate their movements.

  • dye (section source) — If billboardVisual

    Dye to use for generating the billboard source model.

  • EffectMaterial (section material) — If billboardVisual

    For details, see EffectMaterial section.

  • extent

    Maximum distance from camera in which model will still be drawn.

  • feetFollowDirection12 (section action/match)

    Setting this flag to TRUE means that when the action is played the model should be turned so that the direction of motion of its entity should be matched up with the direction of motion of the action.

  • filler (section action)

    If set to TRUE, the animation is repeated automatically. Also known as 'loop'

  • firstFrame (section animation) — If nodefullVisual

    First frame to be played.

  • frameCount (section animation) — If billboardVisual

    Number of frames in billboard's animation.

  • frameRate (section animation)

    Preferred playback frame rate of animation.

  • height (section source) — If billboardVisual

    Height of billboard-type model.

  • isCoordinated12 (section action)

    TRUE if the animation is part of a sequence that is to be coordinated with a corresponding action on another model, and this animation does not start at the origin.

  • isImpacting12 (section action)

    TRUE if the movement in the root node of the animation should be promoted to impact on the model. Additionally, if isImpacting is true, and the model is owned by a client-controlled Entity (such as the player), then the translation part of the action will be promoted to impact the entity's position.

  • isMovement12 (section action)

    TRUE if the animation contains built-in movement, such as a walk or run cycle.

    The change in transform of the root node from the beginning to end is recorded, then proportionally subtracted from each frame. This means that if you turn this flag on, then a run animation that does not run on the spot will appear to.

    This option allows you to also use the scalePlaybackSpeed option.

  • lastFrame2 (section animation)

    Last frame to be played.

  • match1 (section action)

    Group of tags specifying when Action Matcher should trigger or cancel an action.

  • material — If billboardVisual

    Tag for material section of model. Contains settings for shader, collision flags, map files, etc...

  • matter — If billboardVisual

    Name of model's matter.

  • max (section boundingBox)

    Maximum extents of model's bounding box

  • maxEntityAux11 (sections action/match/cancel and action/match/trigger)

    Maximum value of some arbitrary attribute that entity must have for the action to be cancelled or triggered.

  • maxEntitySpeed1 (section action/match/cancel and action/match/trigger)

    Maximum matching speed to cancel or trigger the action.

  • maxEntityYaw1 (section action/match/cancel and action/match/trigger)

    Maximum yaw of the model in relation to the entity for the action to be cancelled or triggered.

  • min (section boundingBox)

    Minimum extents of model's bounding box

  • minEntityAux11 (section action/match/cancel and action/match/trigger)

    Minimum value of some arbitrary attribute that entity must have for the action to be cancelled or triggered.

  • minEntitySpeed1 (section action/match/cancel and action/match/trigger)

    Minimum matching speed to cancel or trigger the action.

  • minEntityYaw1 (section action/match/cancel and action/match/trigger)

    Minimum yaw of the model in relation to the entity for the action to be cancelled or triggered.

  • model (section source) — If billboardVisual

    The billboard's source model.

  • name

    • Section animation

      Name of animation file containing animation data.

    • Section action1

      Name of action.

  • nodefullVisual

    Name of the visual file containing the model's geometry.

  • nodelessVisual

    Name of the visual file containing the model's geometry.

  • nodeName1 (section animation/alpha)

    Name of node, defining section with node's blend alpha information.

  • nodes (section animation) — If nodefullVisual

    Name of animation file containing raw keyframe data.

  • oneShot12 (section action/match)

    Setting this to TRUE means that the Action Matcher will not continue playing that action past one cycle of it, if it is no longer triggered, but a <cancel> section was keeping it active.

  • parent

    Name of parent model file, from which it inherits actions and animations.

  • promoteMotion12 (section action/match)

    This means that the motion in the action is promoted to apply to the model on which it is played. Note that this option must be turned on for isImpacting or isMovement actions to work correctly. Also, please note that this option will do nothing unless the action isImpacting or isMovement. Please see the comments in isImpacting or isMovement for more information about motion promotion.

  • property_name (section source/dye) — If billboardVisual

    Generic dye property.

  • scalePlaybackSpeed12 (section action/match)

    Setting this flag to TRUE causes the speed of the animation to be scaled by the straight-line speed of the entity.

  • source — If billboardVisual

    Tag for source section. This section specified the source file, dimensions, dye, and bounding box for the billboard-type model.

  • tint (section source/dye) — If billboardVisual

    Name of model's tint for generating the billboard.

  • track12 (section action)

    The track the action plays on. Actions playing on the same track interrupt each other. There can only be one action playing at a time on each track (unless it is an old action blending out). 

  • trigger1 (section action/match)

    Group of conditions that must be met before Action Matcher triggers the action.

  • umbraOccluder

    TRUE if the model is used as an umbra occluder, this only has an effect when Umbra is running in software mode.

  • visual (section animation) — If nodelessVisual

    Alternate visual used by this animation

  • width (section source) — If billboardVisual

    Width of billboard-type model.