"mesh-table" container

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
m (Added mesh-scale, as found in CCP 3.7. Please add details)
(attempt clarification)
Line 1: Line 1:
 +
{{ORP-top}}
 +
==KIND Heirarchy==
 
The "mesh-table" container is a top-level [[config.txt file]] entry used by various [[Content_Configuration#Content_Types|Content Types]].
 
The "mesh-table" container is a top-level [[config.txt file]] entry used by various [[Content_Configuration#Content_Types|Content Types]].
  
  
The mesh-table is a list of mesh subcontainers with no standalone tags. Each mesh subcontainer uses the following format. Tags are parsed in a standardised format, but not all [[Content_Configuration#Content_Types|Content Types]] support the full range of tags. Each mesh derives its name from the subcontainer's tag name. These names are used to refer to specific meshes from within the mesh-table and also from script.
+
# The mesh-table is a list of mesh subcontainers with no standalone tags.
 +
# Each mesh subcontainer uses the following format.  
 +
# Tags are parsed in a standardised format, but not all [[Content_Configuration#Content_Types|Content Types]] support the full range of tags listed below.
 +
# Each mesh derives its name from the subcontainer's tag name. These names are used to refer to specific meshes from within the mesh-table and also from script.
  
=Supported Tags=
+
==Supported Tags==
 
Each mesh subcontainer supports the following tags. Each tag is shown here with its default value.
 
Each mesh subcontainer supports the following tags. Each tag is shown here with its default value.
  
Line 24: Line 29:
 
  effects
 
  effects
 
  {
 
  {
 +
... (table entries)
 
  }
 
  }
 
  night-mesh-base ""
 
  night-mesh-base ""
  
====mesh-asset====
+
===mesh-asset===
Allows assets to be used as 'mesh libraries', the following container specifies that the mesh required (and its optional animation) is located in the root folder of <kuid:1234:5678>.  CMP does not check for the existence of these files so you must ensure that they are present before using this tag.
+
Allows assets to be used as 'mesh libraries', the following container specifies that the mesh required (and its optional animation) is located in ''''''the root folder'''''' of <kuid:1234:5678>.  CMP does not auto-check for the existence of these'' 'externally referenced files' ''when processing so you must ensure that they are present in the referenced kuid before using this tag.
 
+
===mesh-table===
 
  mesh-table {
 
  mesh-table {
 
   submesh {
 
   submesh {
Line 40: Line 46:
 
  }
 
  }
  
====mesh====
+
===mesh===
 
The ‘main’ mesh name. This may include a sub-path;  
 
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.
 
ie: mesh nightwindows/nightwindows.im, where the file nightwindows.im has been placed in the subdirectory nightwindows.
Line 48: Line 54:
 
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.
 
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====
+
===anim===
 
The animation file (.kin) exported from 3dsmax. This may include a sub-path.
 
The animation file (.kin) exported from 3dsmax. This may include a sub-path.
  
====lod-level====
+
===lod-level===
 
The object LOD level at which this mesh is displayed. The default value (255) indicates that this mesh is visible at all detail levels.  See also [[KIND Mesh]] for the 'mesh-detail-level' tag.
 
The object LOD level at which this mesh is displayed. The default value (255) indicates that this mesh is visible at all detail levels.  See also [[KIND Mesh]] for the 'mesh-detail-level' tag.
  
====mesh-season====
+
===mesh-season===
 
The season index for which this mesh is displayed. The default value (255) indicates that this mesh is visible in all seasons.  See also [["Season-selector" container]].
 
The season index for which this mesh is displayed. The default value (255) indicates that this mesh is visible in all seasons.  See also [["Season-selector" container]].
  
====att====
+
===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).
 
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====
+
===att-parent===
 
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.
 
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.
  
====opacity====
+
===opacity===
 
opacity x (float 0.0 - 1.0 default 1.0)
 
opacity x (float 0.0 - 1.0 default 1.0)
  
Line 70: Line 76:
 
Note that this tag is buggy in TS2009 prior to SP4.
 
Note that this tag is buggy in TS2009 prior to SP4.
  
====mesh-scale====
+
===mesh-scale===
''TBD''
+
''{{TBD}}''
  
====position====
+
===position===
 
position X,Y,Z  (in metres, default 0,0,0)  
 
position X,Y,Z  (in metres, default 0,0,0)  
  
 
Specifies the location of a mesh relative to its insertion point.
 
Specifies the location of a mesh relative to its insertion point.
  
====orientation====
+
===orientation===
 
orientation X,Y,Z  (radians default 0,0,0)
 
orientation X,Y,Z  (radians default 0,0,0)
  
Line 87: Line 93:
 
A coconut is awarded to the programmer who decided that the parameters to this tag should be in radians.
 
A coconut is awarded to the programmer who decided that the parameters to this tag should be in radians.
  
====auto-create====
+
===auto-create===
 
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.
 
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.
  
====use-parent-bounds====
+
===use-parent-bounds===
 
When enabled, this tag indicates that render culling should occur using the whole object's bounding box rather than this mesh's bounding box. Bounding boxes on individual meshes may not update correctly when animation moves the object's geometry any significant distance from the bind position. This flag can help mitigate such effects, at a tiny performance penalty.
 
When enabled, this tag indicates that render culling should occur using the whole object's bounding box rather than this mesh's bounding box. Bounding boxes on individual meshes may not update correctly when animation moves the object's geometry any significant distance from the bind position. This flag can help mitigate such effects, at a tiny performance penalty.
  
====animation-loop-speed====
+
===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.
 
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.
  
====light====
+
===light===
''TBD''
+
''{{TBD}}''
  
====critical-animation====
+
===critical-animation===
 
"critical-animation" indicates that this mesh's animation generates events which are critical to the script system's behavior. If your asset is not scripted, does not use scripted animation events, or only uses the events for display purposes and will not break if the occasional event is missed, this tag should be set to ''false''. Leaving this flag set to ''true'' is a '''significant''' performance penalty.
 
"critical-animation" indicates that this mesh's animation generates events which are critical to the script system's behavior. If your asset is not scripted, does not use scripted animation events, or only uses the events for display purposes and will not break if the occasional event is missed, this tag should be set to ''false''. Leaving this flag set to ''true'' is a '''significant''' performance penalty.
  
====night-mesh-base====
+
===night-mesh-base===
 
This night mesh is linked to the specified mesh and is visible only at night. It is invisible if the specified mesh is invisible, (if the auto-create 0 line were used so the specified mesh can be controlled by script).
 
This night mesh is linked to the specified mesh and is visible only at night. It is invisible if the specified mesh is invisible, (if the auto-create 0 line were used so the specified mesh can be controlled by script).
  
=Effects Container=
+
==Effects Container==
 
The effects container also contains a list of effect subcontainers. The effect subcontainers support the following generic tags.
 
The effects container also contains a list of effect subcontainers. The effect subcontainers support the following generic tags.
  
Line 120: Line 126:
  
  
=Mesh-Table Example=
+
==Mesh-Table Example==
 
The following is an example of a simple mesh-table which implements two levels of detail.
 
The following is an example of a simple mesh-table which implements two levels of detail.
  
Line 140: Line 146:
  
 
[[Category:Config Container]]
 
[[Category:Config Container]]
 +
{{ORP-bot}}

Revision as of 23:15, 9 July 2013

Contents

KIND Heirarchy

The "mesh-table" container is a top-level config.txt file entry used by various Content Types.


  1. The mesh-table is a list of mesh subcontainers with no standalone tags.
  2. Each mesh subcontainer uses the following format.
  3. Tags are parsed in a standardised format, but not all Content Types support the full range of tags listed below.
  4. Each mesh derives its name from the subcontainer's tag name. These names are used to refer to specific meshes from within the mesh-table and also from script.

Supported Tags

Each mesh subcontainer supports the following tags. Each tag is shown here with its default value.

mesh-asset <NULLKUID>
mesh ""
anim ""
lod-level 255
mesh-season 255
att ""
att-parent ""
opacity 1.0
position 0,0,0
orientation 0,0,0
auto-create 0
use-parent-bounds 0
animation-loop-speed 0
light 1
critical-animation 1
effects
{
... (table entries)
}
night-mesh-base ""

mesh-asset

Allows assets to be used as 'mesh libraries', the following container specifies that the mesh required (and its optional animation) is located in 'the root folder' of <kuid:1234:5678>. CMP does not auto-check for the existence of these 'externally referenced files' when processing so you must ensure that they are present in the referenced kuid before using this tag.

mesh-table

mesh-table {
  submesh {
   mesh-asset <kuid:1234:5678>
   mesh "meshname.im"
   anim "meshname.kin"
   att "a.point"
   att-parent "default"
  }
}

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.

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.

lod-level

The object LOD level at which this mesh is displayed. The default value (255) indicates that this mesh is visible at all detail levels. See also KIND Mesh for the 'mesh-detail-level' tag.

mesh-season

The season index for which this mesh is displayed. The default value (255) indicates that this mesh is visible in all seasons. See also "Season-selector" container.

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

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.

opacity

opacity x (float 0.0 - 1.0 default 1.0)

Specifies the overall transparency of a mesh. Values other than 0.0 or 1.0 employ alpha blending and a value of 0.0 has the same effect as hiding the mesh.

Note that this tag is buggy in TS2009 prior to SP4.

mesh-scale

∅TBD!

position

position X,Y,Z (in metres, default 0,0,0)

Specifies the location of a mesh relative to its insertion point.

orientation

orientation X,Y,Z (radians default 0,0,0)

Allows a submesh to be rotated relative to its insertion point. To reverse a mesh by 180 degrees about the Z axis, add the tag:

orientation 0,0,3.14159

A coconut is awarded to the programmer who decided that the parameters to this tag should be in radians.

auto-create

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.

use-parent-bounds

When enabled, this tag indicates that render culling should occur using the whole object's bounding box rather than this mesh's bounding box. Bounding boxes on individual meshes may not update correctly when animation moves the object's geometry any significant distance from the bind position. This flag can help mitigate such effects, at a tiny performance penalty.

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.

light

∅TBD!

critical-animation

"critical-animation" indicates that this mesh's animation generates events which are critical to the script system's behavior. If your asset is not scripted, does not use scripted animation events, or only uses the events for display purposes and will not break if the occasional event is missed, this tag should be set to false. Leaving this flag set to true is a significant performance penalty.

night-mesh-base

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

Effects Container

The effects container also contains a list of effect subcontainers. The effect subcontainers support the following generic tags.

kind ""
name ""

The effect subcontainers support additional tags depending on the effect kind. The following effect kinds are supported:


Mesh-Table Example

The following is an example of a simple mesh-table which implements two levels of detail.

mesh-table
{
  default-lod0
  {
    mesh "example-lod0.im"
    auto-create 1
    lod-level 0
  }
  default-lod1
  {
    mesh "example-lod1.im"
    auto-create 1
    lod-level 1
  }
}
Personal tools