Need some help with converting from 3DS Max to a gmod .mdl
24 replies, posted
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 :)
Here are the files if you are interested in seeing what I was trying to convert:
[url]http://rapidshare.com/files/1885660784/Gmod%20Dubstep%20Gun.zip[/url]
Bump
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.
[QUOTE=SergerantJoe;42035045]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.[/QUOTE]
The contents of the QC file I used to compile it:
[CODE]
$modelname "models\dubstepgun.mdl"
$body mybody "dubstepgun-ref.smd"
$staticprop
$surfaceprop "Metal"
$cdmaterials "models\props"
$sequence idle "dubstepgun-seq.smd"
$collisionmodel "dubstepgun-ref.smd"
[/CODE]
[QUOTE=mrduffdude;42035119]The contents of the QC file I used to compile it:[/QUOTE]
Try tis one:
[CODE]
$cd "<PATH>" // insert a path to your models here
$modelname "models\dubstepgun.mdl"
$model "body" "dubstepgun-ref.smd"
$cdmaterials "models\props"
$staticprop
$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
}
[/CODE]
Also have you created vmt and vtf textures? Maybe you've created vmt wrong way...
[QUOTE=Hamk;42040106]Try tis one:
[CODE]
$cd "<PATH>" // insert a path to your models here
$modelname "models\dubstepgun.mdl"
$model "body" "dubstepgun-ref.smd"
$cdmaterials "models\props"
$staticprop
$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
}
[/CODE]
Also have you created vmt and vtf textures? Maybe you've created vmt wrong way...[/QUOTE]
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 :(
[QUOTE=mrduffdude;42040411][EDIT] That worked fine, except for the textures again, I don't know what I am doing wrong with them :([/QUOTE]
Show me your vmt files.
[QUOTE=Hamk;42040547]Show me your vmt files.[/QUOTE]
Do you mean the contents of them or the actual files themselves?
[QUOTE=mrduffdude;42040561]Do you mean the contents of them or the actual files themselves?[/QUOTE]
Just content. Maybe there is an error in them.
[QUOTE=Hamk;42040574]Just content. Maybe there is an error in them.[/QUOTE]
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:
[CODE]"VertexLitGeneric"
{
"$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
}[/CODE]
And for speaker:
[CODE]"VertexLitGeneric"
{
"$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
}[/CODE]
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.
[QUOTE=Hamk;42040641]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:
[CODE]"VertexLitGeneric"
{
"$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
}[/CODE]
And for speaker:
[CODE]"VertexLitGeneric"
{
"$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
}[/CODE]
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.[/QUOTE]
Still not detecting textures unfortunately :(
[QUOTE=mrduffdude;42040689]Still not detecting textures unfortunately :([/QUOTE]
Upload somewhere your .mdl file.
[QUOTE=Hamk;42040816]Upload somewhere your .mdl file.[/QUOTE]
This is the mdl and any other model files that need to go with it [url]http://rapidshare.com/files/253354670/dubstepgunmdl.zip[/url]
[QUOTE=mrduffdude;42040836]This is the mdl and any other model files that need to go with it [url]http://rapidshare.com/files/253354670/dubstepgunmdl.zip[/url][/QUOTE]
Okay...
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.
[QUOTE=Hamk;42040960]Okay...
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.[/QUOTE]
Replace the VMT's with what?
[QUOTE=mrduffdude;42040973]Replace the VMT's with what?[/QUOTE]
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... :(
[QUOTE=Hamk;42040998]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... :([/QUOTE]
Still no textures unfortunately :(
I am starting to think this is hopeless
[QUOTE=mrduffdude;42041032]Still no textures unfortunately :(
I am starting to think this is hopeless[/QUOTE]
You are compiling with WallWorm?
[QUOTE=Hamk;42041078]You are compiling with WallWorm?[/QUOTE]
Yes and no. I have compiled with wall worm and also just exported smds. Neither way seems to work
[QUOTE=mrduffdude;42041113]Yes and no. I have compiled with wall worm and also just exported smds. Neither way seems to work[/QUOTE]
Well I've tried to compile it by myself and here is the result:
[IMG]http://img401.imageshack.us/img401/3562/5qij.jpg[/IMG]
You can download Source .qc and .smd along with results:
[url]https://mega.co.nz/#!ttNljIrA!IJcNvzz18h7VJzgQ9Xe_lyKj_dUTSw-KxLxaoIWLuME[/url]
[QUOTE=Hamk;42041927]Well I've tried to compile it by myself and here is the result:
[IMG]http://img401.imageshack.us/img401/3562/5qij.jpg[/IMG]
You can download Source .qc and .smd along with results:
[url]https://mega.co.nz/#!ttNljIrA!IJcNvzz18h7VJzgQ9Xe_lyKj_dUTSw-KxLxaoIWLuME[/url][/QUOTE]
Thanks you for all your help, even though I could not manage to compile these for some reason.
But do you think you could upload it somewhere else as the Mega download is temporarily unavailable?
And what program did you use to compile it in the end?
[QUOTE=mrduffdude;42043169]Thanks you for all your help, even though I could not manage to compile these for some reason.
But do you think you could upload it somewhere else as the Mega download is temporarily unavailable?
[/QUOTE]
Here you go:
[url]https://www.dropbox.com/s/l7bykbupru2fpxr/DubstepGun.7z[/url]
[QUOTE=mrduffdude;42043169]And what program did you use to compile it in the end?[/QUOTE]
I've used studiomdl from Source SDK. If you want to use it you can run it with batch file. You can read about it [URL="https://developer.valvesoftware.com/wiki/Compiling_a_model#With_a_batch_file"]here[/URL].
[QUOTE=Hamk;42044338]Here you go:
[url]https://www.dropbox.com/s/l7bykbupru2fpxr/DubstepGun.7z[/url]
I've used studiomdl from Source SDK. If you want to use it you can run it with batch file. You can read about it [URL="https://developer.valvesoftware.com/wiki/Compiling_a_model#With_a_batch_file"]here[/URL].[/QUOTE]
Thanks so much for all of your help :)
[QUOTE=mrduffdude;42041113]Yes and no. I have compiled with wall worm and also just exported smds. Neither way seems to work[/QUOTE]
A couple of things to note. If you exported the model with WW but it didn't actually compile, it could be that your paths are not set up correctly in the WW settings and/or you are using a version of Max that needs a patch (for example, if using 3ds Max 2012, you need to install the latest service pack or WW won't export properly).
Here are the [URL="http://dev.wallworm.com/document/129/gmod_and_wall_worm.html"]updated docs on setting up WW for Gmod[/URL] and below is a new video on setting up WW correctly for Gmod and doing a few random things:
[video=youtube;5LKCZl5omDU]http://www.youtube.com/watch?v=5LKCZl5omDU[/video]
[editline]2nd September 2013[/editline]
I was curious about the MAXScript error you mentioned in the opening thread so downloaded your file. I found no such error. So it may be due to an unpatched version of Max (mentioned above) or some other error based on settings.
Anyway, one problem with the file in terms of WW exporting directly is that the bitmaps are DDS files. Source's VTEX does not work on DDS bitmaps so far as I know. You must convert the DDS to TGA (or PSD).
[URL="http://www.wallworm.com/examples/ww_[Dubstep]GUN.zip"]Here is an updated version of your file[/URL] that will export from WW directly into Source. Note that I've changed some of the names of materials and bitmap nodes in the Material editor to control the output paths bitmaps and the names of the materials.
The file is in 3ds Max 2014 format. Hopefully it helps you understand the process a little more.
PS. The specular will only work if it is merged into the mask of the diffuse or bump map.
Sorry, you need to Log In to post a reply to this thread.