STEAM GROUP
Blender Source Tools BleST
STEAM GROUP
Blender Source Tools BleST
375
IN-GAME
2,288
ONLINE
Founded
8 November, 2013
Showing 1-2 of 2 entries
1
"Compile All Now" and "Compile all on export" don't work in 3.2.3
In the "Source Engine QC Complies" (sic, a typo, probably worth changing to "Compilables") section, there's a checkbox "Compile all on export" and a button "Compile All Now". I'm not sure if they ever worked, but on Blender 3.2 with addon version of 3.2.3 they don't.

I looked through the code and put together a fix that makes both of those functionalities work again, at least on my machine. The changes involve editing export_smd.py.
The file with my edits applied: https://pastebin.com/g4yvXZ02

Performed edits and rationale as follows.
The button "Compile All Now" tries to call for the compiler function, providing a wildcard string "*" as the filepath. That's the "all" part in the button name. On line 89 in the current addon file, the compilation function runs a handful of checks to make sure that it's been passed something that can be interpreted as a filepath or a list of filepaths. On line 91, it checks if the path it's been passed has a __getitem__ method - probably to check if what it's been passed is some special object. Unfortunately, a string (our wildcard of "*") has a __getitem__ magic method, but it won't be returning any valid filepaths. That's why the button doesn't work. Making a special check for our wildcard allows the compilation function to actually figure out that it hasn't received a valid filepath and to gather QC files for compilation itself via a getQCs() function.

On Line 229, the export function will attempt to call the compilation function compileQCs() (the one we've discussed in a previous paragraph), but it'll try to pass an instance of itself to that function for whatever reason as its self argument. Later on, the compileQCs() will attempt to call a method, getQCs(), of its class, but since its caller gave itself as its self argument, it tries to call a method from there. My solution is to remove the passing of anything when compileQCs() is called (line 229), and also to make compileQCs() a class method with a @classmethod decorator after line 82. This allows the exporter to cleanly call the compiler method.
1
GUI Panels are created opened
Showing 1-2 of 2 entries