SFM/Converting Existing Assets: Difference between revisions

From Valve Developer Community
< SFM
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
While sounds don't need to be recompiled, and can be copied to your ugc directory, models require some edits first. For your models, you'll need to make some simple edits to your .vmt's and your .qc's and copy a couple directories around. Here's the process in two steps: materials and models. (Note that in the instructions below, any text in ALL CAPS needs to be replaced with the appropriate text for your assets. So STEAMID needs to be replaced with your own steamid, for example)
While sounds don't need to be recompiled, and can be copied to your ugc directory, models require some edits first. For your models, you'll need to make some simple edits to your .vmt's and your .qc's and copy a couple directories around. (Note that in the instructions below, any text in ALL CAPS needs to be replaced with the appropriate text for your assets. So STEAMID needs to be replaced with your own steamid, for example)
 
Here's the process in two steps: materials and models.


'''Materials'''
'''Materials'''

Revision as of 11:03, 5 April 2013

While sounds don't need to be recompiled, and can be copied to your ugc directory, models require some edits first. For your models, you'll need to make some simple edits to your .vmt's and your .qc's and copy a couple directories around. (Note that in the instructions below, any text in ALL CAPS needs to be replaced with the appropriate text for your assets. So STEAMID needs to be replaced with your own steamid, for example) Here's the process in two steps: materials and models.

Materials


The best practice is to copy your .tga's in your content directory, and recompile them:

copy content/usermod/materialsrc/models/PATH/* to content/usermod/materialsrc/models/ugc/STEAMID/PATH
compile content/usermod/materialsrc/models/ugc/STEAMID/PATH/*.tga with vtex.exe
copy game/usermod/materials/models/PATH/*.vmt to game/usermod/materials/models/ugc/STEAMID/PATH
edit game/usermod/materials/models/ugc/STEAMID/PATH/*.vmt as described below


But if you're in a hurry, you can probably just copy the entire directory containing your .vtf's and .vmt's, and skip copying and compiling your .tga's:

copy game/usermod/materials/models/PATH/* to game/usermod/materials/models/ugc/STEAMID/PATH
edit game/usermod/materials/models/ugc/STEAMID/PATH/*.vmt as described below


The only edit you'll need for .vmt's is to insert "ugc/STEAMID" into your path like so: (where "$VAR" is any material variable that references a texture, like "$basetexture" or "$bumpmap")

change "$VAR" "models/PATH/TEXTURE" to "$VAR" "models/ugc/STEAMID/PATH/TEXTURE


Models


For models, there's only one choice, and that is to recompile them. While the texture format hasn't changed between different games and sdk's, the model format has. So to convert your models, you'll need to copy the directory containing your .qc's, .smd's, etc:

copy content/usermod/models/PATH to content/usermod/models/ugc/STEAMID/PATH


Most models will only require this change to your .qc's:

change $modelname PATH/FILENAME.mdl to $modelname ugc/STEAMID/PATH/FILENAME.mdl
change $cdmaterials models/PATH to $cdmaterials models/ugc/STEAMID/PATH