ConstructionHistory.Find

ConstructionHistory.Find

説明

オブジェクトのコンストラクションヒストリから、特定のタイプのオペレータを検索します。

C#構文

Operator ConstructionHistory.Find( String in_filter );

スクリプト構文

oReturn = ConstructionHistory.Find( Type );

戻り値

Operator

パラメータ

パラメータ タイプ 説明
Type String オペレータタイプ(twistop など)

VBScript の例

' The following code illustrates how to find the first envelope operator

' in the ConstructionHistory, 

Set oRoot = Application.ActiveProject.ActiveScene.Root

' Create an object to act as the skin

Set oSkin = oRoot.AddGeometry("Cylinder","MeshSurface")

' Create a chain to act as the skeleton

Set oPos1 = XSIMath.CreateVector3

oPos1.Set 0, -3, 0

' Effector for second bone

Set oPos2 = XSIMath.CreateVector3

oPos2.Set 0, 3, 0

' Construct skeleton

Set oChain = oRoot.Add3dChain(oPos1, Array(0,0,0))

Set oBone1 = oChain.AddBone(oPos2)

' Apply an envelope to the sphere using the chain as the deformer

oSkin.ApplyEnvelope oChain, siBranch

Set oEnvelope = oSkin.ActivePrimitive.ConstructionHistory.Find( "envelopop" )

Set oDeformers = oEnvelope.Deformers

LogMessage "There are " & oDeformers.Count & " deformers for the '" & oEnvelope.Name & "'."

For Each oItem In oDeformers

	If sMembers <> "" Then

		sMembers = sMembers & ", "

	End If

	sMembers = sMembers & oItem.Name 

Next

Application.LogMessage oSkin.Name & " has an envelope applied called '" & _

						oEnvelope.Name & "'" & vbLf & "        " & _

						"which has the following deformers: " & sMembers

' Output of the above script:

'INFO : "There are 4 deformers for the 'Envelope Operator'."

'INFO : "cylinder has an envelope applied called 'Envelope Operator'

'        which has the following deformers: root, bone, bone1, eff"