1
$\begingroup$

I'm desperatly trying to figure out on how to export a 3D Model with it's texture into the Hammer Map Editor (Source SDK) for Garry's Mod. So far I managed to make models and to have them in there but I am struggling a lot to figure out on how to actually put on the texture. I followed the instructions of this video

Sadly I only get the model out since he does not explain anything on how to get that texture over. Even if I follow all his steps step-by-step, I just cannot get the texture over. Then I tried this. I saved the texture file as png, used VTF-Editor or viewer and turned the png into a vtf file. Put it in a folder and then all I have is a texture I can apply to my blocks, but it's not attached to the model like it is with all the other things.

Next I also tried using the hlmv tool to check on the model but all I guess is the pink and black checker texture and the message that the texture cannot be found.

I'm slowly losing my mind over this since I have tried so many things. Apparently when some things have a _ in their name the texture also just stays blank and when I remove it it starts working again for the texture alone.

Do we have anyone here who could please please show me how this works or tell me what the steps are.

Here are the steps I took.

  • Create a simple model in Blender
  • Giving it a UV model/texture
  • Exporting it via the Source Tool plugin
  • creating the QC-File and moving both onto the Studiomdl.BAT-file to create the model for Blender
  • Save the UV-thing as png
  • Open the png in VTF-Editor and save as VTF
  • Create a VMT File refering to the VTF file and put them inside a subfolder in the materials folder
  • Opening hammer or hlmv tool and check if the texture is applied
  • Losing my mind since yet another attempt did not work out. :C

STUDIOMDL.BAT file:

"C:\Program Files (x86)\Steam\SteamApps\common\Garrys Mod\bin\studiomdl" -nop4 -game "C:\Program Files (x86)\Steam\SteamApps\common\Garrys Mod\Gmod" %1
pause

QC file:

$modelname Varmints_Models/pumpkin1.mdl
$model "Body" "pumpkin1.smd"

$staticprop
$cdmaterials "models/Varmints_Models/"
$surfaceprop "pumpkin1"

$sequence "idle" "pumpkin1.smd"
$collisionmodel "pumpkin1.smd" { $concave }

VMT File Code:

VertexLitGeneric
{
  $basetexture "Varmints_Models/Pumpkin1"
}
$\endgroup$
  • 1
    $\begingroup$ Looks like this is more of a question for a hammer forum than a blender one since you seem to be able to export your texture just fine. There should be a way in hammer to assign the texture to your object and set the projection to UV. $\endgroup$ – Arthur Blaquart Nov 25 '19 at 16:00
  • $\begingroup$ @ArthurBlaquart yeah I know it's more for a hammer forum but I also must admit that the Stackexchange community also usually found a solution or at least know something helpful :) But thank you for trying. If I find the solution I will try to remember to put it in here $\endgroup$ – VarmintLP Nov 25 '19 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.