$attachment: Difference between revisions
Jump to navigation
Jump to search
Trigger hurt (talk | contribs) m (Fix first line to improve legibility) |
(Removing deprecated Category) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{LanguageBar}} | {{LanguageBar}} | ||
{{tabsBar|main=gs|base=$attachment}} | |||
{{this is a|QC command|name=$attachment}} It defines attachments on a model. Attachments are identified by their name, and can be either relative to the model's origin or [[parent]]ed to a [[bone]]. | {{this is a|QC command|name=$attachment}} It defines attachments on a model. Attachments are identified by their name, and can be either relative to the model's origin or [[parent]]ed to a [[bone]]. | ||
Line 13: | Line 14: | ||
: Parented to the model's origin. The offset is still relative to the given parent bone, however! | : Parented to the model's origin. The offset is still relative to the given parent bone, however! | ||
; <code>rigid</code> | ; <code>rigid</code> | ||
: Declares that the bone this attachment is parented to will not move, allowing Studiomdl to | : Declares that the bone this attachment is parented to will not move, allowing Studiomdl delete that bone. The attachment will be re-parented to the next bone in the hierarchy. Useful for precise attachment placement without keeping useless bones. | ||
; <code>rotate</code> | ; <code>rotate</code> | ||
: Rotates the attachment, in degrees, relative to its parent bone / the origin. | : Rotates the attachment, in degrees, relative to its parent bone / the origin. | ||
Line 30: | Line 31: | ||
Relative to origin (no bone name required): | Relative to origin (no bone name required): | ||
$attachment "nozzle" "" 0 4.8 0 absolute | $attachment "nozzle" "" 0 4.8 0 absolute | ||
Latest revision as of 21:06, 16 July 2025
$attachment
is a QC command available in all Source games. It defines attachments on a model. Attachments are identified by their name, and can be either relative to the model's origin or parented to a bone.
See also Attachments.
Syntax
$attachment <string|name> <string|parent bone> <Vector|offset> [absolute] [rigid] [rotate <angle|orientation>]
The optional commands are:
absolute
- Parented to the model's origin. The offset is still relative to the given parent bone, however!
rigid
- Declares that the bone this attachment is parented to will not move, allowing Studiomdl delete that bone. The attachment will be re-parented to the next bone in the hierarchy. Useful for precise attachment placement without keeping useless bones.
rotate
- Rotates the attachment, in degrees, relative to its parent bone / the origin.
- Todo: There is some weirdness in how the value is interpreted by Studiomdl.
world_align
- flag the attachment as should align to world and not to it own root. Todo: this need more test.
x_and_z_axes
- alike
rotate
but only Y axis remain at default value. - Todo: Need test. Why this exists? looks useless
Examples
Relative to bone:
$attachment "anim_attachment_RH" "ValveBiped.Anim_Attachment_RH" -0.00 -0.00 0.00 rotate -90.00 -90.00 0.00
Relative to origin (no bone name required):
$attachment "nozzle" "" 0 4.8 0 absolute