Insert2DShapePoint

導入

v3.0

詳細

2D シェイプ(マスク シェイプ)に、ポイントを 1 つ挿入します。 このコマンドは、ColorCorrect プロパティ ページで Add Points ツールを選択して、シェイプのアウトラインをクリックして FX Viewer でポイントを追加する操作に相当します。

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

スクリプト構文

oLong = Insert2DShapePoint( [Shape], position, x, y );

戻り値

新しいポイントのインデックスを Long の値で戻します。

パラメータ

パラメータ タイプ 説明
Shape 文字列 新しいポイントを追加するシェイプのパラメータ パス名

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

注: 現在の選択が有効なリストでないと、エラーが発生します。

position Long シェイプのポイントの配列内での、新しいポイントのインデックス位置
x Double 新しいポイントの X 軸上の位置を指定
y Double 新しいポイントの Y 軸上の位置を指定

VBScript の例

'

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

' ColorCorrect operator in the FxTree, and then add, move, delete, 

' and key points on the existing shape.

'

' 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 

set oEar = Add2DShape( oGBMatteOp & ".GarbageShapes", "BSpline" )

Move2DShapePin oEar, 115.5625, 137.5625

Add2DShapePoint oEar, 98, 198

Add2DShapePoint oEar, 143, 197

Add2DShapePoint oEar, 164, 167

Add2DShapePoint oEar, 170, 135

Add2DShapePoint oEar, 163, 98

Add2DShapePoint oEar, 127, 82

Add2DShapePoint oEar, 101, 91

Add2DShapePoint oEar, 111, 116

Add2DShapePoint oEar, 131, 120

Add2DShapePoint oEar, 147, 124

Add2DShapePoint oEar, 123, 132

Add2DShapePoint oEar, 95, 122

Add2DShapePoint oEar, 72, 120

Add2DShapePoint oEar, 61, 144

Add2DShapePoint oEar, 66, 167

Add2DShapePoint oEar, 77, 188

' Add a few more points 

Insert2DShapePoint oEar, 1, 118.967423319817, 197.53405725956

Insert2DShapePoint oEar, 3, 152.865771740675, 182.906040370464

Insert2DShapePoint oEar, 5, 166.637735843658, 152.932075500488

' Move some points

Move2DShapePoint oEar, 2, 138, 195

Move2DShapePoint oEar, 12, 137, 123

' Delete a point

Delete2DShapePoint oEar, 2

' Save keys on the 4th through 7th points

Key2DShapePoints oEar, Array(3, 4, 5, 6)

関連項目

Add2DShape Add2DShapePoint Add2DShapePointArray Delete2DShapePoint