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

QC: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Remove $staticprop from the example (This is pretty much only used exclusively for prop_static entities, and causes confusion among new model makers until someone corrects them why their bones aren't working.))
 
(28 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{lang|QC}}
{{LanguageBar}}
{{gldsrc topicon}}{{source topicon}}


:''For a list of '''QC commands''', see [[:Category:QC Commands]].''
:''For a list of '''QC commands''', see [[:Category:QC Commands]].''
:''To learn how to  '''compile a model''', see [[Compiling a model]].''
:''To learn how to  '''compile a model''', see [[Compiling a model]].''


A '''QC''' file is a script which controls the process of compiling [[Studiomdl Data|SMD]]s into a binary [[model]] that can be loaded into a game.  
A '''QC''' file is a script which controls the process of "compiling" [[SMD]]s into a binary [[model]] that can be loaded into a game.  
A QC configures the model's location and name, which SMD files are used to provide geometry, [[collision mesh]]es and [[skeletal animation|animation]]s, how the model reacts when shot, and so on.
A QC configures the model's location and name, while SMD files are used to provide geometry, [[collision mesh]]es and [[skeletal animation|animation]]s, how the model reacts when shot, and so on.


Comments can be lines starting with <code>//</code>, <code>#</code> or <code>;</code>, or blocks contained between <code>/*</code> and <code>*/</code>.
Comments can be ends of lines starting with <code>//</code>, or blocks contained between <code>/*</code> and <code>*/</code>. Source additionally supports end of line comments starting with <code>#</code> or <code>;</code>.  


{{tip|Shared QC files intended for use with {{ent|$include}} are typically given the extension <code>qci</code>.}}
Paths usually can contain a combination of either forward or backslashes, except for {{jbep3}}, which requires forward slashes due to adding support for {{w|escape sequence|escape sequences}} in QC files (due to shared code between [[VBSP]] and StudioMDL).


== Example ==
{{note|Although the "QC" file extension is derived from the [[QuakeC]] programming language used by {{quake|4.1}}, the syntax of StudioMDL QC files is significantly modified from the {{w|C (programming language)|C}}-like syntax used by QuakeC.}}
Here is a very simple QC file for a solid model without any animation or special properties (click on each command for details):
{{tip|Shared QC files intended for use with {{ent|$include}} are typically given the extension {{code|qci}}, and outdated or deprecated QC files are typically given the extension {{code|qcx}}. This prevents them from attempting to be compiled when batch-compiling an entire folder. }}


[[$modelname]] "props_sdk\myfirstmodel.mdl"
== Simple example ==
[[$body]] mybody "myfirstmodel-ref.smd"
Here is a very simple {{src|2}} QC file for a solid model without any animation or special properties (click on each command for details):


[[$modelname]] "props_sdk/myfirstmodel.mdl"
[[$body]] mybody "myfirstmodel-ref"
  [[$surfaceprop]] combine_metal
  [[$surfaceprop]] combine_metal
  [[$cdmaterials]] "models\props_sdk"
  [[$cdmaterials]] "models/props_sdk"
   
   
  [[$sequence]] idle "myfirstmodel-ref.smd" // no animation wanted, so re-using the reference mesh
  [[$sequence]] idle "myfirstmodel-ref" // no animation wanted, so re-using the reference mesh
   
   
  [[$collisionmodel]] "myfirstmodel-phys.smd" { $concave }
  [[$collisionmodel]] "myfirstmodel-phys" { $concave } // can be omitted if no collision is needed


== See Also ==
Likewise, for {{goldsrc|2}}:
 
[[$modelname (GoldSrc)|$modelname]] "myfirstmodel.mdl"
[[$cd (GoldSrc)|$cd]] "." // look for SMDs in the same directory as the QC
[[$cdtexture (GoldSrc)|$cdtexture]] "." // look for BMPs in the same directory as the QC
[[$body (GoldSrc)|$body]] mybody "myfirstmodel-ref"
[[$sequence (GoldSrc)|$sequence]] idle "myfirstmodel-ref" // no animation wanted, so re-using the reference mesh
 
{{note|The {{code|.smd}} file extension should usually be omitted from mesh and animation file names. Including it will cause {{goldsrc}} [[StudioMDL]] to fail to load the file.
{{src}} StudioMDL automatically looks for files in this order when no extension is present:
:{{src13}} [[VRM]],  [[SMD]], [[SMA]] (SMD), [[PHYS]] (SMD), [[VTA]], [[OBJ]], [[DMX]], [[w:XML|XML]] (DMX)
:{{csgobranch}} [[FBX]], [[VRM]], [[DMX]], [[MPP]] (DMX), [[SMD]], [[SMA]] (SMD), [[PHYS]] (SMD), [[VTA]], [[OBJ]], [[w:XML|XML]] (DMX), [[FBX]]
}}
 
== File format ==
{{todo}}
 
== Files ==
{{todo}}
 
== See also ==
* [[:Category:QC Commands]]
* [[:Category:QC Commands]]
* [[Compiling a model]]
* [[Compiling a model]]
Line 31: Line 55:
* [[Notepad++ VDF languages]]
* [[Notepad++ VDF languages]]
* [[Highlighting and Compiling QCs with ConTEXT]]
* [[Highlighting and Compiling QCs with ConTEXT]]
[[Category:Modeling]][[Category:Glossary]]
 
[[Category:Modeling]]
[[Category:Plain text formats]]
 
 
{{stub}}

Latest revision as of 11:42, 24 May 2025

English (en)日本語 (ja)Русский (ru)Translate (Translate)

For a list of QC commands, see Category:QC Commands.
To learn how to compile a model, see Compiling a model.

A QC file is a script which controls the process of "compiling" SMDs into a binary model that can be loaded into a game. A QC configures the model's location and name, while SMD files are used to provide geometry, collision meshes and animations, how the model reacts when shot, and so on.

Comments can be ends of lines starting with //, or blocks contained between /* and */. Source additionally supports end of line comments starting with # or ;.

Paths usually can contain a combination of either forward or backslashes, except for Jabroni Brawl: Episode 3, which requires forward slashes due to adding support for Wikipedia icon escape sequences in QC files (due to shared code between VBSP and StudioMDL).

Note.pngNote:Although the "QC" file extension is derived from the QuakeC programming language used by Quake Quake, the syntax of StudioMDL QC files is significantly modified from the Wikipedia icon C-like syntax used by QuakeC.
Tip.pngTip:Shared QC files intended for use with $include are typically given the extension qci, and outdated or deprecated QC files are typically given the extension qcx. This prevents them from attempting to be compiled when batch-compiling an entire folder.

Simple example

Here is a very simple Source Source QC file for a solid model without any animation or special properties (click on each command for details):

$modelname	"props_sdk/myfirstmodel.mdl"
$body mybody	"myfirstmodel-ref"

$surfaceprop	combine_metal
$cdmaterials	"models/props_sdk"

$sequence idle	"myfirstmodel-ref" // no animation wanted, so re-using the reference mesh

$collisionmodel	"myfirstmodel-phys" { $concave } // can be omitted if no collision is needed

Likewise, for GoldSrc GoldSrc:

$modelname	"myfirstmodel.mdl" 
$cd		"." // look for SMDs in the same directory as the QC
$cdtexture	"." // look for BMPs in the same directory as the QC
$body mybody	"myfirstmodel-ref"
$sequence idle	"myfirstmodel-ref" // no animation wanted, so re-using the reference mesh
Note.pngNote:The .smd file extension should usually be omitted from mesh and animation file names. Including it will cause GoldSrc StudioMDL to fail to load the file.

Source StudioMDL automatically looks for files in this order when no extension is present:

Source 2013 VRM, SMD, SMA (SMD), PHYS (SMD), VTA, OBJ, DMX, XML (DMX)
CS:GO engine branch FBX, VRM, DMX, MPP (DMX), SMD, SMA (SMD), PHYS (SMD), VTA, OBJ, XML (DMX), FBX

File format

[Todo]

Files

[Todo]

See also


Stub

This article or section is a stub. You can help by expanding it.