Jump to: Board index » General » Fusion

Scale spline curve animation with coefficient

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

TCP786

  • Posts: 456
  • Joined: Thu Sep 16, 2021 7:05 am
  • Real Name: Cody Predum

Scale spline curve animation with coefficient

PostWed Sep 28, 2022 8:10 am

I am trying to make a Fusion effect for the Resolve edit page, and I need to keyframe a value to go from 0 to x, x being a number that changes based on user input in the inspector. How do I write an expression such that on every frame, it checks the value of a spline curve, then multiplies the result by a number that is unknown ahead of time?

My plan is to use a spline to animate from 0 to 1, then multiply that by the user input. Is there an easy way to do this?
Offline

Sander de Regt

  • Posts: 3565
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Scale spline curve animation with coefficient

PostWed Sep 28, 2022 8:29 am

Use a calculation modifier set to'multiply' with the spline animation as the first number and the second number connected to the user control that drives the multiplication.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

TCP786

  • Posts: 456
  • Joined: Thu Sep 16, 2021 7:05 am
  • Real Name: Cody Predum

Re: Scale spline curve animation with coefficient

PostWed Sep 28, 2022 9:07 am

Ah cool. Unfortunately "calculation" doesn't seem to show up for point variables that have an x and y component. I guess my example was oversimplified; I'm using it to modify position. I'm only changing the x value, but I forgot that you have to enter both x and y for those. I guess I just need to use the calculation to set a point value on the a custom tool node and then use "connect to" instead of "modify with," right?
Offline

TCP786

  • Posts: 456
  • Joined: Thu Sep 16, 2021 7:05 am
  • Real Name: Cody Predum

Re: Scale spline curve animation with coefficient

PostWed Sep 28, 2022 9:10 am

Actually is it possible to do it in the frame render script so I don't have to use an additional node? I can't find any documentation on how to use frame render scripts though.
Offline

Sander de Regt

  • Posts: 3565
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Scale spline curve animation with coefficient

PostWed Sep 28, 2022 9:16 am

How do you intend to scale both the x and y with one scale user setting?
Using modifiers is my preferred method because it's more interactive than writing scripts.
If you use an x/y path for your position then you can use calculation modifiers on those.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

TCP786

  • Posts: 456
  • Joined: Thu Sep 16, 2021 7:05 am
  • Real Name: Cody Predum

Re: Scale spline curve animation with coefficient

PostWed Sep 28, 2022 9:30 am

I was just going to assign the point value to (spline*coefficient, 0.5).

Sander de Regt wrote:If you use an x/y path for your position then you can use calculation modifiers on those.
I don't know how that works. You can use that on the "center" value of a transform node?
Offline

Sander de Regt

  • Posts: 3565
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Scale spline curve animation with coefficient

PostWed Sep 28, 2022 9:36 am

I don't know how that works. You can use that on the "center" value of a transform node?


Yes. Just right-click the center and select modify with X/Y path. This will give you individual control of both the x and the y. It gives way more control over your values at any given time compared to a 'regular' path that only has 'position on path' for animation. Making f.e. a ball bounce from left to right at a fixed tempo but bouncing lower and lower is much easier this way. Two keyframes on the X value and the amount of bounces you need on the Y.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

TCP786

  • Posts: 456
  • Joined: Thu Sep 16, 2021 7:05 am
  • Real Name: Cody Predum

Re: Scale spline curve animation with coefficient

PostWed Sep 28, 2022 9:43 am

Very nice. So in my case, I'd modify the center with an xy path, then modify the x value with a calculation? Giving that a try now.
Offline

TCP786

  • Posts: 456
  • Joined: Thu Sep 16, 2021 7:05 am
  • Real Name: Cody Predum

Re: Scale spline curve animation with coefficient

PostWed Sep 28, 2022 9:52 am

Ok wait I'm confused again. Where am I supposed to make my spline curve if the value I need it for is being modified by a calculation?
Offline

Sander de Regt

  • Posts: 3565
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Scale spline curve animation with coefficient

PostWed Sep 28, 2022 9:57 am

I don't understand that latest question, can you rephrase it by explaining what you're trying to do?
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

TCP786

  • Posts: 456
  • Joined: Thu Sep 16, 2021 7:05 am
  • Real Name: Cody Predum

Re: Scale spline curve animation with coefficient

PostWed Sep 28, 2022 10:21 am

I figured it out. I just needed to modify the modifier's modifier. Haha.

What I was doing was animating a piece of text to move left and offscreen from the center, but I wanted to make sure that the last frame of the fusion comp is the only frame after the text leaves the screen, regardless of the amount of letters or text size.

Here was my solution (using a transform node after the text node):
-modify center with xy path
-modify x path with calculation:
-first op = 0.5
-operator: first minus second
-second op = modify with new calculation:
-first op = spline from 0 to 1
-operator: multiply
-second op:
Code: Select all
((TopText.Output.DataWindow[3]-TopText.Output.DataWindow[1])/TopText.Output.Width)+0.5


Here's what the inspector looks like:
Screenshot 2022-09-28 031126.png
Screenshot 2022-09-28 031126.png (180.46 KiB) Viewed 698 times
Offline

Sander de Regt

  • Posts: 3565
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Scale spline curve animation with coefficient

PostWed Sep 28, 2022 1:05 pm

I'm glad you figured it out! Good for you!
Sander de Regt

ShadowMaker SdR
The Netherlands

Return to Fusion

Who is online

Users browsing this forum: No registered users and 13 guests