Adding skins to existing models

Adding skins to existing models

Re: Adding skins to existing models Posted by Dark Tree on Mon Nov 10th 2008 at 5:23am
Dark Tree
646 posts
Posted 2008-11-10 5:23am
646 posts 264 snarkmarks Registered: Apr 30th 2004 Occupation: DigiPen student Location: USA
How do you add a skin to an existing model? What I am trying to do is have an alternate skin for the explosive barrel. I have already made the skin, converted it to vtf, created the vmt.... but how do I refer to it in Hammer? Looking at the Valve wiki, it says I have to edit to .qc file, which I think is an uncompiled model work file. If this is so, is it not possible to add a skin to an already compiled model?

the model in question is the oildrum001_explosive.mdl found in the props_city17 folder. I would just re-skin the texture and have it on top of the older texture, if I just straight up wanted to replace it, but I want to use both textures in-game. I opened up oildrum001.mdl (an oil drum with 7 alternate skins) in a text editor, and saw where it specified all the other textures. I tried opening up oildrum001_explosive.mdl in the text editor and manually typing in the name of the other texture, but that obviously didn't work.

Do I need a modeling program? Is there an editor where I can just edit the line where I add another model to the skin list?
Re: Adding skins to existing models Posted by Le Chief on Tue Nov 11th 2008 at 8:10am
Le Chief
2605 posts
Posted 2008-11-11 8:10am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
Hehe, I actually don't remember anymore but I do remember me explaining how its done to Muhnay, after some searching (search feature is broke) I found it!

1) Download this (MDLDecompiler).
2) Decompile the model.
3) Open up the QC file.
4) add this (vending machine example):
$texturegroup skinfamilies
{
{ "SodaMachine01a.vmt" }
{ "SodaMachine01b.vmt" }
{ "SodaMachine01c.vmt" }
{ "SodaMachine01d.vmt" }
}
under this:
$cdmaterials "modelsprops_interiors/"
5) Modify what you just pasted to suit your needs, and don't modify the names, they need to be named like that.
6) Skins go in here: "materials/models/props_interiors", in the case of the vending machine.
7) Recompile with this (StudioCompiler).

Perhaps I ought to make a quick tutorial on this and add it to my website! Anyway, let me know how this goes for you.
Aaron's Stuff
Re: Adding skins to existing models Posted by Dark Tree on Tue Nov 11th 2008 at 10:35am
Dark Tree
646 posts
Posted 2008-11-11 10:35am
646 posts 264 snarkmarks Registered: Apr 30th 2004 Occupation: DigiPen student Location: USA
thank you!! But I need some serious help. for starters... your link is broken. The homepage is down. If you google for it, Google's link and cache do not work. I did find this link though, that DOES work HERE. I found it by clicking "Check for new version" on the StudioCompiler.exe file I found by searching Google for the filename.

ANYWAY... to get any of this working, I had to modify all 11 of my GameInfo.txt files, which I will have to change back when I am done with this nonsense. Then, I finally decompiled the .mdl file. I now have all of the extracted model files with the vital .qc file I needed. By the way StudioCompiler now INCLUDES MDLCompiler in the same program... no need for both programs.... only StudioCompiler.

So I have the extracted files, a vague idea of what to edit in the QC file, and a compiler with too man options I don't understand.... I can't figure out how to re-compile the files... do I need to have them in a specific folder? what buttons do I press in the program... do I do a full compile.... or do I use the compile option that says I already have the .QC file. I tried compiling it (with the Compile w/ Existing QC method), and here is the compile log:
SMD MODEL C:\Users\Wade\Desktop\oil/oildrum001_explosive_reference.smd
SMD MODEL C:\Users\Wade\Desktop\oil/lod1_oildrum001_explosive_reference.smd
SMD MODEL C:\Users\Wade\Desktop\oil/idle.smd
ERROR: Aborted Processing on 'props_c17\oildrum001_explosive.mdl'

StudioMDL Thread complete
I tried moving the files into different locations and such and trying to make it al work, but no dice.... I definatly need a tutorial on how to recompile with an edited .QC file so I can add the extra skin to the hammer list... Thank you lots and lots for looking into this Aaron!! :D
Re: Adding skins to existing models Posted by Le Chief on Fri Nov 14th 2008 at 4:15am
Le Chief
2605 posts
Posted 2008-11-14 4:15am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
All you have to do is keep everything in the same directory, don't delete or move anything, just edit the qc file in its spot. Also make sure you have the additional material files (vtf/vmt) in the correct directories.

Once you do that, enter all the details and hit compile.

If that fails to work, there is most likely an error in the qc file.
Aaron's Stuff
Re: Adding skins to existing models Posted by Dark Tree on Sun Nov 16th 2008 at 12:19pm
Dark Tree
646 posts
Posted 2008-11-16 12:19pm
646 posts 264 snarkmarks Registered: Apr 30th 2004 Occupation: DigiPen student Location: USA
NIGHTMARE: OVER.I freaking FINALLY made a breakthrough. It is 4 AM. This is the third night in a row working about 2 to 3 hours a night trying to make this work. Between editing gameinfo text files, crashing windows, crashing compilers, not having the setups correct, editing dozens of SMD files in Notepad and compiling/decomiling adnausium with various levels of success seemingly random... we have a small success.

Folks, we have liftoff with dual texturing. While I havent gotten it to ADD a texture to an existing model... I HAVE recompiled an existing model into an entirely new identical model... with a different texture... got it workin in Hammer and steam and all. It isn't as officiant as simply having another skin, but it will definitely do, and I am only losing about 75KB filesize in the process... which isn't too shabby, considering Valve makes me double the sound filesizes to fade stuff in and out :/ .

I'm sure with some more work I can widdle down exactly how to add another skin to an existing model, but for now, God has shined down and let me rest easy tonight on this. I think I would have went insane if I didn't get it sooner or later. About broke my laptop earlier tonight.... so I took a break... watched a movie.... had some Mickey D's, and went back to it to get it done. If I only put this kind of effort into my homework I am stalling to do until tomorrow :( (Sunday).

While I largely figure out how to do this on my own, I wouldn't be anywhere without a helpful community. Aaron, you gave me enough crucial pointers to get me going in the right direction to solving this 'multiple skins for models' problem. Big thank you. Your help will not go unforgotten. (thank you section in the credits, anyone?)
Re: Adding skins to existing models Posted by haymaker on Sun Nov 16th 2008 at 5:19pm
haymaker
439 posts
Posted 2008-11-16 5:19pm
haymaker
member
439 posts 921 snarkmarks Registered: Apr 1st 2007 Location: CAN
I'm glad you've had some success, the whole source model structure seems unnecessarily complicated at first. If you refine your methods to finality I for one would like to see a tut on snarkpit. I have been fooling around with decompiling/scaling/recompiling with some success, but even that seems to take a lot of tedious steps.

Maybe someday somebody will come up with a front-end program where all you do is fill in the blanks, sure would speed things up. It's not a big hassle editing qc's but sure is easy to make mistakes. With regards to recompiling I have been using GUI StudioMDL, have no idea if it's faster that Cannonfodders but fully functional

http://www.wunderboy.org/apps/guistudiomdl2.php
Re: Adding skins to existing models Posted by Le Chief on Mon Nov 17th 2008 at 3:35am
Le Chief
2605 posts
Posted 2008-11-17 3:35am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
Email me the QC file for the model you want to add the skins to, along with the skins and I'll email or post here for learning purposes the edited QC and where to stick the skins and such.

I'm writing that tutorial asap!
Aaron's Stuff
Re: Adding skins to existing models Posted by Dark Tree on Mon Nov 17th 2008 at 8:14am
Dark Tree
646 posts
Posted 2008-11-17 8:14am
646 posts 264 snarkmarks Registered: Apr 30th 2004 Occupation: DigiPen student Location: USA
I'm not sure what your email is... and I can't find it on your webpage either. but here: LINKY
Re: Adding skins to existing models Posted by Le Chief on Wed Nov 19th 2008 at 1:07am
Le Chief
2605 posts
Posted 2008-11-19 1:07am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
Alright Dark Tree, I wrote the tutorial. You can find it on my website here. I'll submit it to Snarkpit shortly.

Follow the steps in the tutorial and see if you still get the same error!
Aaron's Stuff
Re: Adding skins to existing models Posted by Dark Tree on Thu Nov 20th 2008 at 7:08am
Dark Tree
646 posts
Posted 2008-11-20 7:08am
646 posts 264 snarkmarks Registered: Apr 30th 2004 Occupation: DigiPen student Location: USA
I will Aaron. I'll try it when I get a chance and let u know!
Re: Adding skins to existing models Posted by G4MER on Thu Nov 20th 2008 at 4:39pm
G4MER
2460 posts
Posted 2008-11-20 4:39pm
G4MER
floaty snark rage
member
2460 posts 360 snarkmarks Registered: Sep 6th 2003 Location: USA
Aaron nice tut man.. I also like your site!
Re: Adding skins to existing models Posted by fishy on Thu Nov 20th 2008 at 5:19pm
fishy
2623 posts
Posted 2008-11-20 5:19pm
fishy
member
2623 posts 1476 snarkmarks Registered: Sep 7th 2003 Location: glasgow
The output directory and the model name should be edited so as not to clash or overwrite the original.
Both are cited in the $modelname line of the qc file, so in this case I'd use something like;

$modelname props_fishy/fish_soda.mdl

This will place the model, named fish_soda.mdl, in the models/props_fishy folder. You neeed to create any custom folders before compiling the model, or the compile will fail.
Re: Adding skins to existing models Posted by Le Chief on Fri Nov 21st 2008 at 4:19am
Le Chief
2605 posts
Posted 2008-11-21 4:19am
Le Chief
member
2605 posts 937 snarkmarks Registered: Jul 28th 2006 Location: Sydney, Australia
Thanks Muhnay.

Fishy, thats a good point, I might edit my tutorial and add a little something about what you have mentioned :dodgy:. However, there shouldn't be any collisions. All content such as textures, sounds and models inside gcf files are given a low priority. That means that if there is a model in say the Half-Life 2 folder with the same name as one in a gcf file, the one in the folder will be used over the one in the gcf.
Aaron's Stuff