What file tells Model Viewer what texture file to use?

javierdl

2009-12-23 23:30:32

Ok, I can see that the QC tells the compiler WHERE the texture will be found with the $cdmaterials command. But it doesn't tell it WHICH file it is.
I am just trying to understand how these 2 events (compiling the model and compiling the texture) relate to one another, HOW their liaison is created and WHEN.
So that I can tell when not to change the name of my texture file (if I see it fit).

Btw, does it matter whether we compile the texture first and the model after, or the other way around?

Thanks guys,

Happy Holidays!

JDL

boshed

2009-12-24 03:28:29

It's in the .smd, take a look at it with a text editor.

Each triangle on your UV map has a material assigned to it in the smd (different triangles can have different materials) which is the vmt filename without the .vmt extension. This is then written to the .mdl along with the path to the textures when compiling.

In short : can't easily change your texture filename and location after your compile the .smd into a .mdl - textures themselves (vmt and vtf) can be edited at any time.

Not sure what you mean by compiling a texture?

javierdl

2009-12-24 04:48:56

Well, no wonder!
Now it all makes sense. Thank you ever so kindly for that explanation Boshed :)

As for your last question, I'm probably misusing the term, but that's the term Studio Compiler uses for its button for converting/exporting a TGA into a VTF (the button says "Compile"). It probably should just say "export".

Wait a second... going back to your explanation. If the path to the VTF is written into the MDL file, then why is it that they are 2 separate processes? I mean to say, when I use GUIStuidioMDL I am only compiling the model files (correct?), and the only reference to the texture there is, is in the QC file. But it only serves to point to its location, nothing else.
I hope you can correct me on this.

JDL

javierdl

2009-12-26 06:11:49

Now I get it, see this post at steampowered.com forums

JDL

boshed

2009-12-27 16:57:35

That's right :)

Blender's SMD exporter assigns the material name to the triangles in the SMD automatically (it won't let you export an smd without having a material assigned) - which is very handy imo, just name your blender material the same as your vmt filename and you're good to go.

It's very good for working with multiple textures on one model as you can make the materials different colours in Blender and easily see that they are assigned in the right places.
javierdl wrote: As for your last question, I'm probably misusing the term, but that's the term Studio Compiler uses for its button for converting/exporting a TGA into a VTF (the button says "Compile"). It probably should just say "export".
Makes sense now, I don't use GUIStuidioMDL so have never seen that before.