Need some help with converting from 3DS Max to a gmod .mdl

Ok so I have spent all day on this but with no success. I am trying to convert a 3DS Max model into a source engine .mdl file for gmod. I have successfully managed to convert the model itself into an .mdl but the materials have failed all the way unfortunately.

So I was wondering if anyone knew of a way that I could do this without mucking it up.

Before anyone reply’s saying I should follow a tutorial or something, I have. I have tried many different ways of using wall worm (this is how I got an .mdl but no materials), creating a .obj, or even using the .fbx file.

The problems I have with the materials are that either Garry’s Mod does not recognise them or I cannot export them and get the error “–Unable to convert: undefined to type: FileName”

Any help would be much apreciated :slight_smile:

Here are the files if you are interested in seeing what I was trying to convert:


First of all, bumps are only acceptable after a day or two, second, you probably borked either your $cdmaterials or your VMTs.
Post the QC file you used to compile.

The contents of the QC file I used to compile it:

$modelname	"models\dubstepgun.mdl"
$body mybody	"dubstepgun-ref.smd"
$surfaceprop	"Metal"
$cdmaterials	"models\props"

$sequence idle	"dubstepgun-seq.smd"

$collisionmodel	"dubstepgun-ref.smd"

Try tis one:

$cd "<PATH>" // insert a path to your models here
$modelname "models\dubstepgun.mdl"
$model "body" "dubstepgun-ref.smd"
$cdmaterials "models\props"
$surfaceprop    "Metal"
$hboxset "default"
$hbox 0 "static_prop" -16.800  -5.900  0.000  32.800  5.950  13.850 // maybe this will require a little fix later
$sequence idle    "dubstepgun-seq.smd"
$collisionmodel "dubstepgun-ref.smd" {

    $mass 5.0
    $inertia 1.00
    $damping 0.00
    $rotdamping 0.00

Also have you created vmt and vtf textures? Maybe you’ve created vmt wrong way…

Ok I’ll give that a go.

[EDIT] That worked fine, except for the textures again, I don’t know what I am doing wrong with them :frowning:

Show me your vmt files.

Do you mean the contents of them or the actual files themselves?

Just content. Maybe there is an error in them.

Looking at them, they were all blank so I have done something wrong here.

You must have two vmt’s (for main gun and for speaker in it). So call them [Dubstep]GUN_Diffuse and [Dubstep]GUN_Speaker_Diffuse (as your material groups on model).

Then open your vmt’s in notepad and place following lines in it:

	"$baseTexture" "models\props\[Dubstep]GUN_Diffuse"
	"$bumpmap" "models\props\[Dubstep]GUN_Bump"
	$envmap env_cubemap
	$envmaptint "[0.1 0.1 0.1]"

	$normalmapalphaenvmapmask 1	
	$rimlight 1										
	$rimlightexponent 20								
	$rimlightboost 0.5

And for speaker:

	"$baseTexture" "models\props\[Dubstep]GUN_Speaker_Diffuse"
	"$bumpmap" "models\props\[Dubstep]GUN_Speaker_Bump"
	$envmap env_cubemap
	$envmaptint "[0.1 0.1 0.1]"

	$normalmapalphaenvmapmask 1	
	$rimlight 1										
	$rimlightexponent 20								
	$rimlightboost 0.5

And make sure you’ve placed [Dubstep]GUN_Speaker_Diffuse.vtf, [Dubstep]GUN_Speaker_Bump.vtf, [Dubstep]GUN_Diffuse.vtf and [Dubstep]GUN_Bump.vtf in “materials\models\props” folder.

Still not detecting textures unfortunately :frowning:

Upload somewhere your .mdl file.

This is the mdl and any other model files that need to go with it


Replace your vmt’s at “materials\models\dubstepggunsr4” and rename “[Dubstep]GUN_Speaker_Diffuse.vmt” as “Mesh_0368.vmt”. Because your compiler made something with path to models.

Replace the VMT’s with what?

Sorry, I mean transfer from “materials\models\props” to “materials\models\dubstepggunsr4”

I guess my english still not as good as I want it to be… :frowning:

Still no textures unfortunately :frowning:

I am starting to think this is hopeless

You are compiling with WallWorm?

Yes and no. I have compiled with wall worm and also just exported smds. Neither way seems to work