## CreatePass

### Description

Creates a new Pass and makes it the current pass.
Note: This command uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference so you need to use the best workaround for your situation:
For scripting languages this command returns an ISIVTCollection which you can use to get the output arguments.
For C# you can use the XSIApplication.ExecuteCommand method to call this command. ExecuteCommand packs the output arguments into a C# System.Object containing an Array of the output arguments (see Calling Commands from C#).

### Scripting Syntax

    CreatePass( [PresetObj], [Name], [Value] );

### Parameters

Parameter | Type | Description
--- | --- | ---
PresetObj | String or a preset object (see SIGetPreset) | Any of the Pass Presets Default Value: "Pass" (default pass)
Name | String | Name of the new pass Default Value: Default pass name (ie., "Ambient_Pass")
Value | Pass | Returns the new pass

### Examples

#### VBScript Example

    '

    '	This example demonstrates how to create different types of passes

    '	based on pass presets. It also shows how to get a list of all

    '	passes in the scene as an XSICollection.

    '

    ' Create a new scene

    NewScene , false

    ' Print out the current list of passes

    getPassInfo

    Application.LogMessage "-------------------"

    ' Create a diffuse pass

    CreatePass InstallationPath( siFactoryPath ) _

    	& "\Data\DSPresets\Groups\Diffuse_Pass.Preset", "Different_Pass"

    ' Create a depth pass

    CreatePass InstallationPath( siFactoryPath ) _

    	& "\Data\DSPresets\Groups\Depth_Pass.Preset", "Deep_Pass"

    ' Print out the new list of passes

    getPassInfo

    function getPassInfo()

    	' We can use a string expression with a wildcard to specify all passes

    	' and then convert it to an XSICollection for easier navigation

    	Set oPasses = CreateObject( "XSI.Collection" )

    	oPasses.SetAsText "Passes.*"

    	' Loop through the passes and print their names

    	For Each p In oPasses

    		Application.LogMessage p.Name

    	Next

    end function

    ' Output of the above script (the current pass is repeated):

    'INFO : "List"

    'INFO : "Default_Pass"

    'INFO : "Default_Pass"

    'INFO : "-------------------"

    'INFO : "List"

    'INFO : "Default_Pass"

    'INFO : "Different_Pass"

    'INFO : "Deep_Pass"

    'INFO : "Deep_Pass"

### See Also

GetCurrentPass SetCurrentPass DeleteCurrentPass RenderPasses CreateLayer SICreatePass SICreatePartition SICreateLayer