Difference between revisions of "$texturegroup"

From Valve Developer Community
Jump to: navigation, search
(Basic syntax: Added bug)
m (Further information)
Line 45: Line 45:
 
* Skin options can also be used to provide <code>$bumpmap</code>, <code>$surfaceprop</code>, etc. options for the model in each [[VMT]]. For optimization, see also [[$lod]] and [[LOD Models]].
 
* Skin options can also be used to provide <code>$bumpmap</code>, <code>$surfaceprop</code>, etc. options for the model in each [[VMT]]. For optimization, see also [[$lod]] and [[LOD Models]].
 
* All alternative VTF textures should follow the same [[UV map]] layout.
 
* All alternative VTF textures should follow the same [[UV map]] layout.
* One of the skins in the list '''must''' be the texture name which was in the SMD. Without this the skins will  only use the texture name from the SMD, and not ones from your list.
+
* One of the skins in the list '''''must''''' be the texture name which was in the SMD. Without this the skins will  only use the texture name from the SMD, and not ones from your list.
  
 
[[Category:QC Commands|texturegroup]]__NOTOC__
 
[[Category:QC Commands|texturegroup]]__NOTOC__

Revision as of 10:01, 12 March 2017

Français

Creates a set of replacement materials used on a model. It is used to add alternative "skin" options for the model.

  • If no $texturegroup is specified, the model's VMT must be the name of the texture which was UV mapped onto the reference .SMD.
  • The $texturegroup command should follow after the $body in the .qc.

Basic syntax

$texturegroup "<name>"
{
    { "<skin_0>" }
    { "<skin_1>" }
}

Where

  • <name> is the name of the texturegroup. Even though a name string is required for studiomdl to compile it is not stored within the binary.
  • <skin_0> is the name of the default Material (VMT) file.
  • <skin_1> is the name of the alternative Material (VMT) file.
  • Allows up to a maximum of 32 alternate material sets. Limit hard coded by studiomdl.
Tip:If all you want to do is have a different texture on each skin, simply clone the skin_0.vmt, rename it skin_1.vmt and change the $basetexture reference to the new_colormap.vtf. Make sure the skin_1.vmt and new_colormap.vtf files are placed in the appropriate subfolder of the game_dir/materials/models/ directory.
Bug: You must add spaces between the {} and the "". Adding a new skin with {"skin0"} will not work, but { "skin0" } will.

Example

$texturegroup "rockcliff_cluster01"
{
	{ "rockcliff02a" }
	{ "rockcliff02b" }
	{ "rockcliff02c" }
}

Advanced syntax

For models with multiple materials, $texturegroup can also be used to specify their replacements by specifying multiple materials per line.

$texturegroup "YourTextureGroupNameHere"
{
	{ "<skin_0_material1>" "<skin_0_material2>" }
	{ "<skin_1_material1>" "<skin_1_material2>" }
}

Further information

  • Skin options can also be used to provide $bumpmap, $surfaceprop, etc. options for the model in each VMT. For optimization, see also $lod and LOD Models.
  • All alternative VTF textures should follow the same UV map layout.
  • One of the skins in the list must be the texture name which was in the SMD. Without this the skins will only use the texture name from the SMD, and not ones from your list.