Talk:Model Creation Overview

From Valve Developer Community
Jump to: navigation, search

How does the VTF get compiled into the MDL file?

The model QC files and QC Commands docs don't contain any reference to the VTF (or TGA or VMT). If that's correct, how does the VTF get built into the MDL ? It doesn't appear to be part of the SMD data. —The preceding unsigned comment was added by Beeswax (talkcontribs).

It is part of the SMD. The texture is defined for every polygon so that the first of the two rows of data per poly is always the texture filename. Path to the surface material is defined in the QC. Jupix 15:26, 5 Nov 2007 (PST)
Ah - the penny drops! So that's why the GameDirectory/models and GameDirectory/materials/models are so specific ... the MDL relies on the correctly named VTF being in the ../materials/models directory. Thanks for the insight Jupix. Beeswax 09:28, 6 Nov 2007 (PST)

I've added a section on VTF and VMT files because they are an unavoidable part of the modelling workflow. If I've got anything wrong, please feel free to correct, clarify or discuss. Beeswax 17:11, 6 Nov 2007 (PST)

Basically, just give the VTF and the VMT the same name as the source image had when you assigned it to the model in your modelling software. Otherwise it will not work. --Pandaboy 03:40, 16 November 2011 (PST)

Adding animations

Is it possible to add animations to an existing model? Say, having the G-Man smacking his forehead, or doing a little dance or something. Or would you have to decompile the model (how would you even do that?), add the animation, and then recompile it? —Yar Kramer 10:42, 25 Jan 2008 (PST)

Yes,of course it is. first you need to decompile your .mdl file, here you can download the program for do it; must be placed under (you_user_name)\sourcesdk\bin\ep1\bin directory.In the .qc file after the eye/face data just add: $includemodel Gman_gestures.mdl this will add all gman gestures at you model,so when you re-compile it you will have all the default animation plus the one you add, if you are looking for gestures of other models,just open the hl2 model viewer and in the browse window you can see the name and location of other gesture.mdl files, for instance the citizen gestures are located under Humans\Male_gesture.mdl.— Bertic 18:16, 02/07/2008
This assumes that the decompile completes successfully, of course. You can't do the same for rebels because the decompiler crashes before the process is complete. --TomEdwards 09:53, 2 Jul 2008 (PDT)
This is because the hl2 file are hidden from valve so you can't open them, the only way is to find the .mdl in an other way...may be downloading a mod like gmon9 that contain (under model/player) all the models of hl2 characters,and you can decompile them easily.— Bertic 21:35, 02 Jul 2008
You can download GCFScape to access Valve's models. --TomEdwards 08:39, 3 Jul 2008 (PDT)
I've extracted the model from the GCF file and the decompile worked, don't forgot to extract not only the .mdl file but also the .dx80.vtx .dx90.vtx .vvd .phy .xbox.vtx and the .sw.vtx files of your model,for instance for the rebel model (male_01),you must extract Male_01.mdl, Male_01.sw.vtx, Male_01.dx80.vtx,Male_01.dx90.vtx,, Male_01.vvd and Male_01.phy, if the are not in the same directory of the .mdl the decompiler will not complite the decompile process.— Bertic 15:08, 04 Jul 2008

New, improved Model Creation Overview plan

Just thought I's start the ball rolling on a plan for what will be included in the all-new article and roughly the shape it will take. Some things to consider:

  • use workflow sequence structure
  • try to index information in stored in separate pages : task guidelines and application-specific instructions.

Workflow sections:

  1. Planning the model is essential : what type of model is this going to be? things to consider.
  2. Types of model in game : worldmodel, viewmodel, skyboxmodel.
World objects Static Physics motion Dynamic movement
worldbrush always never never
displacement always never never
brushmodel yes yes yes
studiomodel yes yes yes
sprite yes never yes

Modelling tasks:

  1. Skin Textures are created in an image editor compiled as VTFs and brought together in the modelname.vmt.
    • what's it for ? renders the model visible in game (defaults to "missing skin" vmt).
    • note: game_dir/materials/models.
    • default skin must be same name as UV mapped texture.
    • tip: don't leave this til last - it's much more difficult to UV map a finished mesh than if you UV map as you model.
  2. Render Model Geometry is created in model editor and exported as modelname_ref.smd.
    • what's it for ? gives 3D shape to the skin and connects it to the skeleton.
    • skeleton in default pose (reference pose) (defaults to rootbone at modelorigin)
    • vertex geometry must be a single mesh : UV mapped to skin and enveloped to skeleton.
  3. Physics Model Geometry is created in model editor and exported as modelname_phys.smd.
    • what's it for ? vphysics collision system - every "solid" world object. Not used by viewmodels, detail-props, etc? ... (npc_) character models will usually have an associated ragdoll or gibs.
    • skeleton in default pose (reference pose)
    • vertex geometry must be made of convex hulls, which may overlap to create concave physmodels, or enveloped to the skeleton for ragdolls.
  4. Skeletal Animation Sequences are created in model editor#animation and exported sequencename.smd.
    • what's it for ? moves body parts relative to other body parts. Used only by prop_dynamic or npc_ entities, etc?
    • each sequence must be in its own SMD file.
  5. LOD (render) models, Gibset models, Bodygroup meshes, ...

Compiling tasks:

  1. StudioModel Properties are defined in a QC script using a qc editor and saved as modelname.qc.
    • tasklist:
  2. StudioModel's SMD and QC files are compiled by studiomdl into game-ready Studiomodels.
    • set up file paths for QC, SMDs, StudioMDL.exe, game_dir/models, etc
    • test and check (polycount, showbudget, etc)
    • distribution (eg map.res file, Source file-download sites, etc)
Note:This plan is Working Draft - please add your comments and suggestions below: --Beeswax 12:23, 5 May 2008 (PDT)

3ds Max 2009

Considering this tut being worked on for three years now, does all this work with 3ds max 09, or would a section need to be written for that too. I find 3ds max alot better than XSI, which is why I'm asking this as I really don't know much about XSI anyways.--Gear 17:28, 22 May 2008 (PDT)
It's about the same, few things like setting up max would have to be included.

Like for Max 6-8 you would use CannonFodder's SMD Importer/Exporter. For Max 9+ You'd use Jed's lovely exporter. --Frostbite 18:06, 22 May 2008 (PDT)

Left 4 Dead?

Is the process for porting content into Hammer the same in Left 4 Dead SDK as in The Orange Box version? And will the third party tools still work? --Limey 13:07, 10 June 2009 (UTC)

About the box....

About the box on top of the page, I don't know what the "This very scary article" part means. I doubt the page is scary at all. --Nathaniel 02:19, 4 November 2010 (UTC)

It's using scary in the sense that the process is complex and convoluted, and difficult to understand for newcomers. --Omnicoder 18:57, 4 November 2010 (UTC)

XSI Plugin

In the article it says the plugin packaged with XSI was the only one available. What's wrong with "sourcesdk\xsi\ValveSource.0105.01.xsiaddon"?