Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Bug: Hammer Material Browser crashes instantly when encountering VMT files with unquoted paths

Open vengefulcrop opened this issue 9 months ago • 4 comments

Describe the bug

If you have a VMT file where texture paths do not have quotation marks around them, hammer will instantly crash when it loads the material via its material browser.

Paths should always be in quotation marks and not having them is a mistake, but it would be nice to have hammer handle it more gracefully. It could be an engine-wide thing, I have not tested it outside of hammer.

To Reproduce

  1. Remove the quotation marks from any texture path inside any vmt, like so:

$basetexture testing/test

  1. Open hammer, create a new empty map and search the material name inside the material browser

Issue Map

Map agnostic.

Expected Behavior

Handle such cases more gracefully, avoiding crashes and outputting an error in the log window and or a pop-up message when encountering such materials.

Operating System

Windows

vengefulcrop avatar Apr 01 '25 19:04 vengefulcrop

Or even better... auto fix such cases when encountering them...

vengefulcrop avatar Apr 02 '25 15:04 vengefulcrop

You want hammer to potentially modify your vmt files?

JJL772 avatar Apr 02 '25 15:04 JJL772

Not crashing is the baseline. Auto fixing is just a suggestion. no idea how much Hammer can be trusted with this.

vengefulcrop avatar Apr 02 '25 20:04 vengefulcrop

It'd probably be better to have it as some type of external tool. This would introduce additional complexity to Hammer and I feel that it could have unintended side effects.

JJL772 avatar Apr 02 '25 20:04 JJL772