
v3.0
接続されているオブジェクト(KinematicState や
Primitive
など)を戻します。オブジェクトの名前またはパスへのアクセスに使用できます。カスタムオペレータの_Update関数を使用している場合は他の出力ポートにもアクセスできますが、これは推奨しません。また、結果も保証されません。カスタムオペレータの_Update関数を使用している場合は、その関数の引数を通して使用できる現在のOutputPortオブジェクトのほか、任意のInputPortオブジェクトにアクセスできます。
Port.Target2 は、Port.Targetを戻すにProjectItem代わるものです(以前はParameterオブジェクトなどの ProjectItem
以外のオブジェクトにはアクセスできませんでした)。
'
' This example demonstrates how to find the object connected to the input port for a built-in Softimage operator
'
' Add a cube to the scene and apply the edge operator
set oRoot = Application.ActiveProject.ActiveScene.Root
set oObject = oRoot.AddGeometry( "Cube", "MeshSurface" )
AddEdge oObject.FullName & ".pnt[LAST];" & oObject.FullName & ".edge[1]", 21.019
' Find the operator in the stack
set oOperator = oObject.ActivePrimitive.ConstructionHistory.Find( "addedgeop" )
if TypeName(oOperator) <> "Nothing" then
' Find the input primitive
for each oInputPort in oOperator.InputPorts
set oTarget = oInputPort.Target2
if TypeName( oTarget ) = "Primitive" then
Application.LogMessage "addedge operator is reading from the primitive"
end if
next
else
Application.LogMessage "cannot find operator"
end if
|