Boxcar LOD

Hi,
I tried to make a boxcar using Blender's FBX but got error when export to Trainz 2019.
Config.txt I use :

mesh-table​
{​
body​
{​
mesh "KKBW_v3.lm"​
auto-create 1​
effects​
{​
front_couple​
{​
kind "attachment"​
att "a.fcoupl"​
default-mesh <kuid2:164418:1:1>​
}​
back_couple​
{​
kind "attachment"​
att "a.bcoupl"​
default-mesh <kuid2:164418:1:1>​
}​
}​
}​
}​

.LM I use :

0 100 KKBW_v3-LOD0n.trainzmesh​
100 300 KKBW_v3-LOD1n.trainzmesh​
300 700 KKBW_v3-LOD2n.trainzmesh​
700 1500 KKBW_v3-LOD3n.trainzmesh​

I had copied "KKBW_v3.lm" to asset folder
But I got error : VE76: Unable to load mesh file: 'kkbw_v3.lm'

Why I had still got this error ?
How to solve ?
 
I successfully created a LOD boxcar with FBX format by replacing "im" with "trainzmesh". It can now appear well in Trainz.

But actually I don't understand what the point is that the traincar must be created with an LM file setting while the rock can follow the FBX guidance.
Both of them (rock and traincar) are single model only.

Maybe it because the traincar is a moving object while the stone is a non-moving object ?
Or rock model can created with LM file, too ?
 
As I mentioned, I have successfully submitted traincar assets from FBX to Trainz without any errors and warnings.

At the next step, I want to add an image to the asset face via an attachment (empty arrow in Blender).
I also created the attachment image mesh from FBX, with a transparent background.
I use this attachment as an image reference point so that if I want to change the image, I don't need to change the entire mesh body. But just the image file.

mesh-detail-level-count 4
mesh-table-lod-transition-distances 100,300,700,1500
mesh-table
{
body
{
mesh "KKBW_v3.lm"
auto-create 1
effects
{
front_couple
{
kind "attachment"
att "a.fcoupl"
default-mesh <kuid2:164418:1:1>
}
back_couple
{
kind "attachment"
att "a.bcoupl"
default-mesh <kuid2:164418:1:1>
}
}
}
*****
}


I edited config.txt to add the attachment as follows. I added at asterix' place.

logo_1
{
mesh "Logo_KAI_KKBW_v3.trainzmesh"
auto-create 1
att "a.l_kai0"
att-parent "body"
}
logo_2
{
mesh "Logo_KAI_KKBW_v3.trainzmesh"
auto-create 1
att "a.l_kai1"
att-parent "body"
}


But when I tried to submit to Trainz, Trainz immediately closed without any warning at all.
When Trainz was reopened, config.sys was still config.chump.

When I try to delete the image and FBX from the Trainz' folder, it run well.
So I think it was because attachment mesh image.

Can anyone help?
 
You don't need mesh-detail-level-count as you not using mesh table LOD. The mesh-table-lod-transition-distances only needs one value which is the distance the traincar stops being rendered. You could use something like 5000 or 10000.

The two logo mesh containers look ok to me.

Are you using a plain text editor such as Notepad or Context? I cut and pasted your segment of the config into my editor and there was a question mark at the end of each line that I think that indicates a non visible character. If that is present in your config then Trainz would not like that at all and may be the reason for the crash.
 
You don't need mesh-detail-level-count as you not using mesh table LOD. The mesh-table-lod-transition-distances only needs one value which is the distance the traincar stops being rendered. You could use something like 5000 or 10000.

The two logo mesh containers look ok to me.

Are you using a plain text editor such as Notepad or Context? I cut and pasted your segment of the config into my editor and there was a question mark at the end of each line that I think that indicates a non visible character. If that is present in your config then Trainz would not like that at all and may be the reason for the crash.
For config.txt I use Notepad only . And if this config was look good, maybe it is because FBX and PNG file ?

Logo mesh container created on 1 face planar mesh, BSDF nodes and an image which have transparent color. Blender result iis OK in shading menu.
Send logo.fbx into asset folder but Trainz close immediately. When re-run, it will rebuild the database and the asset "open for edit" ...
 
I've been using FBX and PNG formatted textures since TANE so I don't see why that would cause such errors. I have noticed that when committing an asset that has a fault then Trainz will often leave the asset in an editing folder with a config.chump rather than a config.txt. That doesn't concern me since I nearly always work from a project folder outside Trainz. i.e. I just drag an "export" folder onto CM.

If I find time today I'll try and recreate what you are doing with one of my test locos to confirm that the mesh-table arrangement works.
 
Your mesh is mostly square and is tilted slightly on the Y axis. But the UV mapping is an oblong and appears to be twice the width of the mesh and that results in the logo being compressed in the Y axis. The face normals are pointing in the plus X axis and pointing slightly downwards due to the tilt. I suspect they may be pointing in the wrong direction but that may be due to the target model.

The image size is a non standard Trainz texture size at 5126 wide by 2160 high. You will need to do some image manipulation to get it to an acceptable size. See https://online.ts2009.com/mediaWiki/index.php/Textures#Texture_Size. That will probably cause some of those straight edges to be "saw toothed".

I see you are trying to use a PBRMetal material but you didn't include the parameter or normal images. Otherwise the Blender model looks ok. If the logo is intended to be oblong then I'd probably make the mesh the same shape.

HTH
 
The image size is a non standard Trainz texture size at 5126 wide by 2160 high.
I see you are trying to use a PBRMetal material but you didn't include the parameter or normal images.
Dear Paul,
1. After thinking to what you wrote, it turns out that this is because the image size should be square. Now I had succeed to convert to trainz without errors and warning again.
2. I use wall's parameter and normal map. I only put the image over the body.
3. Thanks for your analyze and guide.

I need to next step for this asset.
Cheer....
 
I see you are trying to use a PBRMetal material but you didn't include the parameter or normal images. Otherwise the Blender model looks ok. If the logo is intended to be oblong then I'd probably make the mesh the same shape.

HTH
With the pbrmetal, I got background white for the logo. But with pbrmetalmasked, the logo had already transparent as what I want.

Now my new problem is :
Why is the logo displayed correctly on the left and front sides but only dimmed on the right and back sides ?
The position and tilt are correct. The only problem is the brightness of the logo on right and back sides.

For information, my mesh is only rectangle mesh (not a box) and I set image and UV are in one side only.
 
My guess would be the environment lighting. Preview Asset doesn't allow the rotation of environment lighting although you can mostly do that in game using the time of day. A bit harder with traincars given they are aligned with a track.
 
My guess would be the environment lighting. Preview Asset doesn't allow the rotation of environment lighting although you can mostly do that in game using the time of day. A bit harder with traincars given they are aligned with a track.
I didn't expect it to be due to the lighting factor (sunlight) in the game.
In the morning it appears on the left side. In the afternoon it appears on the right side and during the day, both sides do not display the logo.

Do you have any suggestions for a solution?
Maybe this was came from Blender ?
 
Back
Top