$unlockdefinebones: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
($unlockdefinebones)
 
No edit summary
Line 1: Line 1:
Normally, the [[$definebone]] definitions are always used for the default positions and rotations of the skeleton. Setting [[$unlockdefinebones]] will instead use the first definition found in any of the source files specified in the QC.
Normally, the [[$definebone]] definitions are always used for the default positions and rotations of the skeleton. Setting [[$unlockdefinebones]] will instead use the bone positions of the first frame in the '''last defined smd/dmx file''' of the qc for the definebone values.<br>
$Unlockdefinebones will not shuffle the order of the $definebone lines, unlike the studiomdl command '''-definebones''' would.<br>
{{tip|If you define your [[$model]], [[$body]], or [[$bodygroup]] at the very end of the qc, ''or at least below the [[$animation]] and [[$sequence]]'', you will generate new definebones based on your new ref pose without shuffling the definebone order.<br>This would be very useful for viewmodels that have arms and weapon separated, where a different definebone order causes issues. Such as in {{l4d2|4}}}}


{{note|This behavior is the opposite of the default behavior in previous versions of the model compiler. For Half-Life 2: Episode Two, the default behavior was changed to stop the more common undesirable effect of animation order messing up default locations of bones - such as those used by attachments - that were only actually defined in a small subset of the source files. The drawback is that some badly exported LOD models - ones whose skeletons don't match their actual pose since they're no longer attached - now will show the previously hidden errors. Setting [[$unlockdefinebones]] will get the old behavior back.}}
{{note|This behavior is the opposite of the default behavior in previous versions of the model compiler. For Half-Life 2: Episode Two, the default behavior was changed to stop the more common undesirable effect of animation order messing up default locations of bones - such as those used by attachments - that were only actually defined in a small subset of the source files. The drawback is that some badly exported LOD models - ones whose skeletons don't match their actual pose since they're no longer attached - now will show the previously hidden errors. Setting [[$unlockdefinebones]] will get the old behavior back.}}

Revision as of 14:34, 30 March 2024

Normally, the $definebone definitions are always used for the default positions and rotations of the skeleton. Setting $unlockdefinebones will instead use the bone positions of the first frame in the last defined smd/dmx file of the qc for the definebone values.
$Unlockdefinebones will not shuffle the order of the $definebone lines, unlike the studiomdl command -definebones would.

Tip.pngTip:If you define your $model, $body, or $bodygroup at the very end of the qc, or at least below the $animation and $sequence, you will generate new definebones based on your new ref pose without shuffling the definebone order.
This would be very useful for viewmodels that have arms and weapon separated, where a different definebone order causes issues. Such as in Left 4 Dead 2 Left 4 Dead 2
Note.pngNote:This behavior is the opposite of the default behavior in previous versions of the model compiler. For Half-Life 2: Episode Two, the default behavior was changed to stop the more common undesirable effect of animation order messing up default locations of bones - such as those used by attachments - that were only actually defined in a small subset of the source files. The drawback is that some badly exported LOD models - ones whose skeletons don't match their actual pose since they're no longer attached - now will show the previously hidden errors. Setting $unlockdefinebones will get the old behavior back.

Syntax

$unlockdefinebones