"mesh-table" container
(pipetrick |mesh-table container) |
(Correct some wording / Add 'light' tag documentation.) |
||
Line 3: | Line 3: | ||
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 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. | |
− | + | ||
− | + | ||
− | + | ||
==Known Dependent Parent Types== | ==Known Dependent Parent Types== | ||
:''Main article, see: [[KIND Mesh]]'' | :''Main article, see: [[KIND Mesh]]'' | ||
− | The | + | The Content Types listed here use the mesh-table container as part of their definition. |
− | + | * [[KIND Industry]] | |
− | + | * [[KIND MOJunction]] | |
− | + | * [[KIND Pantograph]] | |
− | + | * [[KIND Scenery]] | |
− | + | * [[KIND Track]] | |
− | + | * [[KIND Traincar]] | |
− | + | ||
− | + | The following config containers also reference back to their Asset's mesh-table container in some fashion: | |
− | + | * [["junction-vertices" container]] | |
− | + | * [["track-lod-tree" container]] | |
− | + | ||
− | + | '''See also'''{{bullR}} [[Modeling Guidelines]] {{bull}} [[Modeling Scenery]] | |
− | '''See also | + | |
==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 41: | Line 37: | ||
use-parent-bounds 0 | use-parent-bounds 0 | ||
animation-loop-speed 0 | animation-loop-speed 0 | ||
− | |||
critical-animation 1 | critical-animation 1 | ||
effects | effects | ||
{ | { | ||
− | |||
} | } | ||
night-mesh-base "" | night-mesh-base "" | ||
Line 117: | Line 111: | ||
===light=== | ===light=== | ||
− | + | If set (which it is by default), this tag causes the non-stitched mesh to be linked into the Trainz lighting model. This causes the mesh to respond to directional lighting changes, such as the angle of the sun or train headlights. This is also necessary for normal maps to work correctly. Zeroing this tag will remove the mesh from the Trainz lighting model. Generally speaking, you should never zero this tag- almost every effect that can be achieved through this approach can be better served by using an appropriate normal map or appropriate geometry detail. | |
+ | |||
+ | This tag has no effect on stitched meshes, which are always affected by the Trainz lighting. Since the content creator has no direct influence over which meshes are subject to [[Mesh Stitching]], and all indirect influences are subject to change between Trainz editions, it is strongly recommended that this tag is avoided to ensure that results are consistent. | ||
===critical-animation=== | ===critical-animation=== |
Revision as of 10:44, 30 September 2013
Contents |
KIND Heirarchy
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.
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
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 critical-animation 1 effects { } 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
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
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
If set (which it is by default), this tag causes the non-stitched mesh to be linked into the Trainz lighting model. This causes the mesh to respond to directional lighting changes, such as the angle of the sun or train headlights. This is also necessary for normal maps to work correctly. Zeroing this tag will remove the mesh from the Trainz lighting model. Generally speaking, you should never zero this tag- almost every effect that can be achieved through this approach can be better served by using an appropriate normal map or appropriate geometry detail.
This tag has no effect on stitched meshes, which are always affected by the Trainz lighting. Since the content creator has no direct influence over which meshes are subject to Mesh Stitching, and all indirect influences are subject to change between Trainz editions, it is strongly recommended that this tag is avoided to ensure that results are consistent.
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 } }