GetPrim

詳細

ロー プリミティブ(まっさらなプリミティブ)を作成します。このコマンドは、ジオメトリ オブジェクトに対しインプリシット ジオメトリ オブジェクトを作成します。また、カメラ、ライト、ヌル、コントロール オブジェクト、ラティス、ジオメトリ シェーダなど、他の種類のプリミティブを作成することも可能です。 作成されたプリミティブは選択されます。

GetPrim はプリミティブを作成します。GetPrim という名前は、Softimage の Get-Primitive- メニューから取られています。.

注: このコマンドは、出力引数を使用します。C# および一部のスクリプト言語(JScript、PerlScript、Python など)は、リファレンスによって渡される引数をサポートしていません。通常、出力引数は XSIApplication.ExecuteCommand メソッド(C#)または ISIVTCollection (スクリプト言語)を介して取得できますが、このコマンドはすでに値を返しています。

この場合の唯一の回避策は、出力引数と戻り値の両方を 1 つの配列で戻す VBScript のカスタム コマンドを作成することです。詳細については、「関数がすでに値を戻している場合の処理について」を参照してください。

スクリプト構文

oReturn = GetPrim( PresetObj, [Name], [Parent], [Primitive] );

戻り値

プリミティブに対して作成された 3D オブジェクト(通常は X3DObject オブジェクト)を戻します。

パラメータ

パラメータ タイプ 説明
PresetObj String またはプリセット オブジェクト(「SIGetPreset」を参照) プリミティブ プリセットの名前。 サポートされているプリセット名のリストについては、「インプリシット プリミティブ」および「ジオメトリ プリミティブ」を参照してください。
Name 文字列 新しいプリミティブの名前
Parent 文字列 既存のオブジェクトの名前。新しいプリミティブの親として使用されます。
Primitive Primitive インプリシット プリミティブを戻します。

例

VBScript の例

'This example creates two primitives

newscene

dim preset, object, primitive

'Create an implicit sphere. Name it.

set object = GetPrim( "Sphere", "MySphere" , , primitive )

'Logged information:

'INFO : "Sphere information"

'INFO : "X3DObject, MySphere"

'INFO : "Primitive, Sphere"

LogMessage "Sphere information"

LogMessage TypeName( object ) & ", " & object.name

LogMessage TypeName( primitive ) & ", " & primitive.name

'Create an implicit cone. Name it and make it child of MySphere

set object = GetPrim( "Cone", "MyCone" ,"MySphere" , primitive )

'Logged information:

'INFO : "Cone information"

'INFO : "X3DObject, MyCone"

'INFO : "Primitive, Cone"

LogMessage "Cone information"

LogMessage TypeName( object ) & ", " & object.name

LogMessage TypeName( primitive ) & ", " & primitive.name

' Create primitive using preset selected by user (Will pop UI for selection)

set preset = SIGetPreset( "Primitives" )

set object = GetPrim( preset, , , primitive )

'Logged information, here we selected a square.

'INFO : "Your primitive's information"

'INFO : "X3DObject, square"

'INFO : "Primitive, Square"

LogMessage "Your primitive's information"

LogMessage TypeName( object ) & ", " & object.name

LogMessage TypeName( primitive ) & ", " & primitive.name

関連項目

CreatePrim SIGetPrim