in the discussion about the feature wish for a "bookmark system" which can store specific locations in the composition and you can jump quickly to them i came up with these 2 scripts:
- both are comp scripts
- positions are stored in the comp meta data, so you dont lose them after closing the comp
- currently i store the name of the selected node and jump to this node even if you moved it
script to store the "Bookmarks":
- --------------------------------------
- -- example to recal position and names of tools in the composition metadata
- -- and jump the flowView to the selected tool
- --
- --
- -- Michael Vorberg
- --
- -- CC BY-NC 4.0
- -- https://creativecommons.org/licenses/by-nc/4.0/
- -----------------------------------------------------------------
- fusion = Fusion()
- composition = fusion:GetCurrentComp()
- flow = composition.CurrentFrame.FlowView
- CurXPos, CurYPos = flow:GetPos(composition.ActiveTool)
- tool = composition:GetAttrs().COMPH_ActiveTool
- ret = comp:AskUser("Save Position to ...", {
- {"storeName", Name="store as", "Text", Lines = 1, Default = tool:GetAttrs().TOOLS_Name},
- })
- if ret == nil then
- print("cancelled") return
- else
- storePositionName = "Position_"..ret.storeName..".name"
- storePositionX = "Position_"..ret.storeName..".x"
- storePositionY = "Position_"..ret.storeName..".y"
- composition:SetData(storePositionName,tool:GetAttrs().TOOLS_Name)
- composition:SetData(storePositionX,CurXPos)
- composition:SetData(storePositionY,CurYPos)
- end