CreatePartition

詳細

新しいオブジェクトまたはライト パーティションを作成し、指定したオブジェクトを追加します。

注: このコマンドは、出力引数を使用します。C# および一部のスクリプト言語(JScript、PerlScript、Python など)は、リファレンスによって渡される引数をサポートしていません。このため、状況に応じた適切な回避策を実行する必要があります。

スクリプト言語の場合、このコマンドは出力引数を取得するために使用できる ISIVTCollection を戻します。

C# の場合は、XSIApplication.ExecuteCommand メソッドを使用してこのコマンドを呼び出すことができます。ExecuteCommand は、出力引数を C# の System.Object (出力引数の Array を含む)にパック化します(詳細については、「C# からのコマンドの呼び出し」を参照)。

スクリプト構文

CreatePartition( [Target], [Name], [InputObjs], [Value] );

パラメータ

パラメータ タイプ 説明
Target 文字列 パーティションに割り当てるパス

デフォルト値: 現在のパス

Name 文字列 新しいパーティションの名前

デフォルト値: 「Partition」

InputObjs 文字列 パーティションに追加するオブジェクトのリスト

デフォルト値: 選択されたオブジェクト

Value Group オブジェクトを含む XSICollection 新しいパーティションを戻します。

VBScript の例

'

'	This example demonstrates how to create a partition with

'	an object in 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 light partition to the pass with a light in it

CreatePartition oPass, "Sweet_Sorrow", "Light", oLightPart

' 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"

関連項目

RenderPasses CreateLayer CreatePass GetCurrentPass SetCurrentPass DeleteCurrentPass SICreatePartition SICreateLayer CreateEmptyPartition