Route Riter source code
#51
Posted 21 March 2023 - 02:53 PM
#52
Posted 28 March 2023 - 12:19 AM
scottb613, on 20 March 2023 - 03:53 AM, said:
If anyone comes across the code in RR on how it's used to covert ACE to BMP - I'd appreciate it - been looking for a way to do this via the command line - for a long time. Obviously - RR figured this out and must be using some external tool.
Regards,
Scott
I have C routines for reading ace files and I've found some C routines for writing bmp files. If you are happy with C and can let me know exactly what you need, I should be able to package them togeather.
#53
Posted 28 March 2023 - 04:46 AM
David Webb, on 28 March 2023 - 12:19 AM, said:
Hi David,
Just a quick summary.
I made a tool - Bash - to support my TERRTEX painting in TSRE. When TSRE saves a "painted" tile - it doesn't create any MipMaps. So you get Moire - especially if you have parallel lines such as crops painted on the texture. You need to add MipMaps somehow.
I prefer to work with DDS - so I use NVidia NVDXT to convert my TERRTEX to DDS and add MipMaps at the same time. The issue is I can't feed ACE files into NVDXT. Route Riter has an ACE to TGA routine - which doesn't seem to work anymore. Fortunately - Route Riter - ACE to BMP does work. Every time I run my script I have to manually launch Route Riter to perform the graphic conversion - not a huge deal - just a chore when you take the time to script everything.
I had thought Route Riter had been using some external tool to do this conversion - that I could tap into. I'm familiar with TS Utils and I don't think it performs any graphics conversions.
Ideally - I just need a command line tool to call - that takes a "source ACE" and "destination BMP/TGA" argument - individual files or whole directories would be helpful. TGA or BMP would be fine - any lossless graphical file format.
That said - it's probably not worth your time and effort for custom coding. It's a small inconvenience and your work probably wouldn't benefit anyone but me. I GREATLY appreciate your interest and generous offer - though.
:sign_thanks:
If curious - here's my full Bash script:
CreateDDS.zip (1.39K)
Number of downloads: 6
Regards,
Scott
#54
Posted 28 March 2023 - 05:13 AM
#55
Posted 28 March 2023 - 05:23 AM
pwillard, on 28 March 2023 - 05:13 AM, said:
Hi Pete,
LOL - I'm sure it would be nice - as it would be for all our tools - but this is a pretty insignificant hurdle for me. I only run the script a couple times a night - at most - when I'm painting TERRTEX.
:)
Regards,
Scott
#56
Posted 28 March 2023 - 07:47 AM
Weter, on 28 March 2023 - 07:15 AM, said:
For reverse conversion make ace/AceIt is needed.
Hi Weter,
"TGATool2A.exe" has a Command Line Interface (CLI)? I don't see a "help file" with it - and I don't recall seeing any reference for it? I don't need compression.
I'm familiar with AceIt (CLI) and use it all the time:
Quote
Syntax:
aceit.exe <input file> [output file] [options]
Input File
As with the standard interface, the input file must be an image of any of the following types:
Kuju ACE (*.ace)
Direct Draw Surface (*.dds)
Truevision Targa (*.tga)
Joint Photographic Experts Group (*.jpg)
MS-Windows Bitmap (*.bmp)
Device-Independent Bitmap (*.dib)
Tag Image File (*.tif)
Portable Network Graphics (*.png)
Portable Pixmap (*.ppm)
The input file can be a local file, or can be specified with either a relative or absolute path. Use quotation marks to enclose a path/file that contains spaces.
Output File (optional)
AceIt will only output Kuju ACE files. If a filename is not specified, the output ACE file will be in the same directory as the source file, with the same filename, except with a ".ace" file extension. If you specify a filename without a .ace extension, AceIt will add one. A directory path (without a filename) can also be specified so long as it ends in a backslash. The filename will be the same as the input, except for the extension.
Options (optional)
The options are for contolling the type of the ACE file outputted. If no options are specified, the defaults are used. As with the standard interface, for any input other than an ACE file, AceIt defaults to RGB opaque with ZLib compression. The output will have MIP maps as long as the image is square with dimensions 2n (512, 256, 128, etc.). For ACE file inputs, the output will be the same specifications as the input file, except that ZLib compression will be applied unless explicitly disabled.
The following options are available. They are specified by using a dash or a slash ('-' or '/') in front of the option.
dxt (or d)
This specifies that the output will be in the DXT1 format. This can only be used if the image is square dimensions 2n. If an alpha channel is present on the source, transparency will be applied to the output. You will receive an error if the input image does not meet these criteria. Click here for a more detailed explanation of the DXT1 ACE format. This cannot be used with trans, alpha, or cab.
uncompressed (or u)
This specifies that the output file will be not be ZLib-compressed, which is the default.
trans (or t)
This specifies that the output will be 24-bit RGB color, 1 bit alpha (or 'trans'). Click here for a more detailed explanation of the RGB ACE format. This cannot be specified with alpha or dxt.
alpha (or a)
This specifies that the output will be 24-bit RGB color, 8 bit alpha (or 'alpha'). Click here for a more detailed explanation of the RGB ACE format. This cannot be specified with trans or dxt.
cab (or c)
This specifies that no MIP maps will be added to the output image, like for cab bitmaps. This is always on for non-square, non 2n images. This cannot be specified with dxt.
optimize (or o)
This specifies that a 16-bit dither optimization will be applied to the output file. This cannot be used with the DXT1 format. More info is available in the Other Info section.
quiet (or q)
This specifies that the dialog box that normally appears upon the successful generation of an ACE file will not appear. There will be no notification if the operation is successful. This is useful if another program or script is calling AceIt and you do not wish to receive multiple messages.
filter:<filter> (or f:<filter>)
This is used to specify the filter to use when producing MIP maps. There are three valid parameters for <filter>: box, linear, or point. Use a colon between the option and the parameter, i.e. filter:linear. Explanations of the filter types are available on the standard interface page.
Examples
aceit.exe input.tga output.ace /alpha
This will take input.tga in the calling directory and generate output.ace as a ZLib-compressed RGB with 8-bit alpha ACE file in the calling directory.
aceit.exe input.ace
This will cause AceIt to rebuild input.ace with the same settings. This is useful for correcting ACE files produced by makeace or makeacewin.
aceit.exe "c:\my documents\input.bmp" "c:\my documents\output\" /dxt /quiet /filter:linear
This will generate a ZLib-compressed linear filtered DXT ACE in c:\my documents\output\ by the name of input.ace. It will not display a notification after completion.
AceIt > Usage > Command prompt
Regards,
Scott
#57
Posted 28 March 2023 - 09:14 AM
Where this text was taken from? (I'd like to see, what mentioned there links show)?
Is it from AceIt! Help?
So, it makes Aces only, but not opposite convension possible?
#58
Posted 29 March 2023 - 09:26 AM
scottb613, on 28 March 2023 - 04:46 AM, said:
Just a quick summary.
...
I've generated an 'ace2bmp file_in.ace file_out.bmp' utility and uploaded the code it as a zip file in a new 'ace2bmp' topic. I did this because the code has been developed on a linux computer. I really need feedback to make it more windows compatible and such feedback would only clutter up this topic.
#59
Posted 29 March 2023 - 10:53 AM
#60
Posted 29 March 2023 - 01:54 PM
David Webb, on 29 March 2023 - 09:26 AM, said:
Hi David,
Thanks so much - - - I'll take a look.
:sign_thanks:
Genma Saotome, on 29 March 2023 - 10:53 AM, said:
Hi Dave,
Happy to help.
Yeah - I use scripts to process my models from the initial export - to process all the textures (AceIt and NvDXT) - fix animations (shape file edits) - create individual units (shape file edits) - and copy them to the production environment. It saves a great deal of time when you're doing hundreds or thousands of exports over the development life cycle of a model. I used AceIt before I moved to NvDXT for DDS.
Just a quick example on how you could use AceIt in a "bat" file:
@echo off set "workpath=C:\Users\N63503\Documents\3DCrafter 9.5\MyWork\USRA_Mikado\" set "expath=C:\Users\N63503\Documents\3DCrafter 9.5\MyWork\USRA_Mikado\SCO_USRA_Mikado\" set "ace_exe="E:\MSTS Tools\AceIt\aceit.exe"" REM Make Ace echo Process ACE 2048x "282Prime1" %ace_exe% "%workpath%282Prime1.tga" "%expath%282PRIME1.ace" /Quiet echo Process ACE 2048x "282Prime2" %ace_exe% "%workpath%282Prime2.tga" "%expath%282PRIME2.ace" /Quiet echo Process ACE 1024x "282AlphaCab" %ace_exe% "%workpath%282AlphaCab.tga" "%expath%282ALPHACAB.ace" /Alpha /Quiet
Regards,
Scott