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

$includemodel: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Put it in the "I" letter of the QC Commands category content list.)
No edit summary
 
(7 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The [[$includemodel]] [[QC command]] is used to add an [[MDL]] file that this model will include at run-time. All new sequences and animations will be appended to the model.  
{{this is a|QC command|name=$includemodel}} It is used to add an [[MDL]] file that this model will include at run-time. All new sequences and animations will be appended to the model.


* Animations and sequences are processed in-order, so subsequent animations/sequences that have name conflicts will be ignored, and any references to .mdl local entry by the same name will be overwritten with the reference to a first one declared.  
* Animations and sequences are processed in-order, so subsequent animations/sequences that have name conflicts will be ignored, and any references to .mdl local entry by the same name will be overwritten with the reference to a first one declared.
 
* Included .mdl's can have different bone ordering, but they need to have the same bone hierarchy and ikchain declarations. Currently there's no run-time checking to verify they match.
* Included .mdl’s can have different bone ordering, but they need to have the same bone hierarchy and ikchain declarations. Currently there’s no run-time checking to verify they match.
* Using $Includemodel will copy [[$animation]], [[$sequence]], [[$attachment]] and [[$collisiontext]] data. Models, Textures, Faces and other data are ignored.
 
* Only animations and sequences are used from included .mdls. Currently models, textures, faces, attachments, etc. are ignored.  


== Example ==
== Example ==
* This overwrites the normal police animations with a pointer to the shared animations
* This creates a viewmodel for the {{l4d2}} ''[[l4d2|Left 4 Dead 2]]'' Boomer's hands, while taking the animations from ''anims_v_claw_Boomer.mdl''.
[[$modelname]]     Police_animations.mdl
{{note|$includemodel only points to the [[MDL]] file containing the animations to be used. It does not copy animations from that model and paste it into yours.<br>
[[$includemodel]] "player\male_anims.mdl"
The model used in the $includemodel line ''must'' exist, otherwise the game cannot give your MDL animations.}}
 
<syntaxhighlight lang=text highlight=3>
{{note| For clarification, [[$includemodel]] simply points to the [[MDL]] file containing the animations and does not copy any data to the files created on compile. The file containing the animations must be available from the file location that is defined for it to work. In this example it will be 'models\player\male_anims.mdl'.}}
$modelname "v_models\weapons\v_claw_Boomer.mdl"
 
$model "hands" "v_Boomer_Hands_l4d2.smd"
[[Category:QC Commands|i]]
$includemodel "v_models/weapons/anims_v_claw_Boomer.mdl"
</syntaxhighlight>

Latest revision as of 21:12, 18 July 2025

$includemodel is a QC command available in all Source Source games. It is used to add an MDL file that this model will include at run-time. All new sequences and animations will be appended to the model.

  • Animations and sequences are processed in-order, so subsequent animations/sequences that have name conflicts will be ignored, and any references to .mdl local entry by the same name will be overwritten with the reference to a first one declared.
  • Included .mdl's can have different bone ordering, but they need to have the same bone hierarchy and ikchain declarations. Currently there's no run-time checking to verify they match.
  • Using $Includemodel will copy $animation, $sequence, $attachment and $collisiontext data. Models, Textures, Faces and other data are ignored.

Example

  • This creates a viewmodel for the Left 4 Dead 2 Left 4 Dead 2 Boomer's hands, while taking the animations from anims_v_claw_Boomer.mdl.
Note.pngNote:$includemodel only points to the MDL file containing the animations to be used. It does not copy animations from that model and paste it into yours.
The model used in the $includemodel line must exist, otherwise the game cannot give your MDL animations.
$modelname "v_models\weapons\v_claw_Boomer.mdl"
$model "hands" "v_Boomer_Hands_l4d2.smd" 
$includemodel "v_models/weapons/anims_v_claw_Boomer.mdl"