MDLC: Difference between revisions
(→Download MDLC: LINK POWAH!) |
|||
(12 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
MDLC is a MDL conversion program used to convert .bmp files into the .mdl format. MDL files are image files used by Allegiance for user interface items. | MDLC is a [[MDL]] conversion program used to convert .bmp files into the .mdl format. MDL files are image files used by Allegiance for user interface items. | ||
===How do I edit .mdl files using MDLC?=== | ===How do I edit .mdl files using MDLC?=== | ||
Line 15: | Line 15: | ||
===Notes=== | ===Notes=== | ||
Advanced users can skip using mdlcMasterBat.exe by simply editing the batch file titled "convert" that is provided with MDLC.exe or by creating their own batch file. mdlcMasterBat.exe was just created to save some time. | Advanced users can skip using mdlcMasterBat.exe by simply editing the batch file titled "convert" that is provided with MDLC.exe or by creating their own batch file. mdlcMasterBat.exe was just created to save some time. | ||
MDLC uses lower case letters only. | |||
If you convert a file MyImage.bmp into MyImagebmp.mdl, the file name stored within the bmp.mdl will be myimagebmp, when allegiance finds it has loaded "myimagebmp" instead of "MyImagebmp" it may well crash! | |||
Manually editing the bmp.mdl may allow you to fix it, though that may depend on how allegiance handles file names internally. | |||
If you experience any problems, please make a post in the Helpline Forum and tell us at what step the problem occurred. | If you experience any problems, please make a post in the Helpline Forum and tell us at what step the problem occurred. | ||
==mdlc.exe command line functions== | ==mdlc.exe command line functions== | ||
=== | The MDL compiler offers a numbers of features, each with its own syntax. Here's a list of accepted MDLC syntaxes: | ||
=== ASCII to binary === | |||
<pre>mdlc -convert input output.mdl</pre> | |||
;{{tt|-convert}} | |||
: converts ASCII .mdl to binary .mdl | |||
;{{tt|input}} | |||
: source filename without .mdl ending | |||
;{{tt|output.mdl}} | |||
: destination filename '''with''' .mdl ending | |||
=== Optimize a 3D model === | |||
<pre>mdlc -optimize inputfile outputfile</pre> | |||
;{{tt|-optimize}} | |||
:optimize 3d-models in .mdl-format. Removes diffuse/specular/emissive color information and consolidates texture information. Precalculates certain transforms, etc... in one word: optimizes. | |||
;{{tt|input}} | |||
:the file (stripped of its .mdl extension) to optimize | |||
;{{tt|output}} | |||
:destination filename, without .mdl ending | |||
This converts a 3d model in .x format and a text.mdl into a compressed binary 3d model. Also supports multiple versions of the 3d model with varying levels of detail (LOD). | |||
the "inputfile" text.mdl in its simplest form looks like | the "inputfile" text.mdl in its simplest form looks like | ||
Line 36: | Line 55: | ||
object = ImportXFile("name.x", frame); | object = ImportXFile("name.x", frame); | ||
Where | Where '''name.x''' is the name of your model. As the .x format allows animation but .mdl does not, you must also specify which frame within the animation a "snapshot" of the model should be taken to be used as the un-animated model in the .mdl. Do this by replacing '''initialFrame''' with the index of the frame you want to use (usually 1). | ||
To use LOD you need multiple input.x models and a text .mdl that looks something like | To use LOD you need multiple input.x models and a text .mdl that looks something like | ||
Line 55: | Line 74: | ||
Where "name.x" is the highest quality model, "lowest.x" is the lowest quality model, "low.x" is of higher quality than lowest, and "medium.x" is a medium quality model. | Where "name.x" is the highest quality model, "lowest.x" is the lowest quality model, "low.x" is of higher quality than lowest, and "medium.x" is a medium quality model. | ||
Which one gets used in game is a function of how far the player's camera is from the model (further away the lower the quality of the model). | Which one gets used in game is a function of how far the player's camera is from the model (further away the lower the quality of the model). The numbers next to each LOD entry (64, 32, 8), define the on-screen radius (pixels) at which the LOD level will be used. | ||
Note | {{Note| mdlc can be quite fussy about the format of a .x file and often doesn't work with perfectly valid ones, this is probably due to the fact it was written for use with whatever .x exporter the original ms developers were using, so it wasn't made flexible enough to handle .x files form other exporters (including tools in the directX SDK!). | ||
If you have trouble getting it to convert a .x file, try comparing your .x file to one of the original ones in the artwork source. | If you have trouble getting it to convert a .x file, try comparing your .x file to one of the original ones in the artwork source. | ||
Also note that when the original art was converted, there was some pre-processing using the [xmunge], [xtobm], [fmesh], [meshsimp], [rlines], [pmtopmx] and [pmxtox.] tools. | Also note that when the original art was converted, there was some pre-processing using the [xmunge], [xtobm], [fmesh], [meshsimp], [rlines], [pmtopmx] and [pmxtox.] tools.}} | ||
=== Compress animated image === | |||
<pre>mdlc -compressanim xframes yframes input output</pre> | |||
;{{tt|-compressanim}} | |||
: applies a form of RLE (Run Length Encoding) to an animation (presumably a .bmp with the frames stored side-by-side in rows and columns). | |||
;{{tt|xframes}} | |||
: the number of animation frames in one row | |||
;{{tt|yframes}} | |||
: the number of animation frames in one column | |||
;{{tt|input}} | |||
: the filename of the .bmp to compress | |||
;{{tt|output}} | |||
: the destination filename, without the .mdl extension | |||
===Compress a text font definition file into a binary font definition file=== | === Convert .bmp to bmp.mdl === | ||
<pre>mdlc -convert inputfile.bmp outputfilebmp.mdl</pre> | |||
;{{tt|-convert}} | |||
: converts a .bmp to bmp.mdl | |||
;{{tt|input}} | |||
: filename of source bitmap | |||
;{{tt|output}} | |||
: destination filename (with .mdl ending) | |||
=== 3D model info === | |||
<pre>mdlc -info input</pre> | |||
;{{tt|-info}} | |||
: prints some information about the model (how many triangles each LOD has) | |||
;{{tt|input}} | |||
: the name of a .mdl-file (without .mdl-ending) describing a 3d-model with level-of-detail information. | |||
=== Generate c++ header code === | |||
<pre>mdlc -genheader input output</pre> | |||
;{{tt|genheader}} | |||
: Generates c++ code for handling any structs defined in a .mdl-file. | |||
;{{tt|input}} | |||
: the .mdl (without .mdl-ending) that contains struct definitions. | |||
;{{tt|output}} | |||
: filename for writing the code to | |||
=== Compress a text font definition file into a binary font definition file === | |||
<pre>mdlc fontsource.mdl [[font.mdl]]</pre> | |||
This is mainly for modifying font.mdl | This is mainly for modifying font.mdl | ||
Takes a input text .mdl containing font definitions and produces a compressed binary .mdl containing font definitions '''and their glyphs'''. This means you can use non-standard fonts which you have on your system and have them included in the output .mdl so you can distribute it without the need for people to install the non-standard fonts you have used. | Takes a input text .mdl containing font definitions and produces a compressed binary .mdl containing font definitions '''and their glyphs'''. This means you can use non-standard fonts which you have on your system and have them included in the output .mdl so you can distribute it without the need for people to install the non-standard fonts you have used. | ||
where fontsource.mdl is of the form: | where fontsource.mdl is of the form: | ||
Line 73: | Line 128: | ||
use "model"; | use "model"; | ||
smallFont = Win32Font("Verdana", 12, false, 0); | smallFont = [[Modifying the User Interface#Win32Font|Win32Font]]("Verdana", 12, false, 0); | ||
smallBoldFont = Win32Font("Verdana", 12, true, 0); | smallBoldFont = Win32Font("Verdana", 12, true, 0); | ||
Line 94: | Line 149: | ||
smEuro = Win32Font("Eurostile", 10, false, 0); | smEuro = Win32Font("Eurostile", 10, false, 0); | ||
myfont = Win32Font("myfonthere", size, computed bold true/false, | myfont = Win32Font("myfonthere", size, computed bold true/false,stretch number); | ||
==Download MDLC== | ==Download MDLC== | ||
You can download MDLC [http:// | You can download MDLC [http://www.mages-tower.com/alleg/mdlc/mdlc.zip here] | ||
==Download MdlThing== | |||
MdlThing is the replacement for mdlcMasterBat available [http://code.google.com/p/mdlthing/ here] | |||
[[Category:Artwork Development]] | |||
[[Category:Guides]] | |||
[[Category:Utilities]] | |||
[[Category:MDL]] |
Latest revision as of 07:35, 19 March 2012
MDLC is a MDL conversion program used to convert .bmp files into the .mdl format. MDL files are image files used by Allegiance for user interface items.
How do I edit .mdl files using MDLC?
- First, export the image that you want to edit using MDLUtility. When you export the image, remove the "bmp" off of the end of the name. *THIS IS IMPORTANT*
- Edit the file using mspaint or your favorite image editor. Make sure to keep it in the bmp format though.
- Copy your finished image into the folder where you extracted MDLC.exe
- Run mdlcMasterBat.exe, click "Select Files".
- Note that you can select more than once file.
- Click "Open" once you have selected the files that you want to import. Now click "Run Batch".
- Take the .mdl files that MDLC.exe created and copy them into your artwork folder.
Screenshots
Notes
Advanced users can skip using mdlcMasterBat.exe by simply editing the batch file titled "convert" that is provided with MDLC.exe or by creating their own batch file. mdlcMasterBat.exe was just created to save some time.
MDLC uses lower case letters only.
If you convert a file MyImage.bmp into MyImagebmp.mdl, the file name stored within the bmp.mdl will be myimagebmp, when allegiance finds it has loaded "myimagebmp" instead of "MyImagebmp" it may well crash!
Manually editing the bmp.mdl may allow you to fix it, though that may depend on how allegiance handles file names internally.
If you experience any problems, please make a post in the Helpline Forum and tell us at what step the problem occurred.
mdlc.exe command line functions
The MDL compiler offers a numbers of features, each with its own syntax. Here's a list of accepted MDLC syntaxes:
ASCII to binary
mdlc -convert input output.mdl
- -convert
- converts ASCII .mdl to binary .mdl
- input
- source filename without .mdl ending
- output.mdl
- destination filename with .mdl ending
Optimize a 3D model
mdlc -optimize inputfile outputfile
- -optimize
- optimize 3d-models in .mdl-format. Removes diffuse/specular/emissive color information and consolidates texture information. Precalculates certain transforms, etc... in one word: optimizes.
- input
- the file (stripped of its .mdl extension) to optimize
- output
- destination filename, without .mdl ending
This converts a 3d model in .x format and a text.mdl into a compressed binary 3d model. Also supports multiple versions of the 3d model with varying levels of detail (LOD).
the "inputfile" text.mdl in its simplest form looks like
use "effect"; frame = ModifiableNumber(initialFrame); object = ImportXFile("name.x", frame);
Where name.x is the name of your model. As the .x format allows animation but .mdl does not, you must also specify which frame within the animation a "snapshot" of the model should be taken to be used as the un-animated model in the .mdl. Do this by replacing initialFrame with the index of the frame you want to use (usually 1).
To use LOD you need multiple input.x models and a text .mdl that looks something like
use "effect"; frame = ModifiableNumber(initialFrame); object = LODGeo( ImportXFile("name.x", frame), [ ( 64, ImportXFile("lowest", frame)), ( 32, ImportXFile("low", frame)), ( 8, ImportXFile("medium", frame)) ] );
Where "name.x" is the highest quality model, "lowest.x" is the lowest quality model, "low.x" is of higher quality than lowest, and "medium.x" is a medium quality model. Which one gets used in game is a function of how far the player's camera is from the model (further away the lower the quality of the model). The numbers next to each LOD entry (64, 32, 8), define the on-screen radius (pixels) at which the LOD level will be used.
Note mdlc can be quite fussy about the format of a .x file and often doesn't work with perfectly valid ones, this is probably due to the fact it was written for use with whatever .x exporter the original ms developers were using, so it wasn't made flexible enough to handle .x files form other exporters (including tools in the directX SDK!). If you have trouble getting it to convert a .x file, try comparing your .x file to one of the original ones in the artwork source. Also note that when the original art was converted, there was some pre-processing using the [xmunge], [xtobm], [fmesh], [meshsimp], [rlines], [pmtopmx] and [pmxtox.] tools.
Compress animated image
mdlc -compressanim xframes yframes input output
- -compressanim
- applies a form of RLE (Run Length Encoding) to an animation (presumably a .bmp with the frames stored side-by-side in rows and columns).
- xframes
- the number of animation frames in one row
- yframes
- the number of animation frames in one column
- input
- the filename of the .bmp to compress
- output
- the destination filename, without the .mdl extension
Convert .bmp to bmp.mdl
mdlc -convert inputfile.bmp outputfilebmp.mdl
- -convert
- converts a .bmp to bmp.mdl
- input
- filename of source bitmap
- output
- destination filename (with .mdl ending)
3D model info
mdlc -info input
- -info
- prints some information about the model (how many triangles each LOD has)
- input
- the name of a .mdl-file (without .mdl-ending) describing a 3d-model with level-of-detail information.
Generate c++ header code
mdlc -genheader input output
- genheader
- Generates c++ code for handling any structs defined in a .mdl-file.
- input
- the .mdl (without .mdl-ending) that contains struct definitions.
- output
- filename for writing the code to
Compress a text font definition file into a binary font definition file
mdlc fontsource.mdl [[font.mdl]]
This is mainly for modifying font.mdl Takes a input text .mdl containing font definitions and produces a compressed binary .mdl containing font definitions and their glyphs. This means you can use non-standard fonts which you have on your system and have them included in the output .mdl so you can distribute it without the need for people to install the non-standard fonts you have used.
where fontsource.mdl is of the form:
use "model"; smallFont = Win32Font("Verdana", 12, false, 0); smallBoldFont = Win32Font("Verdana", 12, true, 0); largeFont = Win32Font("Verdana", 15, false, 0); largeBoldFont = Win32Font("Verdana", 15, true, 0); hugeFont = Win32Font("Verdana", 24, false, 0); hugeBoldFont = Win32Font("Verdana", 24, true, 0); smVerdana = Win32Font("Verdana", 10, false, 0); medVerdana = Win32Font("Verdana", 12, false, 0); medBoldVerdana = Win32Font("Verdana Bold", 13, false, 0); lgBoldVerdana = Win32Font("Verdana Bold", 16, false, 0); smTahoma = Win32Font("tahoma", 12, false, 0); titleFont = Win32Font("Eurostile Bold", 18, false, 10); promptFont = Win32Font("Eurostile Bold", 12, false, 6); smEuro = Win32Font("Eurostile", 10, false, 0); myfont = Win32Font("myfonthere", size, computed bold true/false,stretch number);
Download MDLC
You can download MDLC here
Download MdlThing
MdlThing is the replacement for mdlcMasterBat available here