Difference between revisions of "$staticprop"

From Valve Developer Community
Jump to: navigation, search
(usage - more accurate info)
Line 1: Line 1:
$staticprop
+
The [[QC command]] '''<code>$staticprop</code>''' specifies that the model being compiled does not have any moving parts. This allows several useful optimisations to take place, so should be used whenever possible.
* Models where $staticprop has been used may be placed as [[prop_static]] entities, or as [[prop_physics]] (if they also have physics data and a collision mesh). Note, despite the name, models compiled with $staticprop do not always need to be used as prop_statics.
+
 
* Causes all bones to be collapsed in the object; this can only be used when there’s no animation associated with the object, and no ragdoll behavior.  
+
{{note|The command does ''not'' have anything to do with [[prop_static]].}}
* This should be used for every non-animating, non-ragdoll prop, as it increases the render speed for the model. You want to use it wherever possible though, because it will make the models render more quickly.
+
 
* This will also cause the model's shadow to be generated from its collision model when the map is compiled.
+
== Effects ==
* For example:
+
 
  $modelname "props/rock.mdl"
+
* Collapses all bones
$cdmaterials "models/props/"
+
* Allows [[Vrad|VRAD]] to cast shadows using the collision model
$model "Rock" "rock.smd"
+
* {{todo|Other?}}
$sequence "idle" "rock.smd"
+
 
 +
== QC syntax example==
 +
 
 +
  [[$modelname]] "weapons/shell.mdl"
 
  '''$staticprop'''
 
  '''$staticprop'''
 +
[[$cdmaterials]] "models/weapons/"
 +
[[$body]] shell "shell-ref.smd"
 +
[[$sequence]] idle "shell-idle.smd" ''// A default animation is still required''
 +
 +
Note how the command does not accept any parameters.
  
 
[[Category:QC Commands]]
 
[[Category:QC Commands]]

Revision as of 08:00, 26 April 2008

The QC command $staticprop specifies that the model being compiled does not have any moving parts. This allows several useful optimisations to take place, so should be used whenever possible.

Note:The command does not have anything to do with prop_static.

Effects

  • Collapses all bones
  • Allows VRAD to cast shadows using the collision model
  • To do: Other?

QC syntax example

$modelname		"weapons/shell.mdl"
$staticprop
$cdmaterials		"models/weapons/"
$body		shell	"shell-ref.smd"
$sequence	idle	"shell-idle.smd"	// A default animation is still required

Note how the command does not accept any parameters.