Amabilis Software    3D Canvas Community    3D Canvas Discussion Forums  Hop To Forum Categories  Microsoft Train Simulator    Please Note: Materials attributes have changed as of 3D Canvas 7.1
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Picture of Amabilis Support
Posted
There have been some changes in the MSTS export recently.

The setting of material translucency to indicate if a texture is transparent or translucent is no longer supported.

This has been replaced by a new custom material field "Tx Alpha". This material field is used to indicate if a texture has transparency, translucency or not. Valid values for this field are: Translucency/Transparency/None

A new custom material field "Alpha Pr" is used to indicate the priority of translucency rendering. This is used in the rare case where there are multiple layers of translucency. Setting this field to "1" for the "outside" part of the object will ensure that both layers of translucency look correct.

These fields can be created can be created via File -> Properties -> Custom Fields.

But, a better way is to let the Train Simulator Wizard setup these fields for you. It also converts your materials to the new format. You need not actually export with the Train Simulator Wizard, all you need do is start it and then cancel.
 
Posts: 1412 | Registered: Thu November 06 2003Reply With QuoteEdit or Delete MessageReport This Post
Junior Member
Posted Hide Post
What about the scripting interface, i.e.

object.SetTranslucent 1
 
Posts: 95 | Location: Germany | Registered: Fri November 07 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Amabilis Support
Posted Hide Post
That won't work, but this will:

lngTxAlphaCustomMaterialFieldID = Canvas.GetMaterialCustomFieldID("Tx Alpha")
If lngTxAlphaCustoMaterialFieldID <> -1 Then
Canvas.SetCustomFieldValue lngTxAlphaCustomMaterialFieldID, "Translucency"
Else
'say the field wasn't there
End If
 
Posts: 1412 | Registered: Thu November 06 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Paul Gausden
Posted Hide Post
Alternative coding to create if the field does not already exist:


lngTxAlphaCustomMaterialFieldID = Canvas.GetMaterialCustomFieldID("Tx Alpha")

If lngTxAlphaCustoMaterialFieldID = -1 Then
    lngTxAlphaCustoMaterialFieldID = Canvas.AddMaterialCustomField("Tx Alpha")
Endif

Canvas.SetCustomFieldValue lngTxAlphaCustomMaterialFieldID, "Translucency"

 
Posts: 1057 | Location: Surrey, UK | Registered: Fri November 07 2003Reply With QuoteEdit or Delete MessageReport This Post
Junior Member
Posted Hide Post
Thanks a lot,

I think I got it, and in addition to be a bit more consistent to the provided script examples 2 minor corrections:

lngTxAlphaCustomMaterialFieldID = CanvasApp.GetMaterialCustomFieldID("Tx Alpha")

If lngTxAlphaCustoMaterialFieldID = -1 Then
lngTxAlphaCustoMaterialFieldID = CanvasApp.AddMaterialCustomField("Tx Alpha")
Endif

Material.SetCustomFieldValue lngTxAlphaCustomMaterialFieldID, "Translucency"

This message has been edited. Last edited by: Roman,
 
Posts: 95 | Location: Germany | Registered: Fri November 07 2003Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

Amabilis Software    3D Canvas Community    3D Canvas Discussion Forums  Hop To Forum Categories  Microsoft Train Simulator    Please Note: Materials attributes have changed as of 3D Canvas 7.1

© Amabilis Software 2003-2007