Page 1 of 1

Create hotkeys for Center, Scale, Angle and Blend.

PostPosted: Fri May 17, 2019 3:49 pm
by bentheanimator
So in After Effects and Maya there are shortcuts to insert a key for various things like position and rotation. I've looked through the hotkeys available but can't find a way to insert a key in a particular tool like Transform. I just found the Fusion 8 Scripting Guide and have started to grok that but was hoping I'm recreating the wheel here. Can somebody point me in the right direction? If there is not hotkey combo, can a macro be made that can then be attached to a hotkey?

Re: Create hotkeys for Center, Scale, Angle and Blend.

PostPosted: Fri May 17, 2019 8:46 pm
by Bryan Ray
First, the term 'macro' has a different meaning in Fusion than in some other software. In Fusion, it's a collection of tools that are grouped and given a custom control panel. So a macro appears as a node in the Flow.

It should certainly be possible to create a script that does what you describe, and a script can be run from a hotkey.

Code: Select all
tool = comp.ActiveTool
keyframe = { [comp.CurrentTime] = { tool.Angle[comp.CurrentTime], }, }

splineout = tool.Angle:GetConnectedOutput()
spline = splineout:GetTool()

spline:SetKeyFrames(keyframe)


The above sets a keyframe on the active tool's Angle control.

You'd probably want to do a little more testing to be sure the tool has an Angle control, and to create an animation spline if one doesn't already exist.

edit: The above adapted from the info on pages 83-84 of the Fusion 8 Scripting Guide.

Re: Create hotkeys for Center, Scale, Angle and Blend.

PostPosted: Sat May 18, 2019 2:37 am
by bentheanimator
Thanks for this!

I'll throw together a something that checks for a spline and creates one if not present? I've been reading that section and it seems like you have to create a spline first before adding a keyframe. I'll bang at it and get something working then post it to WSL.