Source Filmmaker

Source Filmmaker

Not enough ratings
Converting Binary DMX files to Readable and Editable ASCII Text Files (and Back Again)
By Pte Jack
When working with DMX files, there may be instances where you need to convert a "generated" Binary format DMX into a readable and editable text file or a text formatted DMX into a Binary format.

Rather than worry about WHAT format you require or trying to figure out how to convert the format after receiving a FORMAT ERROR , this guide will show you how to use the Valve included Command Prompt program "DMXConvert.exe" to switch back and forth between the 2 formats.

You can click on the pictures to enlarge them for better viewing.
   
Award
Favorite
Favorited
Unfavorite
Cover...
Formats and Why Should I Worry About It.
So here are the 2 formats being covered in this document,

the Binary (Machine Friendly Code) Format


and the Tex... Yes TEX (User Friendly Code) Format

As you can see there is a huge difference. One you can read and if you've taken a crash course in DME programming, you can easily edit the various elements of the file in a text editor. The other, is machine code and in order to edit it, you have to be well versed in Hex and use a Hex Editor to change anything.

Where you may have to switch between the 2 formats is when using 3rd party tools that can import DMX files, such as Blender, IpiSoft, and others. Some of these tools require the format be one or the other.

This is just an example, as I believe that Blender Source Tools and SFM now support both formats for import. But at one time they didn't.

So you've been working away at a taunt and have exported the animation as a DMX file using the Export Animation or Taunt function of SFM. As you press the OK button, SFM burps out a DMX and immediately crashes. You have no idea if the DMX is good, or if it's corrupted and you want to check it out in Blender and maybe finish tweaking it there.

You launch Blender and use it to import the DMX file and it complains about the format. So you try to load the DMX back into a new session of SFM and SFM crashes immediately, so for some reason you can't import the DMX and use the SFM tools to convert the file to a format usable by Blender.

NO Problem... Use DMXConvert to do the job for you.

The Conversion Process
I'm using Windows 10 here, but the process of launching a Windows Command Prompt window hasn't changed much since I believe Vista (maybe even XP, I can't remember).

It is important that you open an Administrator (also known as an Elevated) Command Prompt to avoid permissions issues when working with files.

If you Right Click on the Windows Start Icon on the bottom Left of the TaskBar, you should be presented with a menu. Locate Command Prompt (Admin) and click it. For those that have the UAC set, you'll receive a confirmation prompt to start the program. Select OK and the Command Prompt window will open.

For those that are not seeing a menu or the Command Prompt(Admin) option following the process above, Open a Windows File Explorer Session and navigate to C:\Windows\System32. Locate cmd.exe and right click on it. Choose Run As Administrator. Say OK to the UAC prompt if it appears.


If you want to save typing and haven't already done so, open a Windows File Explorer session and navigate to your Sourcefilmmaker\game\bin folder and set your screen up so you can pop back and forth between the explorer session and your Command Prompt session.

Now in the Command Prompt window type CD {with a space after it} then pop over to your Windows File explorer session and select the Path Line (it should turn into a normal path statement), select the entire path and right click on it then select copy. Pop back into the Command prompt window and right click the window and select paste, then hit enter.

OR
In the command Prompt window Type
CD {then the path to your Sourcefilmmaker\game\bin folder} and press enter

This makes the bin folder the active folder in the command window.

You now have to determine what format your current DMX file is in. Try to open it in a text editor. If it opens and you can read it, It's in TEX format; if it doesn't open and crashes your text editor or opens and is full of a bunch of NULL and weird symbols, it's in Binary Format (Refer to the Format type pictures above if you're not sure.)

The syntax for the command line is
dmxconvert -i <input "path\filename.dmx"> [-ie <input encoding hint (Binary or TEX)>] [-o <output "path\filename.dmx">] [-of <output format (TEX or Binary)>]

The entire command syntax is typed out on the command line and wraps at the end of the available line without pressing Enter until it is completely typed out

So assuming I had a Binary DMX file sitting in my C:\Program Files (x86)\Steam\steamapps\common\SourceFilmmaker\game\usermod\elements\MyTaunts folder called wiggle butt.dmx and I wanted to change that to a TEX Format and place it on my desktop, my command line would look like this:

dmxconvert -i "C:\Program Files (x86)\Steam\steamapps\common\SourceFilmmaker\game\usermod\elements\MyTaunts\wiggle butt.dmx" -ie binary -o "C:\Users\PteJack\Desktop\wiggle Butt_tex.dmx" -of tex

Notice the Quotation marks around the Path and Filename here, these are extremely important if you have spaces in the path or the filename.

If the Original DMX was in TEX format and I wanted to convert it to Binary format, the command line would be

dmxconvert -i "C:\Program Files (x86)\Steam\steamapps\common\SourceFilmmaker\game\usermod\elements\MyTaunts\wiggle butt.dmx" -ie tex -o "C:\Users\PteJack\Desktop\wiggle Butt_tex.dmx" -of binary


And there you have it..... You're now able to switch format's and avoid Format Errors in your programs.

By the way, if you just type dmxconvert in the command line, you'll get this help screen.


Because of lack of documentation, I do not know what the other functions do... {yet!}

8 Comments
Pte Jack  [author] Feb 9, 2021 @ 12:16pm 
Then you did not write the command line properly.
$ерж Feb 9, 2021 @ 11:19am 
Dont work ( dmxconvert.exe stop working) crash
Pte Jack  [author] Jan 17, 2021 @ 10:27pm 
Thaks Foxhound, this is good to know. I might be able to use it.
PabloSan Jan 17, 2021 @ 7:35pm 
Hello Private Jack! i wanna share with you all this ive learned with Particles PCF Files ive been able to decompile and recompile sucessfully.. and in case someone interested/need this is how to

Decompile
dmxconvert -i "myparticle.pcf" -ie binary -o "mydecompiledpcf.txt" -oe keyvalues2 -of tex
Compile
dmxconvert -i "mydecompiledpcf.txt" -ie tex -o "myrecompiled.pcf" -oe binary -of pcf


TIP : Remember Always use full path between the "" :steamthumbsup: hope you like it..
Pte Jack  [author] Sep 25, 2020 @ 12:59pm 
Make sure the TEX version file extension is .DMX and try that again, If that doesn't work, try taking it back to Binary and try to load that.

OR there maybe something wrong in the animation itself. Artfunkle just updated (like 10 minutes ago) the BleST Master on GITHUB to take care of another animation problem. It may be related. If converting back to binary doesn't work download the GITHUB version and replace the io_scene_valvesource folder in your Appdata\Blender Foundation\Blender\2.90 folder with the one found in the downloaded zip file. Re-export the animation as a DMX and try that.
NoodleCollie Apr 19, 2020 @ 8:45am 
Tips for anyone looking to do this with SteamVR tools, eg. reading Source 2 Hammer map source files:

- If you hold shift and right click on the blank background space within the Windows File Explorer, you will see an item within the menu labelled "Open command window here", or "Open PowerShell window here". This is an easier way to get a command prompt up, and the prompt will start out located at the folder you had open.
- For the SteamVR version of dmxconvert.exe, instead of using "-of tex" I had to use "-oe keyvalues2" to view Hammer files as text.
horologium Jan 31, 2017 @ 2:50pm 
Thank you!
xdshot Nov 10, 2015 @ 2:20am 
Thanks for the guide! It's really useful!