Page 1 of 1

How to script the animation of tools ?

PostPosted: Mon Feb 20, 2017 12:06 pm
by Richard Wulveryck
Hi experienced Fusion Users
I need your help to define an animation from "composition script".

From command line in the Fusion/Console
From Composition script


In FUSION, one can select a tool in the FlowView and define a property to animate.
This done, it is possible :
- to define the initial and final value of the sequence,
- to associate a spline curve to modulate the value change,
- to act on tangent Bezier vector.

Question 1 : How can I do that scripting ?
1 - a : define property to animate
1 - b : define initial value, final value
1 - c : modify the spline curve

For example, let's say animate a cube to make it goes far away on Z axis :
cube3D1 = Cube3D1() --correct
cube1.Z(0) = 10 --pseudo code unknown
cube1.Z(30) = 50 --pseudo code unknown
cube1.Z(0).Tangent = (1,0) --pseudo code unknown
cube1.Z(30).Tangent = (-1,0) --pseudo code unknown


Question 2 : is it possible to load values of the properties from an array, where columns are properties and value are regular time intervals, not necessary synchronized with each rendering shooting (24, 25, or 30 times per second, but 1 per second for example) ?


a = load("c:\\temp\\animation.csv") --pseudo code unknown
for i=0 to a.lines.count do --pseudo code unknown
cube1.Z(i) = a(1, i) --pseudo code unknown
end

Re: How to script the animation of tools ?

PostPosted: Thu Mar 02, 2017 11:28 pm
by michael vorberg
both is possible

the concept is that you need to attach a animation curve to the value you want to animate (BezierCurve)
this Curve then gets the values for the keyframes

Code: Select all
myTool = BrightnessContrast
myTool.Gain = BezierSpline{}
myTool.Gain[5] = 5 --first is the frame and set it to value