This article's documentation is for anything that uses the Source engine. Click here for more information.

$cdmaterials: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
(35 intermediate revisions by 15 users not shown)
Line 1: Line 1:
Used to provide directories for the game to search for the models materials.
{{LanguageBar|title = $cdmaterials}}
{{src topicon}}
{{tabsBar|main=$cdmaterials}}
{{this is a|QC command|name=$cdmaterials}}
It defines the folders in which the game will search for the model's [[material]]s (subfolders are not searched). Each path is relative to <code><game>/materials/</code>.


==Description==
It is traditional to specify the <code>models/</code> subfolder before any others, to prevent the materials from appearing in Hammer.


$cdmaterials (directory) [(directory) (directory) ...]
{{tip|Material ''filenames'' are defined by the [[reference mesh]] (<code>[[$body]]</code> or <code>[[$model]]</code>).}}
{{tip|By default, models can have ''no more than'' 32 different material search paths.}}


{{modernConfirm|It appears that if this parameter is null ({{code|$cdmaterials ""}}), then the full file path is written from the source [[SMD]] files. This behavior can be observed in the version of Propper that is integrated into older versions of [[Hammer++]].}}


== Syntax ==


==Parameters==
$cdmaterials <path> <path 2> [...]
* (directory) The directories should be relative to the mod materials/ directory and will be embedded directly in the .mdl file. If the materials resides in multiple folder the command can either be stated multiple times or have multple directory parameters. The path should be douple quoted.
Multiple $cdmaterials lines can also be used, like so
$cdmaterials <path1>
$cdmaterials <path2>


==Example==
== Example ==
$modelname "weapons/shell.mdl"<br />
 
'''$cdmaterials "models/weapons/"'''<br />
[[$modelname]] "weapons/shell.mdl"
$model "Shell" "shell.smd"<br />
'''[[$cdmaterials]] "models/weapons/"'''
$sequence "idle" "shell.smd"
[[$body]] shell "shell_ref"
[[$sequence]] idle "shell_idle"

Latest revision as of 21:17, 16 July 2025

English (en)한국어 (ko)Русский (ru)Translate (Translate)

edit

$cdmaterials is a QC command available in all Source Source games. It defines the folders in which the game will search for the model's materials (subfolders are not searched). Each path is relative to <game>/materials/.

It is traditional to specify the models/ subfolder before any others, to prevent the materials from appearing in Hammer.

Tip.pngTip:Material filenames are defined by the reference mesh ($body or $model).
Tip.pngTip:By default, models can have no more than 32 different material search paths.
Confirm:It appears that if this parameter is null ($cdmaterials ""), then the full file path is written from the source SMD files. This behavior can be observed in the version of Propper that is integrated into older versions of Hammer++.

Syntax

$cdmaterials <path> <path 2> [...]

Multiple $cdmaterials lines can also be used, like so

$cdmaterials <path1>
$cdmaterials <path2>

Example

$modelname		"weapons/shell.mdl"
$cdmaterials		"models/weapons/"
$body		shell	"shell_ref"
$sequence	idle	"shell_idle"