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

$modelname: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(38 intermediate revisions by 15 users not shown)
Line 1: Line 1:
The [[QC command]] [[$modelname]] is used to specify the filepath and filename of the compiled model.  
{{LanguageBar}}
{{tabsBar|main=gs|base=$modelname}}
{{this is a|QC command|name=$modelname}}
It is required, as it specifies the path and filename of the compiled model.


==QC syntax==
* In {{gldsrc|4}}, this is either a relative path (relative to [[$cd]]) or an absolute path. Absolute paths must be encapsulated in quotes, but relative paths do not.
$modelname "<filepath>/<filename>.mdl"
* In {{src|4}}, this is always a relative path, relative to the <code>\models</code> folder of [[Game Directory|the mod]].  
where
 
; <filepath>
{{note|[[Studiomdl]] builds prior to Alien Swarm's won't create folders that don't exist. The path specified by <code>$modelname</code> must exist before compiling begins. {{crowbar|2}} handles this automatically.}}
: is relative to the <code>mod_name/models/</code> directory. If omitted, the file will be created in the <code>models/</code> directory.
 
; <filename>
{{bug|hidetested=y|In {{as}} Alien Swarm, models compiled into the root <code>\models</code> folder cannot be loaded.}}
: is the name of the compiled .mdl file.


==Example==
==Example==
  '''$modelname "weapons/shell.mdl"'''
  '''$modelname "weapons/shell.mdl"'''
  $cdmaterials "models/weapons/"
   
  $model "Shell" "shell.smd"
[[$staticprop]]
  $sequence "idle" "shell.smd"
[[$body]] body "shell"
[[$cdmaterials]] "models\weapons\"
   
[[$sequence]] idle "shell_anim_@idle"
   
[[$collisionmodel]] "shell_physics"
 
This model will be created at <code><game path>\models\weapons\shell.mdl</code>.


[[Category:QC Commands]]
[[Category:Modeling]]
[[Category:Source]]

Latest revision as of 21:39, 18 July 2025

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

$modelname is a QC command available in all Source Source games. It is required, as it specifies the path and filename of the compiled model.

  • In GoldSrc GoldSrc, this is either a relative path (relative to $cd) or an absolute path. Absolute paths must be encapsulated in quotes, but relative paths do not.
  • In Source Source, this is always a relative path, relative to the \models folder of the mod.
Note.pngNote:Studiomdl builds prior to Alien Swarm's won't create folders that don't exist. The path specified by $modelname must exist before compiling begins. Crowbar Crowbar handles this automatically.
Icon-Bug.pngBug:In Alien Swarm Alien Swarm, models compiled into the root \models folder cannot be loaded.

Example

$modelname		"weapons/shell.mdl"

$staticprop

$body		body	"shell"

$cdmaterials		"models\weapons\"

$sequence	idle	"shell_anim_@idle"

$collisionmodel		"shell_physics"

This model will be created at <game path>\models\weapons\shell.mdl.