Eyeon:Script/Reference/Applications/Fusion/Classes/FlowView/GetPos

From VFXPedia

Jump to: navigation, search

Contents

FlowView : GetPos

Usage

FlowView:GetPos(object tool)


Arguments

  • tool (object, required)

This argument should contain the tool object the function will return the position of.


Returns

This function returns two numeric values containing the X and Y co-ordinates of the tool.


Remarks

This function will return the X and Y position of a tool's tile in the FlowView.


Example

The example toolscript below would align all selected tools so they had the same x co-ordinate as the tool which the script was executed on.

-- get the position of the selected tool
 
local flow = comp.CurrentFrame.FlowView
local x, y = flow:GetPos(tool)
 
for i, t in comp:GetToolList(true) do
	cur_x, cur_y = flow:GetPos(t)
	flow:SetPos(t, x, cur_y)
end


Tips for GetPos (edit)

For Python use GetPosTable() instead to get the X and Y positions of the tool in a indexed dictionary. (Thanks Chad for reminding me ;)