ValvePython / vdf

📜 Package for working with Valve's text and binary KeyValue format
https://pypi.org/project/vdf/
MIT License
165 stars 30 forks source link

Added support for more unquoted characters and inline empty blocks #22

Closed lasa01 closed 3 years ago

lasa01 commented 4 years ago

CSGO has material (.vmt) files that have unquoted keys starting with $.

For example, csgo/materials/grass/hr_grass/grass_a.vmt:

LightmappedGeneric
{
$baseTexture "grass/hr_grass/grass_a"
$bumpmap "grass/hr_grass/grass_a_normals"

}

This fixes the parsing of these files.

lasa01 commented 4 years ago

Moved the changes to the character set and updated the weird unquoted character test case.

Also extended support for other missing characters in unquoted keys and values:

Also added support for inline empty blocks directly after keys, and a corresponding test case, e.g.:

        "Proxies"
        {
            "EntityOrigin" {}
        }

(csgo\materials\models\player\custom_player\econ\head\ctm_fbi\ctm_fbi_v2_head_varianta.vmt)