Page 1 of 1
to get postion of tool from flow of fusion

Posted:
Sat Apr 04, 2015 4:47 pm
by vinayragbotra
Hi,
I just want to get position of tool from work flow of fusion with fusion script.
Here is the Problem
---------------------
Tools = ordered() {
Saver1 = Saver({
Clip = rOutPath..artistName..".0000.jpg",
OutputFormat = "JpegFormat",
Input = actTool.Output,
})
}
-------------------------------
whenever i run this script, it calls a saver tool in flow, but at random position
I just want that a new saver comes at position just next to any selected tool in work flow of fusion
Could anyone please help
Re: to get postion of tool from flow of fusion

Posted:
Tue Apr 07, 2015 8:21 pm
by Stefan Ihringer
You need to use comp:AddTool() to create the saver. That way you can either define a location for the tool or have Fusion place the tool automatically (next to the currently selected one for example). Here's the
documentation for AddTool.
If you want to get the position of a tool, you need to use a method of the Flow view:
- Code: Select all
flow = composition.CurrentFrame.FlowView
x, y = flow:GetPos(tool)
Re: to get postion of tool from flow of fusion

Posted:
Wed Apr 08, 2015 12:23 pm
by vinayragbotra
flow = composition.CurrentFrame.FlowView
x, y = flow:GetPos(tool)
Thanks Sir
You replied
actually it didn't give any information to x and y
x and y remains nil.
flow = composition.CurrentFrame.FlowView
x, y = flow:GetPos(ActTool)
ActTool is my selected tool in flow
Re: to get postion of tool from flow of fusion

Posted:
Thu Apr 09, 2015 2:16 am
by Blazej Floch
- Code: Select all
Lua> ActTool = comp.ActiveTool
Lua> flow = composition.CurrentFrame.FlowView
Lua> x, y = flow:GetPos(ActTool)
Lua> ==x, y
7.736
5.923
This works for sure. However make sure that you really hit the ActiveTool (yellow) by a click.
If you simply box-select a tool it is not automatically Active but instead Selected.
Only one tool can be active by clicking. Multiple tools can be selected.
To get the first selected tool use:
- Code: Select all
Lua> ActTool = comp:GetToolList(true)[1]
Lua> flow = composition.CurrentFrame.FlowView
Lua> x, y = flow:GetPos(ActTool)
Lua> ==x, y
7.736
5.923
Re: to get postion of tool from flow of fusion

Posted:
Sun Apr 12, 2015 7:32 am
by vinayragbotra
Thanks Blazej Floch
It solved my problem... thank you so much
.................
Re: to get postion of tool from flow of fusion

Posted:
Sun Apr 12, 2015 7:36 am
by vinayragbotra
Thank you Stefan Ihringer
You suggested me to use comp:AddTool()
It solved my problem
Now fusion loads Saver right next to the selected tool every time.
thank you so much