'
' This example demonstrates how to set the current pass. It also
' shows how to get a collection of all passes in the scene.
'
' Create a new scene
NewScene , false
' Create a few dummy passes to play with
CreatePass , "Sneezy"
CreatePass , "Grumpy"
CreatePass , "Wimpy"
' Which one is the current pass and what type of object is it?
Set oPass = GetCurrentPass
Application.LogMessage oPass.Name & " is the current pass."
' Get the collection of all passes in the scene
Set oPassList = CreateObject( "XSI.Collection" )
oPassList.SetAsText "Passes.*"
' Loop through the collection to get the one named "Sneezy"
For Each p In oPassList
If p.Name = "Sneezy" Then
Set oNewPass = p
Exit For
End If
Next
' Change the current pass to Sneezy
SetCurrentPass oNewPass
' Which one is the current pass and what type of object is it?
Set oPass = GetCurrentPass
Application.LogMessage oPass.Name & " is the current pass."
' Output of above script:
'INFO : "Wimpy is the current pass."
'
'INFO : "Sneezy is the current pass."
|