phonon / blender-vintagestory-json

Blender Vintage Story .json model importer/exporter
MIT License
15 stars 3 forks source link

Importer does not support relaxed .json format VS uses sometimes. #1

Closed Novocain1 closed 3 years ago

Novocain1 commented 3 years ago

If a shape file has objects in the relaxed json format ie, key: "value", the importer will crash.

phonon commented 3 years ago

Post which file is causing issues

Novocain1 commented 3 years ago

block/basic/cube-nozfight.json added to zip since commenting does not support the upload of .json files. cube-nozfight.zip

Here's an example of others:

novocain@DESKTOP-LLPDQ12:/mnt/c/Games/Vintagestory/assets/survival/shapes$ grep -rinHo textures: block/basic/cube-nozfight.json:2:textures: block/basic/invisible.json:2:textures: block/wood/log/section-ne.json:2:textures: block/wood/log/section-nw.json:2:textures: block/wood/log/section-se.json:2:textures: block/wood/log/section-sw.json:2:textures:

phonon commented 3 years ago

Added solution for now to try using simple regex substitution on parse fail to add quotes around unquoted keys, these are detected by just a colon so this solution will fail if any strings contain a colon.