Elvas Tower: Blender 2.8 to MSTS Export Plugin V 4.3 - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Blender 2.8 to MSTS Export Plugin V 4.3 Initial Release Rate Topic: -----

#1 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,345
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 24 July 2019 - 06:58 AM

I have just released Version 4.3 of the MSTS Export Addon for Blender.

USE THIS VERSION OF THE EXPORTER WITH BLENDER VERSION 2.80 AND LATER
See here for Blender 2.79 and earlier.

Here's whats new:

- The exporter now supports Blender 2.8’s new Eevee rendering engine and materials.

- Unfortunately however Blender has discontinued support for Blender Internal materials and face texture methods. This means that any models originally made in 2.79 must be retextured if they are brought into Blender 2.8. Fortunately, the UV maps come in OK, its just the texture assignments that have to be redone. This is not just an MSTS problem but affects all Blender files, so hopefully a solution will emerge in time.

- Another change relates to LODs and part naming. The updated exporter uses Blender’s new ‘collections’ feature to organize the LODs of a model. We no longer have a model named ‘MAIN’. Instead we have a collection named MAIN that contains all the parts we want to export. More detail is provided later in the manual. Models originally made in 2.79 must be reorganized into collections when they are brought into Blender 2.8.

- The DLEVEL, DMIN, DMAX method of assigning LODS is no longer supported in the exporter.

- The Railworks style part naming is no longer supported in the exporter.

- The exporter no longer exports particle systems or bezier curves directly. These must be converted to meshes before export.

- The exporter is 10 to 20 times faster than the previous version

Get the latest version here:
http://www.elvastowe...-export-plugin/


You are welcome to mirror this package to other download libraries. If you do, let me know ( contact info in the Instruction Manual ), and I'll keep you appraised of any updates.



Wayne

#2 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,345
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 25 July 2019 - 10:30 AM

LINKING PARTS TO MULTIPLE LOD COLLECTIONS

A couple of testers have commented that they were having trouble adding a part into more than one LOD. For example, the L1 locomotive sample in the download package, has a WHEELS11 part in MAIN_0700. Its visible to 700m. If you wanted that part to be visible all the way to 2000m, you would add it to the MAIN_2000 LOD ; you have to place the part in both LOD collections. But you cannot copy it to another LOD collection since that will cause a naming conflict and Blender will rename the second copy to WHEELS11.001 This would cause a problem with the automatic animations - the wheel wouldn't rotate. Instead of copying, you want to 'link' the part. Then the exact same object will appear in both LOD collections. Its more efficient for Blender and for your modelling workflow and it avoids any naming conflicts.

To link a part to more than one LOD collection, WHEELS11 for example, click on WHEELS11 and drag to the MAIN_2000 collection, then CTRL drop it there. When you press the CTRL key you will see the word 'Link' pop up under your cursor to let you know you are forming a link. Now you have WHEELS11 in both collections with no naming conflicts. Its picky about the key sequence. Hold left click down on the object, drag to the new collection, press and hold CTRL key, release left click, release CTRL key. ( PS this is not my code, I am just trying to explain it! )

Be aware also that if you are using the outliner to move a part within the hierarchy, you have to use Shift drop. This is all new to Blender 2.8 so its something to get used to.

Here's a summary of Blender 2.8's Outliner operations:

Drag and Drop a part - moves it from one collection to another, eg from MAIN_0700 to MAIN_2000

Drag and CTRL Drop a part - links it into more than one collection, eg MAIN_0700 and MAIN_2000

Drag and SHIFT Drop a part - moves it within the hierarchy, eg parented to BOGIE1 instead of BOGIE2 etc.


Wayne

#3 User is offline   pwillard 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 804
  • Joined: 03-March 08
  • Gender:Male
  • Location:Cumming, Ga
  • Simulator:OpenRails
  • Country:

Posted 01 December 2022 - 07:07 AM

Wayne,

A while back I made a small adjustment to the 4.3 Exporter that would allow the user to change the texture reference in the .S file from .ACE to .DDS at the time of export, saving the need to edit the .S file if you use normally DDS instead of ACE for ORTS. Its a trivial update to the code (my opinion of course) and is really only about 7 additional lines of python code.

To get an idea of the code changes... here are the differences...

LINE 123
> UseDDS = False
Line 199
>         layout.prop( settings, "UseDDS" )
Lines 207,208
>         global UseDDS
>         UseDDS = settings.UseDDS
Line 530
>     UseDDS : BoolProperty(name='Use DDS', description = 'Export Texture type as DDS instead of ACE', default = False )
>
Line 614
<
---
>     if UseDDS==False:
Lines 616,617
>     else:
>         imageName = imageName + '.dds'
>


Note sure if you want to add this feature... but I've tested it and it works for me.




#4 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,345
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 01 December 2022 - 07:30 AM

Thanks for sharing this solution. I have never used DDS. What's the application for this?

#5 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 01 December 2022 - 08:16 AM

Hi Wayne,

Open Rails... DDS is all I use anymore.

:p

It's so nice doing stuff like this - or - saving directly to DDS from your paint program. "NVDXT" is NVidia's command line texture processing tool. Yeah - I should put the texture processing in a loop - I haven't gotten around to it yet...

;)

#Make DDS
	echo ""
	echo "Process [TXT] Default"
	"${NVDXT}" -box -u888 -file "${DOSCVSPATH}\default.tga" -outdir "${DOSEXPPATH}" 
	
	echo ""
	echo "Process [TXT] ExpLink"
	"${NVDXT}" -box -u888 -file "${DOSCVSPATH}\explink.tga" -outdir "${DOSEXPPATH}" 
	
	echo ""
	echo "Process [TXT] Piston"
	"${NVDXT}" -box -u888 -file "${DOSCVSPATH}\Piston.tga" -outdir "${DOSEXPPATH}" 

	echo ""
	echo "Process [TXT] PrimeA"
	"${NVDXT}" -box -u888 -file "${DOSCVSPATH}\PrimeA.tga" -outdir "${DOSEXPPATH}" 
	
	echo ""
	echo "Process [TXT] PrimeB"
	"${NVDXT}" -box -u888 -file "${DOSCVSPATH}\PrimeB.tga" -outdir "${DOSEXPPATH}" 
	
	echo ""
	echo "Process [TXT] PrimeC"
	"${NVDXT}" -box -u888 -file "${DOSCVSPATH}\PrimeC.tga" -outdir "${DOSEXPPATH}" 
	
	echo ""
	echo "Process [TXT] PrimeD"
	"${NVDXT}" -box -u888 -file "${DOSCVSPATH}\PrimeD.tga" -outdir "${DOSEXPPATH}" 
	
	echo ""
	echo "Process [TXT] PrimeE"
	"${NVDXT}" -box -u888 -file "${DOSCVSPATH}\PrimeE.tga" -outdir "${DOSEXPPATH}" 


Regards,
Scott

#6 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,345
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 01 December 2022 - 08:32 AM

I am happy to include this feature in a next version of the exporter. But I still don't really understand. Are you saying you like DDS because there is a command line tool to convert from TGA?

#7 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 01 December 2022 - 08:50 AM

View Postwacampbell, on 01 December 2022 - 08:32 AM, said:

I am happy to include this feature in a next version of the exporter. But I still don't really understand. Are you saying you like DDS because there is a command line tool to convert from TGA?


Hi Wayne,

Sorry - no - for me - that's just an added perk (realizing TGA Tool had a command line option as well) - ORTS fully supports DDS on all textures - it has for years. There used to be an option to "Prefer DDS" in the ORTS menu - I think they removed it in a recent cleanup - but ORTS still prefers DDS if you have both ACE and DDS - for the same file - in the same directory. DDS can be saved directly from most paint programs - instead of using TGA to ACE. It was kind of an industry standard for a while - MS FSX used it. I don't think it's used anymore - I haven't heard much on it lately...

Regards,
Scott

#8 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 01 December 2022 - 10:13 AM

Hi Wayne,

Oh - IIRC - DDS was a NVidia product - so there was thought to be some efficiencies or optimizations built in when used with NVidia hardware. We had a bunch of discussions around here and the results were mixed on performance. I didn't notice much myself either way on performance. The other advantage is you have more options - I think - DDS supports DXT5 - 24bit - and - 32bit color - which I don't think ACE has? It's not a big deal either way whether it's included in the exporter or not - for me - as ACE exports will work just fine with DDS files in ORTS.

Thanks for your patience and all you do.
:)

Regards,
Scott

#9 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,345
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 01 December 2022 - 10:36 AM

Doing some reading, I see DXT5 uses the same 16 bit color as DXT1 - 5 bits for Red, 6 bits for Green and 5 bits for Blue. The advantage of DXT5 is it has an 8 bit alpha channel vs DXT1 which has only a 1 bit alpha channel. But the cost is DXT5 takes double the memory in your GPU and takes double the time to load. So you would want to limit DXT5 use to where the 8 bit alpha channel is actually needed.

So I see your point. DDS can support the DXT5 compression whereas ACE does not ( at least the MSTS version of ACE does not. ACE was extended for Railworks and now supports DXT5 compression also ).

I see in your sample conversion script in post 5 above that your example is using the NVDXT switch -u888. That produces an uncompressed DDS that uses 6 times the GPU memory and takes 6 times longer to load than a DXT1. Again, it has its uses especially for feature models, but it seems like if every shape file used uncompressed textures OpenRails would drag to a halt.

I agree that DDS support is good and will include it in a future version of the exporter. Thanks again for providing the code for it - it makes my job easy.

Wayne

#10 User is offline   scottb613 

  • Vice President
  • Group: Status: First Class
  • Posts: 2,973
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted 01 December 2022 - 10:48 AM

View Postwacampbell, on 01 December 2022 - 10:36 AM, said:

Wayne


Hi Wayne,

Here's the command reference on NVDXT if you need it.

Attached File  nvDXT.pdf (167.11K)
Number of downloads: 11

:)

Location to download NVDXT: https://developer.nv...y-texture-tools

Regards,
Scott

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users