Scale2DShape

導入

v3.0

カテゴリ

レンダリング

詳細

2D シェイプ(マスク シェイプ)をリサイズ(スケーリング)します。 このコマンドは、シェイプを選択し、そのバウンディング ボックスの任意のハンドルをクリックしてドラッグする操作に相当します。

注: シェイプをスケーリングする前に、シェイプのセンターまたはピンの表示位置を変更するほうがよいことがあります。 たとえば、ピンをシェイプの左に移動させた後に回転させると、シェイプは左方向よりも右方向により高速に大きくなります。 シェイプのピンを移動させるには、Move2DShapePinコマンドを使用します。

スクリプト構文

Scale2DShape( [Shape], x, y );

パラメータ

パラメータ タイプ 詳細
Shape 文字列 スケールするシェイプのパラメータ パス名

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

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

x ダブル X 軸上におけるセンターの新しい座標を指定
y ダブル Y 軸上におけるセンターの新しい座標を指定

VBScript の例

'
' This example demonstrates how to set a garbage matte mask for a 
' ColorCorrect operator in the FxTree, scale it, change the position
' of its center and then rotate it around the new center.
'
' 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", "Polygon" )
Move2DShapePin oRotospline, 114.75, 143
Add2DShapePoint oRotospline, 44, 194
Add2DShapePoint oRotospline, 65, 78
Add2DShapePoint oRotospline, 116, 138
Add2DShapePoint oRotospline, 169, 84
Add2DShapePoint oRotospline, 180, 207
Add2DShapePoint oRotospline, 153, 137
Add2DShapePoint oRotospline, 114, 172
Add2DShapePoint oRotospline, 77, 134
' Make the shape a little smaller
Scale2DShape oRotospline, 0.875486381322957, 0.784615384615384
' Pivot the shape on its bottom right corner
Move2DShapePin oRotospline, 154.75, 69
Set2DShapeRotation oRotospline, -50.6836714968651

関連項目

Add2DShape Move2DShape Move2DShapePin Set2DShapeRotation