$pushd and $popd: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (minor cleanup)
Line 1: Line 1:
Used to set the current working directory in a qc script.
Adds a search path for source files onto a stack. Used to set the current working directory.


==Description==
== Syntax ==


  $pushd ".\path\to\files\"
  $pushd ".\path\to\files\"


The default working directory is the folder of the .qc file. The $pushd must be met with a [[$popd]]. Multiple $pushd can be nested inside each other.
The default working directory is the folder of the .qc file. The <code>$pushd</code> must be met with a <code>[[$popd]]</code>. Multiple <code>$pushd</code> can be nested inside each other.


==Parameters==
* The path should be a full or relative path on the file system.
* The path should be a full or relative path on the file system.


==Example==
== Example ==
  $modelname "props/fan.mdl"
  $modelname "props/fan.mdl"
  $cdmaterials "models/props/"
  $cdmaterials "models/props/"
Line 19: Line 18:
  $sequence "idle" "idle.smd"
  $sequence "idle" "idle.smd"


[[Category:QC Commands]]
[[Category:QC Commands|pushd]]

Revision as of 15:56, 28 April 2008

Adds a search path for source files onto a stack. Used to set the current working directory.

Syntax

$pushd ".\path\to\files\"

The default working directory is the folder of the .qc file. The $pushd must be met with a $popd. Multiple $pushd can be nested inside each other.

  • The path should be a full or relative path on the file system.

Example

$modelname "props/fan.mdl"
$cdmaterials "models/props/"
$model "Fan" "fan.smd"
$pushd ".\new animations\"
$sequence "rotate" "rotate.smd"
$popd
$sequence "idle" "idle.smd"