AddToPartition
 
 
 

AddToPartition

Description

Adds one or more objects to a partition and remove them from the current partition.

Scripting Syntax

AddToPartition( Target, InputObjs );

Parameters

Parameter Type Description
Target String Partition to add the objects to.
InputObjs String List of objects to add to the partition.

Examples

VBScript Example

'
'       This example demonstrates how to create an empty partition
'       and then add an object to it. It also shows how you can 
'       access partition information from a particular pass.
'
' Create a new scene 
NewScene , false
' Create a cone to add to one of the partitions
Set oCone = GetPrim( "Cone", "MeshSurface" )
' Create a standard (default) pass 
CreatePass , "PassMeBy", oPass
' Print partition info for default pass
getPartInfo oPass
' Now add an empty light partition to the pass and add the light to it
SICreateEmptyPartition oPass, "Sweet_Sorrow", siLightPartition, oLightPart
AddToPartition oLightPart(0), "Light"
' Print new partition info 
getPartInfo oPass
function getPartInfo( in_pass )
        Application.LogMessage "Partitions for " & in_pass & ":"
        Application.LogMessage "--------------------------------"
        ' Create an XSICollection with the partition info
        set oParts = CreateObject( "XSI.Collection" )
        oParts.SetAsText in_pass & ".Partitions.*" 
        For Each p In oParts
                Application.LogMessage p
        Next
end function
' Output of the above script:
'INFO : "Partitions for Passes.PassMeBy:"
'INFO : "--------------------------------"
'INFO : "Passes.PassMeBy.Background_Objects_Partition"
'INFO : "Passes.PassMeBy.Background_Lights_Partition"
'
'INFO : "Partitions for Passes.PassMeBy:"
'INFO : "--------------------------------"
'INFO : "Passes.PassMeBy.Background_Objects_Partition"
'INFO : "Passes.PassMeBy.Background_Lights_Partition"
'INFO : "Passes.PassMeBy.Sweet_Sorrow"

See Also

CreateEmptyPartition MoveToPartition RemoveFromPartition CreatePassWithPartition