Mesh library

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
(Created page with "A mesh library is a technique rather than a specific asset type supported by Trainz. The intention of the technique is to include a number of mesh files into a single ...")
 
(Rewrite to current format.)
 
Line 1: Line 1:
A [[mesh library]] is a technique rather than a specific asset type supported by Trainz. The intention of the technique is to include a number of [[mesh file]]s into a single "library" asset (for the purposes of [[material sharing]], mesh sharing, texture sharing, or simply for clarity of organisation) and then reference them from other assets as required rather than copying the [[mesh file]]s into each asset.
+
KIND [[mesh library]] defines one or more meshes as an asset that can be referenced from another asset or via scripting.  
 +
 
 +
The [[mesh library]] asset allows the content creator to include a number of [[mesh file]]s in a single asset for the purposes of [[material sharing]], mesh sharing, texture sharing, or simply for clarity of organisation. The meshes are then referenced from other assets as required.
 +
 
 +
==KIND Hierarchy==
 +
===Parent Classes===
 +
* [[KIND TrainzBaseSpec]]
 +
===Child Classes===
 +
* ''none.''
 +
 
 +
==Supported Tags==
 +
* KIND [[mesh library]] does not support any tags other than those used with any [[KIND Mesh]] asset.
 +
 
 +
==Example Config.txt==
  
 
The typical configuration of a mesh library within Trainz is as follows:
 
The typical configuration of a mesh library within Trainz is as follows:
  
 
* A [[KIND Mesh]] asset is used as the mesh library asset.
 
* A [[KIND Mesh]] asset is used as the mesh library asset.
* The asset is configured with a [[mesh-table]] including the various [[mesh file]]s but with the "auto-create" tag included for each and configured to "0".
+
* The asset is configured with a [[mesh-table]] that contains a number of items, each with a [[mesh file]] and its associated settings, such as effects.
 +
* The "auto-create" tag is typically configured as "0" although it might be convenient to include one [[mesh-table]] item with an "auto-create" tag of "1" in order to avoid a validation warning about no visible mesh in the asset.
  
 
  mesh-table
 
  mesh-table
 
  {
 
  {
   first
+
  summer_boulder_01m
   {
+
  {
    mesh "actual-mesh-file.trainzmesh"
+
   mesh                                "summer\boulder_granite_01m.im"
    auto-create 0
+
   auto-create                        1
  }
+
  }
 +
  summer_boulder_02m
 +
  {
 +
  mesh                               "summer\boulder_granite_02m.im"
 +
  auto-create                        0
 +
  }
 +
  summer_boulder_03m
 +
  {
 +
  mesh                               "summer\boulder_granite_03m.im"
 +
  auto-create                         0
 +
  }
 
  }
 
  }
  
* Placeable assets are configured as normal, but rather than including any [[mesh file]]s or [[texture file]]s into the placeable assets, the placeable assets simply reference the "library" asset in their mesh-table, as follows:
+
* Placeable assets are then configured with [[mesh-table]] entries that use the "mesh-asset" tag in addition to the usual "mesh" tag. The "mesh-asset" tag value is the KUID of the mesh library asset. The "mesh" tag is included as normal, and is the name of the [[mesh file]] in the library (Note: '''NOT''' the mesh table item ID).
 +
 
 +
* The textures, effects, animations etc associated with the mesh are accessed from the library and are not included with the placeable asset.
  
 
  mesh-table
 
  mesh-table
Line 22: Line 48:
 
   {
 
   {
 
     mesh-asset <KUID-OF-MESH-LIBRARY-ASSET>
 
     mesh-asset <KUID-OF-MESH-LIBRARY-ASSET>
     mesh "actual-mesh-file.trainzmesh"
+
     mesh "summer\boulder_granite_02m.im"
 
     auto-create 1
 
     auto-create 1
 
   }
 
   }
 
  }
 
  }
 +
 +
[[Mesh library]] assets do not appear in in-game asset lists.
 +
 +
==Categories==
 +
[[Category:Asset KIND|T]]

Latest revision as of 11:21, 1 May 2019

KIND mesh library defines one or more meshes as an asset that can be referenced from another asset or via scripting.

The mesh library asset allows the content creator to include a number of mesh files in a single asset for the purposes of material sharing, mesh sharing, texture sharing, or simply for clarity of organisation. The meshes are then referenced from other assets as required.

Contents

[edit] KIND Hierarchy

[edit] Parent Classes

[edit] Child Classes

  • none.

[edit] Supported Tags

  • KIND mesh library does not support any tags other than those used with any KIND Mesh asset.

[edit] Example Config.txt

The typical configuration of a mesh library within Trainz is as follows:

  • A KIND Mesh asset is used as the mesh library asset.
  • The asset is configured with a mesh-table that contains a number of items, each with a mesh file and its associated settings, such as effects.
  • The "auto-create" tag is typically configured as "0" although it might be convenient to include one mesh-table item with an "auto-create" tag of "1" in order to avoid a validation warning about no visible mesh in the asset.
mesh-table
{
 summer_boulder_01m
 {
  mesh                                "summer\boulder_granite_01m.im"
  auto-create                         1
 }
 summer_boulder_02m
 {
  mesh                                "summer\boulder_granite_02m.im"
  auto-create                         0
 }
 summer_boulder_03m
 {
  mesh                                "summer\boulder_granite_03m.im"
  auto-create                         0
 }
}
  • Placeable assets are then configured with mesh-table entries that use the "mesh-asset" tag in addition to the usual "mesh" tag. The "mesh-asset" tag value is the KUID of the mesh library asset. The "mesh" tag is included as normal, and is the name of the mesh file in the library (Note: NOT the mesh table item ID).
  • The textures, effects, animations etc associated with the mesh are accessed from the library and are not included with the placeable asset.
mesh-table
{
  default
  {
    mesh-asset <KUID-OF-MESH-LIBRARY-ASSET>
    mesh "summer\boulder_granite_02m.im"
    auto-create 1
  }
}

Mesh library assets do not appear in in-game asset lists.

[edit] Categories

Personal tools