Turning a scenery object into a Spline

Be careful what you wish for. One of the main causes of stuttering, according to some recent discussions in these forums, is spines with high poly counts and no LOD data. Most scenery items, especially amongst the older ones, have high polys and/or no LODs so by turning a single scenery asset into a spline, which I believe is possible (but I have never done it), you may be creating major problems.
 
Good Evening, I'd like to now is it possible for me to turn a scenery object into a spline?

If it is your creation, then yes you can. Splines are oriented differently than their scenery counterparts, along the negative Y axis, so you have to go into your CC program and re-orient the mesh. And of course you have to alter the config.txt file.

But if it's not your creation (and I suspect this is the case!) then the simple answer is no, but if you have the means you can reverse engineer it. This is not easy, and also requires the permission of the original creator. To do it without their permission is heavily frowned upon.

And PWare's comment is very pertinent. To do the job properly you would need to provide at least two levels of LOD (Level of Detail).

Mick
 
Last edited:
Edit: Looks like Mick got in before me. I say much the same thing.

As pware rightly said, the short answer is yes. It’s basically a matter of taking a mesh object and configuring it as a spline by means of its config.txt file. However....

Apart from the important issue of LOD, meshes used for splines must also be made so that in the 3D space of their creation program (gmax, Blender, Max etc) the mesh is placed in the -Y quadrant. And its position and orientation in that space must be such that it looks as intended when the mesh is repeated along the spline.

In other words, many objects that look and function quite well as Kind scenery (or other) assets, will fail when re-configured as splines because their meshes don’t have the necessary position or orientation in 3D model space. So you need to have access to their original creation files and re-work them in the appropriate 3D program to make the mesh suitable for a spline.

.
 
Last edited:
But if it's not your creation (and I suspect this is the case!) then the simple answer is no

Not so. Turning a scenery item into a spline is trivial,
Code:
kuid                                    <kuid:xxxxxx:yyyyy>
username                                "Spline from Scenery"
kind                                    "track"
trainz-build                            4.2
mesh-table
{
  default
  {
    mesh-asset                          <kuid:-25:231>
    mesh                                "horse1.im"
  }
}
istrack                                 0
isroad                                  0
track
{
  mesh-length                           2.5
  
  track-lod-tree
  {
    mesh                                "default"
  }
  dont-scale-mesh-to-fit-length         1
  spacing-length-after                  5
  follows-spline-gradient               1
}
category-class                          "OA"
category-era                            "2000s"
category-region                         "IT"
description                             "Sample Spline from Secnery Item"
thumbnails
{
  0
  {
    image                               "$screenshot$.jpg"
    width                               240
    height                              180
  }
}
kuid-table
{
  0                                     <kuid:-25:231>
}
 
Last edited:
What if the horse was facing sideways (and you didn’t want it like that) or was made somewhere on the +Y side of the 3D origin? Not so trivial.


.
 
Last edited:
Not all non-spline assets are suitable candidates for turning into splines. Apart from the high poly and LOD issues there are many other pitfalls, such as the placement and orientation of the object compared to the axes, as stated by Dinorius above, the overall physical dimensions of the asset, the visual effects of the repeatability and "stretch" factors, etc. Plus the copyright issue if you intend to redistribute the asset as a spline.
 
What if the horse was facing sideways or was made somewhere on the +Y side of the 3D origin?
Then you would have a spline of horses standing side-by-side instead of nose-to-tail, which might be exactly what is required.

OP's question was "is it possible..." and the code above demonstrates it is not only possible, but is quite straightforward. Whether or not it produces the result that OP requires is unknowable and irrelevant.
 
What if the horse was facing sideways (and you didn’t want it like that) or was made somewhere on the +Y side of the 3D origin? Not so trivial.

I never attempted turning a scenery object into a spline by tinkering with its config, but if (and that's a big if) the use of the "position" and "orientation" tags is allowed in the mesh-table of a spline object this issue is easily solved. Of course, if use of the above tags is not allowed, my theory goes straight into the waste bin :D.
 
However you would still need permission of the original author to upload outside your own computer. There are many recent bushes and trees which are crying out to be "splined" to replace the earlier ones, excellent in their day but now useless in TANE due to being almost transparent (the JVC grass/shrubs which were excellent for riverbanks and embankment/cutting sides come to mind).
 
However you would still need permission of the original author to upload outside your own computer.
Sigh. You do NOT need the permission of the original creator if the mesh used in the spline is referenced from the mesh table rather than being included with the asset. Please look at the config.txt posted above. It does NOT use any part of the original asset and is entirely an original creation.
 
Works well actually, here's one I did a while back, my asset by the way, was playing around to see if it worked

Code:
mesh-table
{
  default
  {
    mesh-asset                          <kuid:425700:100516>
    mesh                                "bush.IM"
  }
}

track
{
  mesh-length                           5
  
  track-lod-tree
  {
    mesh                                "default"
  }
  dont-scale-mesh-to-fit-length         1
  spacing-length-after                  2
  follows-spline-gradient               1
}




 
how exactly did you do this?
In T:ANE Content Manager, select Developer / New Content. A dummy asset will be created with your KUID. Change the filter to Open for Edit. Right click the New Asset and select Open / Edit Config File Text. Paste the above sample over the text in the file EXCEPT for the kuid line, which should stay as it was originally created.

Adjust the tags such as username and description as required. Close and save the file. Right click the New Asset in Content Manager and select Submit Edits. Change the filter to My Content and sort by date - your new asset will be at the top of the list. Select it and choose Content / Automatically create thumbnails. Make sure Generate Download Station Thumbnail is selected and click OK. The spline asset is now available for use in Surveyor. Right click the asset in CM and Choose Open / Preview Asset to see what you will get.
 
I have tried SailorDan's scheme and it absolutely works. Being a glutton for punishment I used one of Tafweb's single houses as the object. Therefore I had to do a bit of tweaking of mesh-length etc. Even the "transformation-coordinate" tag, that keeps the houses level on hills, works! But the mesh is rotated 90 degrees, as we all expected. If we can find a way to rotate the mesh, we're in business!

Mick

837f18c2a85730151e28d4ef234b9d18_thumb.jpg
[/URL][/IMG]
 
Last edited:
Works well actually, here's one I did a while back, my asset by the way, was playing around to see if it worked

Any chance of doing some of your bushes or trees Malc and uploading to DLS? Would be very useful for quickly populating the side of the track with undergrowth? Sorry if that comes over as a bit gimmie piggy... :udrool:
 
Any chance of doing some of your bushes or trees Malc and uploading to DLS? Would be very useful for quickly populating the side of the track with undergrowth? Sorry if that comes over as a bit gimmie piggy... :udrool:

I've been thinking along those lines re my L&B WIP, as they are my assets it's probably just as easy to create normal splines then I can mix them a bit, being very low poly it shouldn't be a problem.
 
I haven't tried it yet but I have a suspicion that we may get another advantage from this method. I am thinking that night lighting might work? It doesn't with regular splines.
I will give it a go when I can.

EDIT: This doesn't work and I see why. Night Lighting (and smoke effects) are generated by the config file for the asset, and we are not using it. We are just using the mesh file. Oh well, can't have everything!

Mick
 
Last edited:
Back
Top