1 つまたは複数のオブジェクトをパーティションに追加し、現在のパーティションからオブジェクトを削除します。
AddToPartition( Target, InputObjs ); |
' ' 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" |