## Move2DShapePin

### Introduced

v3.0

### Description

Sets the position of a scale's pin (its center). This is the scripting equivalent of selecting the shape, and clicking and dragging its center (pin marker) in the Fx Tree.
Moving the pin changes how the shape rotates and scales. For example, if you move the pin to the left of the shape and then rotate it, the shape pivots from the left.
Note: If you need to move the whole shape, use the Move2DShape command instead.

### Scripting Syntax

    Move2DShapePin( [Shape], [x], [y] );

### Parameters

Parameter | Type | Description
--- | --- | ---
Shape | String | Parameter path name for the shape whose pin you are moving. Default Value: Current selection. Note: If the current selection is not a valid shape, an error occurs.
x | Double | Specifies the new position of the center in X. Default Value: 0
y | Double | Specifies the new position of the center in Y. Default Value: 0

### Examples

#### VBScript Example

    '
    ' 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

### See Also

Add2DShape Move2DShape Scale2DShape Set2DShapeRotation