Jump to: Board index » General » Fusion

to get postion of tool from flow of fusion

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

vinayragbotra

  • Posts: 31
  • Joined: Sat Apr 04, 2015 4:35 pm

to get postion of tool from flow of fusion

PostSat Apr 04, 2015 4:47 pm

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
Offline
User avatar

Stefan Ihringer

  • Posts: 257
  • Joined: Mon Nov 10, 2014 10:40 pm

Re: to get postion of tool from flow of fusion

PostTue Apr 07, 2015 8:21 pm

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)
blog and Fusion stuff: http://comp-fu.com/2012/06/fusion-script-macro-collection/
Offline

vinayragbotra

  • Posts: 31
  • Joined: Sat Apr 04, 2015 4:35 pm

Re: to get postion of tool from flow of fusion

PostWed Apr 08, 2015 12:23 pm

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
Offline
User avatar

Blazej Floch

  • Posts: 194
  • Joined: Tue Nov 11, 2014 12:48 am
  • Location: Toronto, ON

Re: to get postion of tool from flow of fusion

PostThu Apr 09, 2015 2:16 am

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
Attachments
Selected_vs_Active.png
Selected_vs_Active.png (6.36 KiB) Viewed 2389 times
Offline

vinayragbotra

  • Posts: 31
  • Joined: Sat Apr 04, 2015 4:35 pm

Re: to get postion of tool from flow of fusion

PostSun Apr 12, 2015 7:32 am

Thanks Blazej Floch
It solved my problem... thank you so much

.................
Offline

vinayragbotra

  • Posts: 31
  • Joined: Sat Apr 04, 2015 4:35 pm

Re: to get postion of tool from flow of fusion

PostSun Apr 12, 2015 7:36 am

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

Return to Fusion

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 33 guests