Mesh-table

From TrainzOnline
Revision as of 19:38, 25 March 2010 by windwalkr (Talk | contribs)

Jump to: navigation, search

This is the new and preferred method of asset mesh placement for most mesh asset types. It gives flexibility and control for mesh placement and animations.

As of TC 2, there are some asset types that cannot use a mesh-table. These include all Bridges, Tunnels, Rails, Pantographs and other Spline Objects (eg. Fences or Catenaries).

Contents

Example Mesh Table

mesh-table
{
  default
  {
    mesh industry.lm
    anim anim.kin
    animation-loop-speed 1.0
    auto-create 1
    effects
    {
      0
      {
        kind name
        fontsize 0.15
        fontcolor 30,30,30
        att a.name0
        name name
      }
      1
      {
        kind corona
        att a.coronawhite
        frequency 1
        directional 0
        texture-kuid <KUID:-3:10111>
      }
    }
  }
  default-night
  {
    mesh nightwindows/nightwindows.im
    night-mesh-base default
  }
  attachedanimation
  {
    mesh subdirectoryname/meshname.im
    anim subdirectoryname/animname.kin
    auto-create 1
    att a.pointname
    att-parent default
    animation-loop-speed 1.0
  }
}

default

Default is the ‘main’ mesh of the asset.

mesh

The ‘main’ mesh name. This may include a sub-path; ie: mesh nightwindows/nightwindows.im, where the file nightwindows.im has been placed in the subdirectory nightwindows.

Use .im files exported from 3dsmax (as opposed to .pm.) or reference an .lm file if you wish your asset to have ‘Level of Detail’ mesh reduction. A pantograph model still requires a .pm file.

Level of detail is a process of using different model meshes, depending on how far the viewer is from the model. A finer mesh is used for close up viewing in Trainz.

anim

The animation file (.kin) exported from 3dsmax. This may include a sub-path.

animation-loop-speed

This tag must be here if the asset is to animate when placed. If this tag is not here when placed the animation will not play by default, but may play if controlled by script. A different value (e.g. 0.5, 2.0) may be used in the tag to play the animation at a different speed from that created in 3dsmax.

auto-create 1

The model is generated automatically when placed, or when you load a map which includes the model. In some instances you don’t want the mesh visible (as this may be controlled through script). If auto-create is 0 the mesh will not be visible when placed.

default-night

‘Main’ night window mesh on scenery and industry and traincar assets. Modeled to the same 3d space as the default mesh and is inserted at the default mesh origin.

night-mesh-base default

This night mesh is linked to the default mesh and is visible only at night. It is invisible if the ‘default’ mesh is invisible, (if the auto-create 0 line were used so the default mesh can be controlled by script).

att

The mesh (and animation if present) is inserted at a mesh attachment point rather than the origin (without this line the mesh is placed relative to the origin of the parent model).

att-parent name

The tag tells Trainz in which mesh the attachment point is located. The insertion attachment point is located within the mesh ‘name’ , as listed in the config.txt.

Personal tools