$scale: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
{{note|<code>$scale</code> also accepts negative values. This can be used to flip/mirror animations or models if the compiled model is then decompiled. Note that the model's normals will be inverted and will be rotated 180 degrees backwards, this can be easily fixed in a Source engine compatible model editor or by using the <code>angles</code> parameter in a [[$sequence]] block.}}
{{note|<code>$scale</code> also accepts negative values. This can be used to flip/mirror animations or models if the compiled model is then decompiled. Note that the model's normals will be inverted and will be rotated 180 degrees backwards, this can be easily fixed in a Source engine compatible model editor or by using the <code>angles</code> parameter in a [[$sequence]] block.}}
{{note|<code>[[$definebone]]</code> will cause the defined bone, and the vertices assigned to it, to be scaled from their defined local position instead of the model file's origin.}}
{{note|<code>[[$definebone]]</code> will cause the defined bone, and the vertices assigned to it, to be scaled from their defined local position instead of the model file's origin.}}
{{warning|<code>$scale</code> prevents [[flex animation]] from working when using the VTA format. This limitation can be bypassed by using the [[DMX]] format.}}
{{warning|<code>$scale</code> prevents [[flex animation]] from working when using the [[VTA format. This limitation can be bypassed by using the [[DMX]] format.}}


Sequences or animations can be scaled individually by specifying the "scale" option, see below for an example.
Sequences or animations can be scaled individually by specifying the "scale" option, see below for an example.
Line 16: Line 16:
$cdmaterials "models/weapons/"
$cdmaterials "models/weapons/"


$scale 3 // before any model files such as SMD, DMX or FBX ({{csgo}} only)
$scale 3 // before any model files such as SMD or DMX)
$body shell "shell_ref.smd"
$body shell "shell_ref.smd"
$sequence idle "shell_idle.smd"
$sequence idle "shell_idle.smd"

Revision as of 14:51, 18 January 2019

The $scale QC command multiplies the size of all subsequent model files. It does not affect values defined in the QC itself (e.g. $attachment locations).

Note.pngNote:$scale only affects model files that come after it in the QC. Specify it before any file references!
Note.pngNote:$scale also accepts negative values. This can be used to flip/mirror animations or models if the compiled model is then decompiled. Note that the model's normals will be inverted and will be rotated 180 degrees backwards, this can be easily fixed in a Source engine compatible model editor or by using the angles parameter in a $sequence block.
Note.pngNote:$definebone will cause the defined bone, and the vertices assigned to it, to be scaled from their defined local position instead of the model file's origin.

{{warning|$scale prevents flex animation from working when using the [[VTA format. This limitation can be bypassed by using the DMX format.}}

Sequences or animations can be scaled individually by specifying the "scale" option, see below for an example.

Confirm:Do negative values work properly?
Confirm:Does $scale influence this?

Example

$scale

$modelname		"weapons/shell.mdl"
$cdmaterials	"models/weapons/"

$scale		3		// before any model files such as SMD or DMX)
$body		shell	"shell_ref.smd"
$sequence	idle	"shell_idle.smd"

$sequence scale

$sequence spin fan_spin.smd {
        fps 30
	scale 3
}