"mesh-table" container

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
(list backlinked pages)
 
(30 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
{{ORP-top}}
 
{{ORP-top}}
==KIND Heirarchy==
+
==KIND Hierarchy==
 
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.
+
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.
# 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.
+
This page describes [[trainz-build]] 4.1.
# 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.
+
  
 
==Known Dependent Parent Types==
 
==Known Dependent Parent Types==
 
:''Main article, see: [[KIND Mesh]]''
 
:''Main article, see: [[KIND Mesh]]''
The below group of linked articles are Trainz data types which use the mesh-table container as part of their definitions.
+
The Content Types listed here use the mesh-table container as part of their definition.
  
'''Mesh-table''' dependent assets:'''
+
* [[KIND Industry]]
: (list below is sorted ignoring case, the keyword "KIND" and all quotation marks <code>["]</code>.){{bullR
+
* [[KIND MOJunction]]
}}[[Animation Effect]] {{bull}}[[Attachment Effect]] {{bullR
+
* [[KIND Pantograph]]
}}[[Corona Effect]] {{bull}}[["junction-vertices" container]] {{bull
+
* [[KIND Scenery]]
}}[[Level of Detail]] {{bull}}[[KIND Industry]] {{bullR
+
* [[KIND Track]]
}}[[KIND MOJunction]] {{bull}}[[KIND Pantograph]] {{bull
+
* [[KIND Traincar]]
}}[["mesh-table" container (interior version)]]  {{bullR
+
}}[[Name Effect]] {{bull}}[[Terminology]] {{bull
+
}}[[Texture-Replacement Effect]] {{bull}}[[KIND Traincar]] {{bullR
+
}}[[KIND Scenery]] {{bull}}[["Season-selector" container]] {{bull
+
}}[[KIND Track]] {{bullR}}[["track-lod-tree" container]] {{bull
+
}}[[KIND Traincar]] <br/>
+
'''See also"'''{{bullR}} [[Modeling Guidelines]] {{bull}} [[Modeling Scenery]]
+
==Supported Tags==
+
Each mesh subcontainer supports the following tags. Each tag is shown here with its default value.
+
  
mesh-asset <NULLKUID>
+
The following config containers also reference back to their Asset's mesh-table container in some fashion:
mesh ""
+
* [["junction-vertices" container]]
anim ""
+
* [["track-lod-tree" container]]
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===
+
'''See also'''{{bullR}} [[Modeling Guidelines]] {{bull}} [[Modeling Scenery]]
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===
+
==Level of Detail (LOD)==
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.
+
For discussions of LOD see [[Level of Detail]], [[LOD Example]], [[mesh-table LOD]] and [[LM.txt 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.
+
==Mesh subcontainer==
 +
Each mesh subcontainer supports the following tags. Each tag is shown here with its default value.  
  
===anim===
+
{| border=0
The animation file (.kin) exported from 3dsmax. This may include a sub-path.
+
  |+
 +
|-
 +
  | anim
 +
  | ""
 +
|-
 +
  | animation-loop-speed
 +
  | 0
 +
|-
 +
  | att
 +
  | ""
 +
|-
 +
  | att-parent
 +
  | ""
 +
|-
 +
  | auto-create
 +
  | 0
 +
|-
 +
  | collision-data-generation-mode
 +
  | "default"
 +
|-
 +
| collision-mesh
 +
| ""
 +
|-
 +
  | critical-animation
 +
  | 1
 +
|-
 +
  | does-cast-shadows
 +
  | 1
 +
|-
 +
  | effects
 +
  | {
 +
|-
 +
  | }
 +
|-
 +
  | lod-level
 +
  | 255
 +
|-
 +
  | mesh
 +
  | ""
 +
|-
 +
  | mesh-asset
 +
  | <NULLKUID>
 +
|-
 +
  | mesh-scale
 +
  | 0,0,0
 +
|-
 +
  | mesh-season
 +
  | 255
 +
|-
 +
  | night-mesh-base
 +
  | ""
 +
|-
 +
  | opacity
 +
  | 1.0
 +
|-
 +
  | orientation
 +
  | 0,0,0
 +
|-
 +
  | position
 +
  | 0,0,0
 +
|-
 +
  | should-respond-to-clicks
 +
  | 1
 +
|-
 +
  | use-parent-bounds
 +
  | 0
 +
|}
  
===lod-level===
+
<big>*</big> The att-parent defaults to "default" which is the parent mesh.  The att-parent tag can include a path.
The object LOD level at which this mesh is displayed. The default value (255) indicates that this mesh is visible at all detail levelsSee also [[KIND Mesh]] for the 'mesh-detail-level' tag.
+
  
===mesh-season===
+
==Supported Tags==
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]].
+
Each mesh subcontainer supports the following tags.
 +
 
 +
===anim===
 +
:Type:      File
 +
:Default:    ""
 +
:Compulsory: No
 +
:Desc:      The animation file (.kin) exported from the 3D modelling tool and/or [[Trainz_Mesh_Importer|TrainzMeshImporter]]. This may include a sub-path.
 +
 
 +
===animation-loop-speed===
 +
:Type: Float
 +
:Default: 0
 +
:Compulsory: No
 +
:Desc: This tag must be present if the asset is to animate when placed. If this tag is not present 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 the 3D modelling tool.
  
 
===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).
+
:Type: Attachment point
 +
:Default: ""
 +
:Compulsory: No
 +
:Desc: 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.
+
:Type: Mesh name
 +
:Default: Defaults to "default" which is the parent mesh
 +
:Compulsory: No
 +
:Desc: 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===
+
===auto-create===
opacity x (float 0.0 - 1.0 default 1.0)
+
:Type: Bool
 +
:Default: 0
 +
:Compulsory No
 +
:Desc: 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.
  
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.
+
===collision-data-generation-mode===
 +
:Type: Collision mode
 +
:Default: "default"
 +
:Compulsory No
 +
:Desc: Determines the method to use to generate collision data for this mesh. Collision data is used to select and move the asset in surveyor, and for physics simulation when necessary.
 +
:Supported collision data generation modes:
 +
:* "default" - use game's default value (in general "collated", but can vary in specific cases)
 +
:* "disabled" - completely discard this sub-mesh for collision data generation purposes. Causes the sub-mesh to be fully ignored for asset picking and physics simulation.
 +
:* "collated" - the geometry of this sub-mesh will be added to that of the other sub-meshes selecting this option (within the asset), and one collision object will be generated for the resulting conglomerate.
 +
:* "separate-shape-convex-hull" - this sub-mesh will generate its own individual collision object, as a convex hull.
 +
:* "separate-shape-triangle-mesh" - this sub-mesh will generate its own individual collision object, as a triangle mesh. This is the most accurate option but also the most costly in terms of performance, only use when specifically needed.
  
Note that this tag is buggy in TS2009 prior to SP4.
+
===collision-mesh===
 +
:Type: Mesh name
 +
:Default: ""
 +
:Compulsory No
 +
:Desc: Specifies a mesh to use instead of this mesh to generate collision data - must be an entry of this mesh-table. The method used to generate the collision data (through the "[[%22mesh-table%22_container#collision-data-generation-mode|collision-data-generation-mode]]" tag) is the one specified on this entry, which is allowed to be different from that of the referenced mesh.
  
===mesh-scale===
+
===critical-animation===
''{{TBD}}''
+
:Type: Bool
 +
:Default: 1  (TBD: surely this should be false (0))
 +
:Compulsory: No
 +
:Desc: "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 (0)''. Leaving this flag set to ''true (1)'' is a '''significant''' performance penalty.
  
===position===
+
====custom-render-plugin====
position X,Y,Z (in metres, default 0,0,0)
+
:Type: [[KUID]]
 +
:Default: ""
 +
:Compulsory: No
 +
:Desc: TBD
  
Specifies the location of a mesh relative to its insertion point.
+
===does-cast-shadows===
 +
:Type: Bool
 +
:Default: 1
 +
:Compulsory: No
 +
:Desc: "does-cast-shadows" determines if this mesh will cast shadows when the user has shadows enabled in the settings. Setting this tag to ''false (0)'' means the mesh will not cast shadows. Setting this tag to ''true (1)'' means the mesh will cast shadows.
 +
:Trainz build 4.4
  
===orientation===
+
===effects===
orientation X,Y,Z  (radians default 0,0,0)
+
:Type: [[Corona Effect]] | [[Name Effect]] | [[Attachment Effect]] | [[Animation Effect]] | [[Texture-Replacement Effect]]
 +
:Default {}
 +
:Compulsory: No
 +
:Desc: The effects container can contain a list of effect subcontainers. The effect subcontainers support the following generic tags.
  
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:
+
: kind ""
 +
: name ""
  
orientation 0,0,3.14159
+
:Each effect subcontainer supports additional tags depending on the effect kind. The following effect kinds are supported:
  
===auto-create===
+
:* [[Corona Effect]]
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.
+
:* [[Name Effect]]
 +
:* [[Attachment Effect]]
 +
:* [[Animation Effect]]
 +
:* [[Texture-Replacement Effect]]
  
===use-parent-bounds===
+
===lod-level===
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.
+
:Type: Int (0-8)
 +
:Default: 255
 +
:Compulsory: No
 +
:Desc: The [[mesh-table 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.
  
===animation-loop-speed===
+
===mesh===
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.
+
:Type: Mesh name
 +
:Default: "" (will raise error if null)
 +
:Compulsory: Yes (3.4)
 +
:Desc: 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 or reference an [[LM.txt_file]] file if you wish your asset to have ‘Level of Detail’ mesh reduction.
 +
:The mesh name can also refer to an IM file or an [[LM.txt_file]] file in a mesh asset library if the mesh-asset tag is specified.  The LM.TXT file should be in the mesh asset library.
  
===light===
+
===mesh-asset===
''{{TBD}}''
+
:Type: [[KUID]]
 +
:Default: <NULLKUID>
 +
:Compulsory: No
 +
:Desc: Specifies a mesh asset to be used in conjunction with the 'mesh' tag when the mesh is not contained within the current asset. The mesh name specified in the 'mesh' tag must be located in the mesh asset as Content Manager does not check for the existence of the mesh and will not report an error if it is missing.  If the mesh is not located in the root folder of the mesh asset then the mesh name in the 'mesh' tag must include the path to the folder.
  
===critical-animation===
+
<div style="background-color: #ddf5eb;border-style: dotted; width:800px; overflow:auto; ">
"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.
+
NOTE: There may be several different versions of the mesh asset installed, with different meshes.  The mesh asset KUID number must be the version of the asset in which the mesh in the 'mesh' tag exists.  
 +
 
 +
Example: If the mesh in the 'mesh' tag was added in kuid2:12345:9876:2 and does not exist in earlier versions, then this is the kuid number you must specify in the mesh-asset tag; specifying an older revision number (ie kuid:12345:9876 or kuid2:12345:9876:1) will result in errors.  This applies even if the only change between versions is that the mesh is in a different folder.
 +
</div>
 +
 
 +
===mesh-scale===
 +
:Type: Floatlist
 +
:Default: 1.0,1.0
 +
:Compulsory: No
 +
:Desc: This tag defines a minimum and maximum scaling value for the mesh, where 1.0 is the size as modelled. Each instance of the mesh that exists in the world will randomise within this range. Randomisation will not change between runs or between Trainz editions, but may change based on factors such as the position of the mesh in the world. This tag is currently only supported on SpeedTree assets; attempts to use this tag on other assets results in undefined behaviour.
 +
 
 +
===mesh-season===
 +
:Type: Int (0-250)
 +
:Default: 255
 +
:Compulsory: No
 +
:Desc: 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]].
  
 
===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).
+
:Type: Mesh name
 +
:Default: ""
 +
:Compulsory: No
 +
:Desc: Defines this mesh as a "nightmode" mesh. This mesh is visible only at "night" (the exact meaning of which is defined by the [[KIND Scenery#nightmode|nightmode]] tag in the top level of this asset's [[config.txt file]]. This mesh becomes invisible if the specified base mesh is invisible. Prior to [["Trainz-build" tag|v4.3]], nightmode meshes have a [[material emissive color]] (currently 2.0, 2.0, 2.0) forcibly applied to them. From v4.3 upward, it is expected that the creator will set any necessary emissive coloration in the [[IM files|mesh file]] itself.
  
==Effects Container==
+
===opacity===
The effects container also contains a list of effect subcontainers. The effect subcontainers support the following generic tags.
+
:Type: Float (0.0 - 1.0)(See below)
 +
:Default: 1.0
 +
:Compulsory: No
 +
:Desc: Specifies the overall transparency of the 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.
  
kind ""
+
===orientation===
  name ""
+
:Type: Floatlist (radians)
 +
:Default: 0,0,0
 +
:Compulsory: No
 +
:Desc: Orientation of X,Y,Z axes. 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
  
The effect subcontainers support additional tags depending on the effect kind. The following effect kinds are supported:
+
===position===
 +
:Type: Floatlist (metres)
 +
:Default: 0,0,0
 +
:Compulsory: No
 +
:Desc: Position of the mesh using X,Y,Z axes relative to its insertion point.
  
* [[Corona Effect]]
+
===radius===
* [[Name Effect]]
+
:Type: Float
* [[Attachment Effect]]
+
:Default: TBD
* [[Animation Effect]]
+
:Compulsory: No
* [[Texture-Replacement Effect]]
+
:Desc: TBD (should this be in [["mesh-table"_container_(interior_version)]]?)
  
 +
===should-respond-to-clicks===
 +
:Type: Bool
 +
:Default: True(1)
 +
:Compulsory: No
 +
:Desc: If set to false (0) on a mesh that is part of an asset, it will remove that mesh from the calculation of the 'bounding box' that will be used to check whether the user clicked on that particular asset.  This is useful for light ray effects or animations which are significantly outside the normal bounding volume, and may cause movement to focus on the wrong asset.  For instance, a traincar may need a mesh marked with should-respond-to-clicks set to false in order to ensure that the click is detected for the correct traincar when it is part of a consist. First introduced with TS12 SP1 HF4 (build 61388). Default value (True) is the prior behaviour (the mesh ''will'' be considered part of the bounding box for the purpose of registering clicks).
 +
 +
===test-collisions===
 +
:Type: Bool
 +
:Default: TBD
 +
:Compulsory: No
 +
:Desc: TBD (should this be in [["mesh-table"_container_(interior_version)]]?)
 +
 +
===use-parent-bounds===
 +
:Type: Bool
 +
:Default: False(0)
 +
:Compulsory: No
 +
:Desc: 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.
  
 
==Mesh-Table Example==
 
==Mesh-Table Example==
Line 159: Line 293:
 
  }
 
  }
  
[[Category:Config Container]]
+
==Mesh-Table Example (with collision)==
{{ORP-bot}}
+
The following is an example of a mesh table with a separate collision mesh. For this, we are using a low polygon collision mesh with no material (null.m.notex) in place of any collision the game would generate for us. It's important to put the collision-data-generation-mode to "disabled" for every other mesh that is not the collision mesh. Otherwise, the game will assume the mesh can be used for collision and create unwanted results.
 +
 
 +
mesh-table
 +
{
 +
  default
 +
  {
 +
    mesh "example.lm"
 +
    auto-create 1
 +
    collision-data-generation-mode      "disabled"
 +
    collision-mesh "collision"
 +
  }
 +
  collision
 +
  {
 +
    mesh "collision.trainzmesh"
 +
    collision-data-generation-mode      "separate-shape-triangle-mesh"
 +
  }
 +
}
 +
 
 +
[[Category:Config Container|mesh-table container]]
 +
{{ORP-bot|mesh-table container}}

Latest revision as of 04:15, 9 January 2024

Contents

[edit] KIND Hierarchy

The "mesh-table" container is a top-level config.txt file entry used by various 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 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.

This page describes trainz-build 4.1.

[edit] Known Dependent Parent Types

Main article, see: KIND Mesh

The Content Types listed here use the mesh-table container as part of their definition.

The following config containers also reference back to their Asset's mesh-table container in some fashion:

See also
 • Modeling Guidelines  • Modeling Scenery

[edit] Level of Detail (LOD)

For discussions of LOD see Level of Detail, LOD Example, mesh-table LOD and LM.txt file

[edit] Mesh subcontainer

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

anim ""
animation-loop-speed 0
att ""
att-parent ""
auto-create 0
collision-data-generation-mode "default"
collision-mesh ""
critical-animation 1
does-cast-shadows 1
effects {
}
lod-level 255
mesh ""
mesh-asset <NULLKUID>
mesh-scale 0,0,0
mesh-season 255
night-mesh-base ""
opacity 1.0
orientation 0,0,0
position 0,0,0
should-respond-to-clicks 1
use-parent-bounds 0

* The att-parent defaults to "default" which is the parent mesh. The att-parent tag can include a path.

[edit] Supported Tags

Each mesh subcontainer supports the following tags.

[edit] anim

Type: File
Default: ""
Compulsory: No
Desc: The animation file (.kin) exported from the 3D modelling tool and/or TrainzMeshImporter. This may include a sub-path.

[edit] animation-loop-speed

Type: Float
Default: 0
Compulsory: No
Desc: This tag must be present if the asset is to animate when placed. If this tag is not present 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 the 3D modelling tool.

[edit] att

Type: Attachment point
Default: ""
Compulsory: No
Desc: 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).

[edit] att-parent

Type: Mesh name
Default: Defaults to "default" which is the parent mesh
Compulsory: No
Desc: 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.

[edit] auto-create

Type: Bool
Default: 0
Compulsory No
Desc: 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.

[edit] collision-data-generation-mode

Type: Collision mode
Default: "default"
Compulsory No
Desc: Determines the method to use to generate collision data for this mesh. Collision data is used to select and move the asset in surveyor, and for physics simulation when necessary.
Supported collision data generation modes:
  • "default" - use game's default value (in general "collated", but can vary in specific cases)
  • "disabled" - completely discard this sub-mesh for collision data generation purposes. Causes the sub-mesh to be fully ignored for asset picking and physics simulation.
  • "collated" - the geometry of this sub-mesh will be added to that of the other sub-meshes selecting this option (within the asset), and one collision object will be generated for the resulting conglomerate.
  • "separate-shape-convex-hull" - this sub-mesh will generate its own individual collision object, as a convex hull.
  • "separate-shape-triangle-mesh" - this sub-mesh will generate its own individual collision object, as a triangle mesh. This is the most accurate option but also the most costly in terms of performance, only use when specifically needed.

[edit] collision-mesh

Type: Mesh name
Default: ""
Compulsory No
Desc: Specifies a mesh to use instead of this mesh to generate collision data - must be an entry of this mesh-table. The method used to generate the collision data (through the "collision-data-generation-mode" tag) is the one specified on this entry, which is allowed to be different from that of the referenced mesh.

[edit] critical-animation

Type: Bool
Default: 1 (TBD: surely this should be false (0))
Compulsory: No
Desc: "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 (0). Leaving this flag set to true (1) is a significant performance penalty.

[edit] custom-render-plugin

Type: KUID
Default: ""
Compulsory: No
Desc: TBD

[edit] does-cast-shadows

Type: Bool
Default: 1
Compulsory: No
Desc: "does-cast-shadows" determines if this mesh will cast shadows when the user has shadows enabled in the settings. Setting this tag to false (0) means the mesh will not cast shadows. Setting this tag to true (1) means the mesh will cast shadows.
Trainz build 4.4

[edit] effects

Type: Corona Effect | Name Effect | Attachment Effect | Animation Effect | Texture-Replacement Effect
Default {}
Compulsory: No
Desc: The effects container can contain a list of effect subcontainers. The effect subcontainers support the following generic tags.
kind ""
name ""
Each effect subcontainer supports additional tags depending on the effect kind. The following effect kinds are supported:

[edit] lod-level

Type: Int (0-8)
Default: 255
Compulsory: No
Desc: The mesh-table 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.

[edit] mesh

Type: Mesh name
Default: "" (will raise error if null)
Compulsory: Yes (3.4)
Desc: 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 or reference an LM.txt_file file if you wish your asset to have ‘Level of Detail’ mesh reduction.
The mesh name can also refer to an IM file or an LM.txt_file file in a mesh asset library if the mesh-asset tag is specified. The LM.TXT file should be in the mesh asset library.

[edit] mesh-asset

Type: KUID
Default: <NULLKUID>
Compulsory: No
Desc: Specifies a mesh asset to be used in conjunction with the 'mesh' tag when the mesh is not contained within the current asset. The mesh name specified in the 'mesh' tag must be located in the mesh asset as Content Manager does not check for the existence of the mesh and will not report an error if it is missing. If the mesh is not located in the root folder of the mesh asset then the mesh name in the 'mesh' tag must include the path to the folder.

NOTE: There may be several different versions of the mesh asset installed, with different meshes. The mesh asset KUID number must be the version of the asset in which the mesh in the 'mesh' tag exists.

Example: If the mesh in the 'mesh' tag was added in kuid2:12345:9876:2 and does not exist in earlier versions, then this is the kuid number you must specify in the mesh-asset tag; specifying an older revision number (ie kuid:12345:9876 or kuid2:12345:9876:1) will result in errors. This applies even if the only change between versions is that the mesh is in a different folder.

[edit] mesh-scale

Type: Floatlist
Default: 1.0,1.0
Compulsory: No
Desc: This tag defines a minimum and maximum scaling value for the mesh, where 1.0 is the size as modelled. Each instance of the mesh that exists in the world will randomise within this range. Randomisation will not change between runs or between Trainz editions, but may change based on factors such as the position of the mesh in the world. This tag is currently only supported on SpeedTree assets; attempts to use this tag on other assets results in undefined behaviour.

[edit] mesh-season

Type: Int (0-250)
Default: 255
Compulsory: No
Desc: 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.

[edit] night-mesh-base

Type: Mesh name
Default: ""
Compulsory: No
Desc: Defines this mesh as a "nightmode" mesh. This mesh is visible only at "night" (the exact meaning of which is defined by the nightmode tag in the top level of this asset's config.txt file. This mesh becomes invisible if the specified base mesh is invisible. Prior to v4.3, nightmode meshes have a material emissive color (currently 2.0, 2.0, 2.0) forcibly applied to them. From v4.3 upward, it is expected that the creator will set any necessary emissive coloration in the mesh file itself.

[edit] opacity

Type: Float (0.0 - 1.0)(See below)
Default: 1.0
Compulsory: No
Desc: Specifies the overall transparency of the 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.

[edit] orientation

Type: Floatlist (radians)
Default: 0,0,0
Compulsory: No
Desc: Orientation of X,Y,Z axes. 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

[edit] position

Type: Floatlist (metres)
Default: 0,0,0
Compulsory: No
Desc: Position of the mesh using X,Y,Z axes relative to its insertion point.

[edit] radius

Type: Float
Default: TBD
Compulsory: No
Desc: TBD (should this be in "mesh-table"_container_(interior_version)?)

[edit] should-respond-to-clicks

Type: Bool
Default: True(1)
Compulsory: No
Desc: If set to false (0) on a mesh that is part of an asset, it will remove that mesh from the calculation of the 'bounding box' that will be used to check whether the user clicked on that particular asset. This is useful for light ray effects or animations which are significantly outside the normal bounding volume, and may cause movement to focus on the wrong asset. For instance, a traincar may need a mesh marked with should-respond-to-clicks set to false in order to ensure that the click is detected for the correct traincar when it is part of a consist. First introduced with TS12 SP1 HF4 (build 61388). Default value (True) is the prior behaviour (the mesh will be considered part of the bounding box for the purpose of registering clicks).

[edit] test-collisions

Type: Bool
Default: TBD
Compulsory: No
Desc: TBD (should this be in "mesh-table"_container_(interior_version)?)

[edit] use-parent-bounds

Type: Bool
Default: False(0)
Compulsory: No
Desc: 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.

[edit] 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
  }
}

[edit] Mesh-Table Example (with collision)

The following is an example of a mesh table with a separate collision mesh. For this, we are using a low polygon collision mesh with no material (null.m.notex) in place of any collision the game would generate for us. It's important to put the collision-data-generation-mode to "disabled" for every other mesh that is not the collision mesh. Otherwise, the game will assume the mesh can be used for collision and create unwanted results.

mesh-table
{
  default
  {
    mesh "example.lm"
    auto-create 1
    collision-data-generation-mode      "disabled"
    collision-mesh "collision"
  }
  collision
  {
    mesh "collision.trainzmesh"
    collision-data-generation-mode      "separate-shape-triangle-mesh"
  }
}
Personal tools