$appendsource: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Document $appendsource)
 
(not all source engine games. At least CSGO, not TF2)
 
(13 intermediate revisions by 9 users not shown)
Line 1: Line 1:
The [[QC command]] '''<code>[[$appendsource]]</code>''' is used to add a new reference mesh to a model with a specified position, rotation, and scale. It is used extensively by the [[VBSP]] option <code>-staticpropcombine</code>. It is available in {{csgo}} [[Counter-Strike: Global Offensive]].
{{LanguageBar}}
{{Bug|Without a [[$body]] or [[$model]] command, the model will fail to compile!}}  


== Syntax ==
{{This is a|name=$appendsource|QC command|game=Counter-Strike: Global Offensive}} It is used to add a new reference mesh to a model with a specified position, rotation, and scale. It is used extensively with [[Static Prop Combine|VBSP's static prop combine functionality]]. It is available in {{csgo}}.
{{Bug|Without a [[$body]] or [[$model_(QC)|$model]] command, the model will fail to compile!}}


==Syntax==
  $appendsource <reference mesh> "offset pos[ <[[float]]> <[[float]]> <[[float]]> ] angle[ <[[float]]> <[[float]]> <[[float]]> ] scale[ <[[float]]> ]"
  $appendsource <reference mesh> "offset pos[ <[[float]]> <[[float]]> <[[float]]> ] angle[ <[[float]]> <[[float]]> <[[float]]> ] scale[ <[[float]]> ]"


{{Note|The scale value is independent of [[$scale]].}}
{{Note|The scale value is independent of [[$scale]].}}
{{Note|Using an extension in the reference mesh is optional. It will first try looking for an [[Studiomdl Data|SMD]], then a [[DMX model|DMX]], and then finally a [[FBX]], regardless of what the specified extension is!}}
{{Note|Using an extension in the reference mesh is optional. It will first try looking for an [[SMD]], then a [[DMX]], and then finally a [[FBX]], regardless of what the specified extension is!}}
{{Note|The syntax of the transformations must be exactly as above - even the spaces must be identical!}}
{{Note|The syntax of the transformations must be exactly as above - even the spaces must be identical!}}
 
{{Bug|When using <code>$appendsource</code> on a model using different or extra materials than the [[$body]]/[[$model_(QC)|$model]], it will use the [[$body]]/[[$model_(QC)|$model's]] materials!}}
== Example ==
== Example ==
  [[$modelname]] props/threebarrels.mdl
  [[$modelname]] props/threebarrels.mdl
Line 18: Line 19:
  [[$sequence]] "idle" "old_barrel"  
  [[$sequence]] "idle" "old_barrel"  


== See Also ==
==See also==
 
*[[$body]]
*[[$body]]
*[[$model]]
*[[$model_(QC)|$model]]
*[[$addconvexsrc]], the collision model equivalent of '''<code>[[$appendsource]]</code>'''.
*[[$collisionmodel#Options|$addconvexsrc]]

Latest revision as of 08:11, 6 August 2025

English (en)Translate (Translate)

$appendsource is a QC command available in Counter-Strike: Global Offensive Counter-Strike: Global Offensive. It is used to add a new reference mesh to a model with a specified position, rotation, and scale. It is used extensively with VBSP's static prop combine functionality. It is available in Counter-Strike: Global Offensive.

Icon-Bug.pngBug:Without a $body or $model command, the model will fail to compile!  [todo tested in ?]

Syntax

$appendsource <reference mesh> "offset pos[ <float> <float> <float> ] angle[ <float> <float> <float> ] scale[ <float> ]"
Note.pngNote:The scale value is independent of $scale.
Note.pngNote:Using an extension in the reference mesh is optional. It will first try looking for an SMD, then a DMX, and then finally a FBX, regardless of what the specified extension is!
Note.pngNote:The syntax of the transformations must be exactly as above - even the spaces must be identical!
Icon-Bug.pngBug:When using $appendsource on a model using different or extra materials than the $body/$model, it will use the $body/$model's materials!  [todo tested in ?]

Example

$modelname props/threebarrels.mdl
$scale 6.500
$body body "old_barrel"
$appendsource "old_barrel" "offset pos[ -29.564 12.246 0.000 ] angle[ -0.000 -22.500 0.000 ] scale[ 6.500 ]"
$appendsource "old_barrel.dmx" "offset pos[ -12.246 -29.564 0.000 ] angle[ -0.000 -22.500 0.000 ] scale[ 6.500 ]"
$sequence "idle" "old_barrel" 

See also