Skip to content

Support Source 2 DMX Formats #40

@JanEricNitschke

Description

@JanEricNitschke

Hi,

i am trying to parse dmx files from CS2 that i get from Source2Viewer-CLI. I assume that is just currently not supported?

$ python dmx_test.py
Traceback (most recent call last):
  File "D:\CSGO\ML\csgo\dmx_test.py", line 5, in <module>
    print(Element.parse(f))
          ^^^^^^^^^^^^^^^^
  File "C:\Users\Jan-Eric\AppData\Local\Programs\Python\Python311\Lib\site-packages\srctools\dmx.py", line 1321, in parse
    result = cls.parse_bin(file, enc_vers, unicode)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Jan-Eric\AppData\Local\Programs\Python\Python311\Lib\site-packages\srctools\dmx.py", line 1367, in parse_bin
    el_type = stringdb[ind]
              ~~~~~~~~^^^^^




from srctools.dmx import Element
from pathlib import Path

with Path('world_physics_hull.dmx').open('rb') as f:
    print(Element.parse(f))


world_physics_hull.dmx

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions