Decompiler Question

If you decompile a physics model using cannonfodder’s decompiler, should you be able to take the decomiled smd’s and qc without changing them and recompile without any errors?

Decompiling a .mdl and expect to recompile it back with the same files? - Um no. The decompiler CREATES a messy QC file, you will have to fix that. Though if the model is too simple, like a Prop, no bones or anything. Sometimes it works…

Don’t trust the qc file you get from decompiling.

Ok but the smd files wouldn’t have to be fixed would they?

Not usually, depends if your intending to alter them or not.

Nope, even you can alter and edit them! You’d only have to remember to re-export the reference and the sequence smd files.

I mean. By the simple fact that the QC file has to be re-done, there isn’t any difference if you edit the smd’s or not.

If you know what you’re doing…of course. If you change the bone names of a Smd file. You’d have to also edit the bone names on the QC file.

But as far as the mesh goes, you can do anything with it.

Ok well lets take the spitball model from ep2 for example. I didn’t change anything in the smd’s, only the qc. Here’s what the decompiler made:



$modelname "spitball_small.mdl"
$model "Body" "spitball_small.smd"
$cdmaterials "models\Spitball\"
$hboxset "default"
$hbox 0 "static_prop" -1.277  -1.331  -1.511  1.306  1.384  1.230
// Model uses material "spitball.vmt"
$surfaceprop "default"
$illumposition 0.015 0.027 -0.140
$sequence Idle "Idle" loop fps 30.00
$collisionmodel "phymodel.smd" {

	$concave
	$mass 0.3
	$inertia 1.00
	$damping 0.00
	$rotdamping 0.00
}


and here’s what I refined it to:



$modelname "test.mdl"
$model "Body" "spitball_small.smd"
$cdmaterials "models\Spitball\"
// Model uses material "spitball.vmt"
$surfaceprop "alienflesh"
$sequence Idle "Idle" loop fps 30.00
$collisionmodel "phymodel.smd" 
{
	$concave
	$mass 0.3
}


Shouldn’t this work?

It should yes. First thing to check when getting errors is if the SMDs are in the same folder as the QC, then spelling mistakes, then more intricate problems.

(You don’t need the “model uses material…” thing its a comment).

Ok well I’m assuming something is seriously wrong with my sdk because I can’t get a single model to work ingame anymore. Every single model I compile, whether it’s a ragdoll or physics object, complex or simple, edited or not, will compile error-free and show up perfectly in the modelviewer. When they spawn ingame, they’re always invisible. No matter what I do. I’ve been trying to figure this out for a week. This is killing my motivation. Ugh :C

Sounds familiar, what software are you using?

When exporting a SMD, make sure to tick the option “Export with vertex weights”, that’s a possible explanation on why it is invisible.

Took me weeks to figure out.

I’m using 3ds max, I don’t see that option.

What 3Ds max version are you using? That’s more important to know. I take it that you’ve got the Smd import/export plug in for 3Ds max, but there is one that doesn’t support exporting w/ vertex weights on a specific 3Ds max version.

I’m using max 10

You found yourself the root of the problem then.

If you DO have a smd exporter on max 10, but it doesn’t export weights. Then follow this little trick:

Export your smd as you normally would from Max 10. Get Milkshape, and import that smd in there.

Now, just re-export that file. And make sure to tick “with vertex weights” on this program. You don’t have to do anything, just import to Milkshape and then export again as a SMD.

It’s very odd and it worked for me.

The other option is.

Buy 3Ds max 8. The plug in for it, does have all the options.

That button does something? I’ve tried exporting with and without the “with HL2 vertex weights” and it exports them either way.

At least for me, it was of my very first lessons.

But I don’t think it matters for Props, only rigged ragdolls.

Well no matter what it is for me, even just decompiling a model, not touching the smd’s at all and recompiling produces a transparent model.

HEY HEY HEY HEY I THINK I KNOW THIS ERROR
And I think I fixed it.
Did you move the model AT ALL from the base directory? (which, by your .QC, would be the basic model folder (C:\Program Files\Steam\steamapps\username\garrysmod\garrysmod\models))

Because if you do, for WHATEVER reason, the game will fail to load the .VVD file, and the model will turn out transparent. Check if your console has "Failed load of .vvd for model “test.mdl”. If it does, then you need to move it back to the directory it was compiled to.

OMG that’s exactly the error that I’m getting >_>

You use StudioCompiler?

MWAHAHAHA I CAN READ PEOPLES MINDS

But yeah, that should fix it. (I got the same error in TF2, and this fixed it) If you want to change the directory, then change the $modelname to whatever you wanted to move it to. For example, if you wanted your model to be in a “milkywaym16” folder, then you would have to change it to "$modelname “milkywaym16/test.mdl”