Add2DShapePointArray

導入

v3.0

詳細

2D シェイプ(マスク シェイプ)に、ポイントの配列を追加します。

このコマンドと Insert2DShapePoint コマンドは、Add2DShapePointArray がシェイプの作成時にオリジナルのポイントセットを定義するために使用するコマンドであるのに対し、Insert2DShapePoint は作成された既存のシェイプにポイントを追加する際に使用するコマンドである点が異なります。

注: ポイントは、Add2DShapePoint または Add2DShapePointArray コマンドのいずれかを使用して追加することができます。

スクリプト構文

Add2DShapePointArray( [Shape], points );

パラメータ

パラメータ タイプ 説明
Shape 文字列 ポイントを定義するシェイプのパラメータ パス名

デフォルト値: 現在選択されている値

注: 現在の選択が有効なシェイプでないと、エラーが発生します。

points Double配列 新しいポイントの位置を、x,y 値の 1 次元配列として指定

VBScript の例

'

' This example demonstrates how to set a garbage matte mask for a 

' ColorCorrect operator in the FxTree.

'

' Create a new FxTree 

set oTree = CreateFxTree()

' Get the projects path for the current system

sPath = InstallationPath( siProjectPath )

set oClip = CreateImageClip( sPath & "\Pictures\noIcon.pic", "NewClip" )

' Use the clip to create a new image clip operator

set oOperator = AddImageClipFxOp( oTree, oClip )

' Add a Color Correct operator to the same tree

set oCCOp = AddFxOp( oTree, "Color Correct" )

' Connect the two operators

ConnectFxOp oOperator, oCCOp, "1" 

' Since the ConnectFxOp command does not return the new operator,

' you need to get it from the OperatorCollection on the FxTree object

for each oMember in oTree.FxOperators

	if oMember.Name = "ColorCorrect" then

		set oGBMatteOp = oMember

		exit for

	end if

next

' Adjust the HSV Offset and Gain levels so you can see the 

' results of the color correction

SetValue oGBMatteOp.FullName & ".MasterHueShift," _

		& oGBMatteOp.FullName & ".MasterOffset," _

		& oGBMatteOp.FullName & ".MasterGain", _

		Array(0, 0.820731514055631, 0.852844886888196)

' Add the 2D shape (mask shape) to the GarbageMatte and reshape it so you can see

' the shape when you open the Fx Viewer with the ColorCorrect operator selected

set oRotospline = Add2DShape( oGBMatteOp & ".GarbageShapes", "Bezier" )

Move2DShapePin oRotospline, 124.333333333333, 145.166666666667

aPointPositions = Array(56, 207, 196, 170, 179, 85, 132, 142, 108, 105, 75, 162)

Add2DShapePointArray oRotospline, aPointPositions

' Print out the RGB values

getRGBValues oRotospline

' Set new values and print out the new results

setRGBValues oRotospline, 2, 3, 5

getRGBValues oRotospline

' ---------------------- FUNCTIONS ----------------------------------

function getRGBValues( in_roto_name )

	' Get the RGB Values from the rotospline shape

	vRed = GetValue( oRotospline & ".Red", 1 )

	vGreen = GetValue( oRotospline & ".Green", 1 )

	vBlue = GetValue( oRotospline & ".Blue", 1 )

	Application.LogMessage "The RGB values for the " & oRotospline _

			& " are: " & vRed & ", " & vGreen & ", " & vBlue

end function

function setRGBValues( in_roto_name, in_R, in_G, in_B )

	SetValue oRotospline & ".Red", in_R

	SetValue oRotospline & ".Green", in_G

	SetValue oRotospline & ".Blue", in_B

end function



' ------------------------ OUTPUT -----------------------------------

' Output of above script:

'INFO : "The RGB values for the FxTree.ColorCorrect_Image.ColorCorrect.GarbageShapes.Bezier are: 1, 1, 1"

'INFO : "The RGB values for the FxTree.ColorCorrect_Image.ColorCorrect.GarbageShapes.Bezier are: 2, 3, 5"

関連項目

Add2DShape Add2DShapePoint Insert2DShapePoint Delete2DShapePoint