Custom model's texture not showing up

Discussion in 'Mapping Questions & Discussion' started by A Gentleman's Mustache, May 18, 2016.

  1. A Gentleman's Mustache

    A Gentleman's Mustache L1: Registered

    Messages:
    9
    Positive Ratings:
    0
    I want to start utilizing models for the maps I make. For my first model, I just want to create a simple curved cylinder arch. Everything about the model itself is just fine - but its texture doesn't load. I've tried scouring forums for any solutions before posting here, but nothing has worked. I must be missing something...

    The name of the prop is faultline_archway. So the mdl, smd, vmt, vtf, etc, are all named this but with their respective extensions.

    The VMT and VTF are in this directory: ...tf/materials/models/custom/faultline/faultline_archway

    The VMT itself is just bare bones - just to see if I could get it to work. All it says is:

    "VertexLitGeneric"
    {
    "$basetexture" "models/custom/faultline/faultline_archway"
    "$model" 1
    }

    Same path in the qc file.

    No errors upon compiling the model in crowbar:

    Compiling with Crowbar 0.34.0.0: "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\models\custom\faultline_archway\faultline_archway.qc" ...

    Compiling ".\faultline_archway.qc" ...
    qdir: "c:\program files (x86)\steam\steamapps\common\team fortress 2\tf\models\custom\faultline_archway\"
    gamedir: "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\"
    g_path: "faultline_archway.qc"
    Building binary model files...
    Working on "faultline_archway.qc"
    SMD MODEL faultline_archway.smd
    SMD MODEL faultline_archway_idle.smd
    ---------------------
    writing C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\models/faultline_archway.mdl:
    bones 964 bytes (1)
    animation x y ips angle
    @idle 0.00 0.00 : 1.#J ( 90.00) 0.0
    animations 112 bytes (1 anims) (1 frames) [0:00]
    sequences 220 bytes (1 seq)
    ik/pose 164 bytes
    eyeballs 0 bytes (0 eyeballs)
    flexes 0 bytes (0 flexes)
    textures 72 bytes
    keyvalues 0 bytes
    bone transforms 0 bytes
    bone flex driver 0 bytes
    collision 0 bytes
    total 1772
    ---------------------
    writing C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\models/faultline_archway.vvd:
    vertices 56064 bytes (1168 vertices)
    tangents 18688 bytes (1168 vertices)
    total 74816 bytes
    ---------------------
    Generating optimized mesh "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\models/faultline_archway.sw.vtx":
    body parts: 8 bytes
    models: 20 bytes
    model LODs: 12 bytes
    meshes: 9 bytes
    strip groups: 25 bytes
    strips: 27 bytes
    verts: 10512 bytes
    indices: 3624 bytes
    bone changes: 16 bytes
    everything: 14277 bytes
    ---------------------
    Generating optimized mesh "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\models/faultline_archway.dx80.vtx":
    body parts: 8 bytes
    models: 20 bytes
    model LODs: 12 bytes
    meshes: 9 bytes
    strip groups: 25 bytes
    strips: 27 bytes
    verts: 10512 bytes
    indices: 3624 bytes
    bone changes: 16 bytes
    everything: 14277 bytes
    ---------------------
    Generating optimized mesh "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\models/faultline_archway.dx90.vtx":
    body parts: 8 bytes
    models: 20 bytes
    model LODs: 12 bytes
    meshes: 9 bytes
    strip groups: 25 bytes
    strips: 27 bytes
    verts: 10512 bytes
    indices: 3624 bytes
    bone changes: 16 bytes
    everything: 14277 bytes

    Completed "faultline_archway.qc"
    ... Compiling ".\faultline_archway.qc" finished. Check above for any errors.

    ... Compiling with Crowbar 0.34.0.0: "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\tf\models\custom\faultline_archway\faultline_archway.qc" finished.

    Am I missing something from the vmt? Do I need to put the tga file somewhere in tf2's files? Did I mess up compiling the smd in blender? Did I mess up the file locations? No idea what I'm doing wrong, and I have no clue how to even look up what the problem might be. Help would be much appreciated!
     
  2. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,741
    did you correctly assign the material to the model? Open the SMD in a text editor to check, you should see 'faultline_archway' over and over.

    Next did you correctly assign the material directory in the qc?
    you should have a line $cdmaterials "models\custom\faultline"

    did you reload hammer after any changes to the above?

    Also of note:
    that log seems to suggest the model is going into tf/models/ and not tf/models/custom/faultline/
    does your qc have $modelname "custom\faultline\faultline_archway.mdl"?
     
  3. A Gentleman's Mustache

    A Gentleman's Mustache L1: Registered

    Messages:
    9
    Positive Ratings:
    0
    To answer your questions:

    1. SMD isn't as you described. That's something I have to fix in blender, correct?
    2. So $cdmaterials automatically looks in the specified directory for a vmt of the same name as the qc file?
    3. Yes.
    4. No. Didn't realize I needed the file path there too, in addition to the file name.

    Thanks for the quick reply. Figuring out what commands need a directory, or a file name, or both, is kinda confusing the first time around. I'll clean up what I can and then try again.
     
  4. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,741
    @A Gentleman's Mustache Sorry for a late response, hopefully you've fixed it by now but if not:

    1. The smd should have a lot of numbers, every fourth row should have the name of the vmt that model uses. If that word is something like 'default' or 'material01' or something, you've not assigned the model a material in whatever software you're using. So yes, you need to fix that in blender. I use 3ds max, so I can't help with that step.

    2. $cdmaterials means "look in this folder", without it, the model will try and load materials/faultline_archway.vmt instead or materials/models/custom/faultline/faultline_archway.vmt

    4. that line tells the compiler where to put the model, so if you don't have a filepath as well as a name, it'll just end up in models/ which isn't what you want.
     
  5. A Gentleman's Mustache

    A Gentleman's Mustache L1: Registered

    Messages:
    9
    Positive Ratings:
    0
    Finally managed to get it working. Thanks for your help. Couldn't have done it without ya.