Dmxconvert

From Valve Developer Community
Jump to: navigation, search

DMXconvert is a command-line SDK tool which converts DMX files. It can be found in all Source 2013 Source 2013 games, Counter-Strike: Global Offensive Counter-Strike: Global Offensive Authoring Tools , Left 4 Dead 2 Left 4 Dead 2 Authoring Tools , Source Filmmaker Source Filmmaker , as well as in various Source 2 Source 2 Workshop Tools.

An example usage is: converting regular DMX files using "encoding binary 3 format model 15" into others, such as plain text "encoding keyvalues2 1 format dmx 15".
This new Keyvalues 2 DMX 15 version could then be used in Blender Source Tools advanced Flex properties tab to copy the face flex rules from.

Usage

 dmxconvert -i <in file> [-ie <in encoding hint>] [-o <out file>] [-oe <out encoding>] [-of <out format>]

If no output file is specified, dmx to dmx conversion will overwrite the input
Source 2: -r argument does a recursive search if the in file specifies wildcards
Source 2: -upconvert will auto-check out the files. If -i is not specified, it will operate on all DMX files}}

Supported DMX file encodings:

  • keyvalues
  • keyvalues2
  • keyvalues2_flat
  • keyvalues2_noids Source 2
  • binary
  • binary_seqids Source 2
  • actbusy
  • commentary
  • entitylayer (not in Source 2, Counter-Strike: Global Offensive)
  • vmt
  • vmf (not in Source 2)
  • mks (in all games since Counter-Strike: Global Offensive)
  • tex_source1 (in all games since Counter-Strike: Global Offensive)

Supported DMX file formats:

  • dmx
  • movieobjects
  • sfm
  • sfm_settings (in all games since Counter-Strike: Global Offensive)
  • sfm_session
  • sfm_trackgroup
  • pcf
  • gui
  • schema
  • preset
  • facial_animation
  • model
  • ved
  • mks (in all games since Counter-Strike: Global Offensive) (not in Source 2)
  • vmks Source
  • mp_preprocess
  • mp_root
  • mp_model
  • mp_anim
  • mp_physics
  • mp_hitbox
  • mp_materialgroup
  • mp_keyvalues
  • mp_eyes
  • mp_bonemask
  • tex (in all games since Counter-Strike: Global Offensive) (not in Source 2)
  • vtex Source 2
  • world (in all games since Counter-Strike: Global Offensive)
  • worldnode (in all games since Counter-Strike: Global Offensive)
  • virtualvolumetexture Source 2
  • vmap Source 2
  • vanim Source 2
  • animflags Source 2

Simple Drag and Drop bat file

As is the case with many Command-Line only tools, usage might be confusing. So here is a simple Drag and Drop .bat file script which automatically converts whatever DMX you drop into the bat into a Keyvalues 2 DMX 15 version, creating a new DMX file with the _Keyvalues2 suffix.

::Game location that has the DMXconvert you want to use. Just main game folder.
SET Game_path=d:\programme\steam\steamapps\common\left 4 dead 2
::Don't change anything below here
"%Game_path%\bin\dmxconvert.exe" -i %1 -of dmx -oe keyvalues2 -o "%~dpn1_Keyvalues2.dmx"

Converting particles

Porting Particles from new games to old games (Csgo to Hl2) requires you to convert the pcf type.
As example, Counter-Strike: Global Offensive Counter-Strike: Global Offensive "Binary 5 PCF 2" to Half-Life 2 Half-Life 2 "Binary 2 PCF 1".

Note.pngNote:If you do not want to use DMXConvert, you can use Sparc

It is a unitasker specifically made to convert PCF files. It creates folders with converted files wherever the .exe is located.

However, the drag-and drop bat file is a simpler version, where you can drag a pcf onto it, no matter where it is, and have the pcf be replaced with the version you want.
Warning.pngWarning:New games will have particle functions such as Scalar Random that old games do not have. In those cases you can try editing the particle to use simillar functions.

You must use the new game's DMXConvert to turn the particle to raw text file. (DMX/PCF Keyvalues2)
Once that is done, the old game's DMXConvert can turn that raw text into the desired Binary and PCF version.

Save this bat file on your pc, and set the "dmxconv_from" and "dmxconv_to" values.
Then drag and drop your particle onto this bat file. It will convert to Keyvalues 2, wait five seconds and to convert to Binary 2 PCF 1 and then close automatically.

SET dmxconv_from=F:\Programme\SteamLibrary\steamapps\common\Counter-Strike Global Offensive
SET dmxconv_to=F:\Programme\SteamLibrary\steamapps\common\Half-Life 2
::Don't change anything below here
"%dmxconv_from%\bin\dmxconvert.exe"	-i %1 -of pcf -oe keyvalues2 
timeout 5
"%dmxconv_to%\bin\dmxconvert.exe"	-i %1 -of pcf -oe binary