Jump to: Board index » General » Fusion

Mask animation with keyframe stretcher is bugged

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

ActionJackson

  • Posts: 8
  • Joined: Thu Apr 15, 2021 7:03 pm
  • Real Name: John Anderhill

Mask animation with keyframe stretcher is bugged

PostThu Apr 22, 2021 10:07 pm

Hi,

I made a macro with a keyframe stretcher to drag/drop onto whatever clip I want. It's just an animated video mask from left to right.

Here's a 20 sec video to demonstrate this problem: https://streamable.com/gns07q

The dummy clips I use are 5 seconds long each (119 frames).

The key frame stretcher is set as follows:

Source Start/End: 0-119
Stretch Start/End: 41-79
Mask animation left to right: 0-40
Mask animation stretch: 41-79
Mask animation center to right: 80-119

Willing to pay for help as long as it's reasonable (20-25 USD?). Been stuck on this all day for 3 days, and tried every possibility I can think of. But I swear Fusion must be bugged.

Any ideas?
Offline

xunile

  • Posts: 1851
  • Joined: Mon Apr 23, 2018 5:21 am
  • Real Name: Eric Eisenmann

Re: Mask animation with keyframe stretcher is bugged

PostFri Apr 23, 2021 12:37 am

How are you adding it on the Edit Page, Adjustment Clip, Fusion Effect, Fusion Generator?

I did a test animation with an Adjustment Clip and the KeyframeStretcher and it works at different parts of the clip and different lengths of the Adjustment Clip.

Also, when using the KeyframeStretcher, if you have your animation at the beginning and end of the clip, you want your Stretch Start and End to encompass the time in the middle with no animation, that way it will start with the animation, have it steady during the middle part no matter how long, then finish with the last animation.
Attachments
2021-04-22.png
2021-04-22.png (198.42 KiB) Viewed 408 times
2021-04-22 (1).png
2021-04-22 (1).png (320.04 KiB) Viewed 408 times
2021-04-22 (2).png
2021-04-22 (2).png (256.46 KiB) Viewed 408 times
Win 10 Home | Intel i7 - 10700f 64 GB 512 GB SSD
RTX-3060 12 GB | Resolve 17.2.1

Win 10 Home | Intel Core I7-7700HQ 32 GB 1 TB NVME SSD 1 TB SATA SSD
GTX-1060-6GB | Resolve 17.2.1
Offline

ActionJackson

  • Posts: 8
  • Joined: Thu Apr 15, 2021 7:03 pm
  • Real Name: John Anderhill

Re: Mask animation with keyframe stretcher is bugged

PostFri Apr 23, 2021 1:19 pm

Thank you for replying!

How are you adding it on the Edit Page?


I put a 5 second Fusion Composition on the edit page, and opened it in fusion. Then I added the MediaIn node inside fusion.

And like I show in the video, the effect works fine directly from the fusion comp. I can then stretch it to any length on the edit page. My stretch start and end are also in the center, and not overlapping anything. But there's no sound.

And when I save the effect as a macro (highlight and select all nodes except MediaIn and MediaOut), and save it in the C:\....\Fusion\Templates\Edit\Effects folder so I can drop it onto other clips, I get the problem I show: sound plays, but animation doesn't, and it's just stuck on the mask in the center.

I also originally had a node structure like yours, but tried "tricking" fusion into working the way I'd expect, cause I swear this is a bug, and this is my 53rd variation.
Offline

xunile

  • Posts: 1851
  • Joined: Mon Apr 23, 2018 5:21 am
  • Real Name: Eric Eisenmann

Re: Mask animation with keyframe stretcher is bugged

PostFri Apr 23, 2021 4:04 pm

I created a macro from what I showed in the previous post's screenshot and saved it to the Effects folder. I then used it from the Edit Page on a clip and it works as intended. I will post the code below so you can try it on your system and see if it works for you.

When you say you are dropping onto other clips, are you dropping it directly on the clip or onto an Adjustment Clip?

Code: Select all
{
   Tools = ordered() {
      TestElipseMask = MacroOperator {
         CtrlWZoom = false,
         Inputs = ordered() {
            MainInput1 = InstanceInput {
               SourceOp = "Merge1_1",
               Source = "Background",
            }
         },
         Outputs = {
            MainOutput1 = InstanceOutput {
               SourceOp = "Merge1_1",
               Source = "Output",
            }
         },
         ViewInfo = GroupInfo { Pos = { 480.667, -59.3939 } },
         Tools = ordered() {
            Background1_1 = Background {
               CtrlWShown = false,
               Inputs = {
                  EffectMask = Input {
                     SourceOp = "Ellipse1_1",
                     Source = "Mask",
                  },
                  GlobalOut = Input { Value = 179, },
                  Width = Input { Value = 1920, },
                  Height = Input { Value = 1080, },
                  UseFrameFormatSettings = Input { Value = 1, },
                  ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
               },
               ViewInfo = OperatorInfo { Pos = { 0, 41.841 } },
            },
            Ellipse1_1 = EllipseMask {
               CtrlWShown = false,
               Inputs = {
                  Filter = Input { Value = FuID { "Fast Gaussian" }, },
                  Invert = Input { Value = 1, },
                  MaskWidth = Input { Value = 1920, },
                  MaskHeight = Input { Value = 1080, },
                  PixelAspect = Input { Value = { 1, 1 }, },
                  UseFrameFormatSettings = Input { Value = 1, },
                  ClippingMode = Input { Value = FuID { "None" }, },
                  Center = Input {
                     SourceOp = "Path1_1",
                     Source = "Position",
                  },
               },
               ViewInfo = OperatorInfo { Pos = { 0, 7.62878 } },
            },
            Path1_1 = PolyPath {
               DrawMode = "InsertAndModify",
               CtrlWZoom = false,
               Inputs = {
                  Displacement = Input {
                     SourceOp = "Path1_1Displacement",
                     Source = "Value",
                  },
                  PolyLine = Input {
                     Value = Polyline {
                        Points = {
                           { Linear = true, LockY = true, X = -0.78921568627451, Y = 0, RX = 0.263071895424837, RY = 0 },
                           { Linear = true, LockY = true, X = 0, Y = 0, LX = -0.263071895424837, LY = 0, RX = 0, RY = 0 },
                           { Linear = true, LockY = true, X = 0, Y = 0, LX = 0, LY = 0, RX = 0.270424836601307, RY = 0 },
                           { Linear = true, LockY = true, X = 0.811274509803922, Y = 0, LX = -0.270424836601307, LY = 0 }
                        }
                     },
                  },
               },
            },
            Path1_1Displacement = BezierSpline {
               SplineColor = { Red = 255, Green = 0, Blue = 255 },
               NameSet = true,
               KeyFrames = {
                  [0] = { 0, RH = { 19.9979996681213, 0.164353136629277 }, Flags = { LockedY = true } },
                  [60] = { 0.493108728943338, LH = { 40.0020003318787, 0.328755592314069 }, RH = { 82.9945259208759, 0.493108728943338 }, Flags = { LockedY = true } },
                  [129] = { 0.493108728943338, LH = { 106.003074653032, 0.493108728943338 }, RH = { 145.664999723434, 0.493108728943338 }, Flags = { LockedY = true } },
                  [179] = { 1, LH = { 162.33606551231, 0.74692646755326 }, Flags = { LockedY = true } }
               }
            },
            KeyframeStretcher1_1 = KeyStretcher {
               CtrlWShown = false,
               Inputs = {
                  Keyframes = Input {
                     SourceOp = "Background1_1",
                     Source = "Output",
                  },
                  SourceEnd = Input { Value = 179, },
                  StretchStart = Input { Value = 60, },
                  StretchEnd = Input { Value = 119, },
               },
               ViewInfo = OperatorInfo { Pos = { 0, 74.841 } },
            },
            Merge1_1 = Merge {
               CtrlWZoom = false,
               CtrlWShown = false,
               Inputs = {
                  Foreground = Input {
                     SourceOp = "KeyframeStretcher1_1",
                     Source = "Result",
                  },
                  PerformDepthMerge = Input { Value = 0, },
               },
               ViewInfo = OperatorInfo { Pos = { -1.33299, 145.886 } },
            }
         },
      }
   },
   ActiveTool = "TestElipseMask"
}
Attachments
2021-04-23.png
2021-04-23.png (508.23 KiB) Viewed 366 times
2021-04-23 (1).png
2021-04-23 (1).png (486.08 KiB) Viewed 366 times
2021-04-23 (2).png
2021-04-23 (2).png (466.62 KiB) Viewed 366 times
Win 10 Home | Intel i7 - 10700f 64 GB 512 GB SSD
RTX-3060 12 GB | Resolve 17.2.1

Win 10 Home | Intel Core I7-7700HQ 32 GB 1 TB NVME SSD 1 TB SATA SSD
GTX-1060-6GB | Resolve 17.2.1
Offline

xunile

  • Posts: 1851
  • Joined: Mon Apr 23, 2018 5:21 am
  • Real Name: Eric Eisenmann

Re: Mask animation with keyframe stretcher is bugged

PostFri Apr 23, 2021 4:19 pm

For the lack of audio when you used the Fusion Composition after you added the MediaIn node to your comp, did you go to the Audio tab of the MediaIn and select the correct audio track?

The issue you are seeing is because you used a Fusion Composition from the Edit Page as your starting point. When you do that and switch to the Fusion Page, any keyframes you make are hardcoded to the ones originally used. If you try to make a macro and then reuse it on another part of the timeline, the animation will only occur during the original keyframe numbers, if you place it later on in the timeline, the animation won't work right. I would start out with an Adjustment Clip before switching to the Fusion Page, that way the MediaIn is automatically added and it is designed to work anywhere on the timeline.
Attachments
2021-04-23 (3).png
2021-04-23 (3).png (355.96 KiB) Viewed 365 times
2021-04-23 (4).png
2021-04-23 (4).png (480.07 KiB) Viewed 365 times
2021-04-23 (5).png
2021-04-23 (5).png (342.65 KiB) Viewed 365 times
Win 10 Home | Intel i7 - 10700f 64 GB 512 GB SSD
RTX-3060 12 GB | Resolve 17.2.1

Win 10 Home | Intel Core I7-7700HQ 32 GB 1 TB NVME SSD 1 TB SATA SSD
GTX-1060-6GB | Resolve 17.2.1
Offline

ActionJackson

  • Posts: 8
  • Joined: Thu Apr 15, 2021 7:03 pm
  • Real Name: John Anderhill

Re: Mask animation with keyframe stretcher is bugged

PostSat Apr 24, 2021 12:42 am

First off... Thank you VERY MUCH for the help btw! Very appreciated.

And I've had some success, but wonder why it's not working as I'd expect... But first....

I tested your macro, and it works just like mine does. The animation at the very beginning of the clip will play, but the mask won't finish to the right at the end of the clip. And when I apply the same effect to any clip later in the same video, the mask just stays in the center with no animation at all.

When you say you are dropping onto other clips, are you dropping it directly on the clip or onto an Adjustment Clip?


I'm dropping the effect directly on video clips in the timeline. I haven't used an adjustment clip ever in my life, until you mentioned it.

Concerning audio, I facepalmed. There was no sound underneath cause I started on the edit page with nothing but a fusion comp as you said.

If you try to make a macro and then reuse it on another part of the timeline, the animation will only occur during the original keyframe numbers, if you place it later on in the timeline, the animation won't work right. I would start out with an Adjustment Clip before switching to the Fusion Page, that way the MediaIn is automatically added and it is designed to work anywhere on the timeline.


Here's where I had success.... From the edit page, I put a video clip on the timeline, and an adjustment clip above that (same length), then right clicked the adjustment clip, added the nodes and animation there, and saved it as a macro. Now whenever I put an adjustment clip above ANY clip, and add my macro to it, it works as I want. It will stretch properly, and work anywhere on any video clip.

But it won't work properly when I put the macro directly on a video clip, anywhere. It only works when putting an adjustment clip above the original clip, and adding the effect to the adjustment clip.

I was hoping I could put a drag/drop effect directly on any clip, at any point in any video, instead of having to take an extra step by adding an adjustment clip, with the effect added to that. That's only 1 step, but you seem knowledgeable enough with fusion that I bet you know extra steps add up and can be very tedious.

But do you know how to make it work as I want? So it will work by adding the effect directly to any clip, anywhere, with NO adjustment clip above it?
Offline

xunile

  • Posts: 1851
  • Joined: Mon Apr 23, 2018 5:21 am
  • Real Name: Eric Eisenmann

Re: Mask animation with keyframe stretcher is bugged

PostSat Apr 24, 2021 6:29 pm

It seems that the use of Macros as Fusion Effects has a bug in it. A macro used as a Fusion Effect on a clip on the Edit Page doesn't display the keyframes correctly. When you switch to the Fusion Page using the Effects tab of the Inspector for that clip, Fusion sees all of the frames from zero to the full length of the original clip for the KeyframeStretcher, even if you trim the clip on the Edit Page, which causes issues with the keyframes. If you switch to the Fusion Page with the Effects tab of the Inspector, you can see the KeyframeStretcher working but it is using the full length of the clip instead of the trimmed clip length. It seems like you will need to use Adjustment clips to use Fusion Effects with keyframes at the moment.

In the screenshots below, you can see that I have the playhead near the end of the clip on the timeline, but when switching to Fusion via the Effects tab, the entire length of the original clip is shown in the Keyframes editor while in the bottom screenshot I added the Fusion Effect to an Adjustment clip the same length as the clip on the Edit Page and when switching to Fusion the correct length is shown.

You might also want to watch the video below for some quirks of working with Adjustment Clips.

Attachments
2021-04-24 (8).png
2021-04-24 (8).png (632.95 KiB) Viewed 326 times
2021-04-24 (9).png
2021-04-24 (9).png (448.19 KiB) Viewed 326 times
2021-04-24 (10).png
2021-04-24 (10).png (471.02 KiB) Viewed 326 times
Last edited by xunile on Sat Apr 24, 2021 7:57 pm, edited 1 time in total.
Win 10 Home | Intel i7 - 10700f 64 GB 512 GB SSD
RTX-3060 12 GB | Resolve 17.2.1

Win 10 Home | Intel Core I7-7700HQ 32 GB 1 TB NVME SSD 1 TB SATA SSD
GTX-1060-6GB | Resolve 17.2.1
Offline

xunile

  • Posts: 1851
  • Joined: Mon Apr 23, 2018 5:21 am
  • Real Name: Eric Eisenmann

Re: Mask animation with keyframe stretcher is bugged

PostSat Apr 24, 2021 7:56 pm

After some more playing with this issue, I found out that if you right-click and turn your clip into a Compound Clip first before adding the Fusion Effect, it will work with keyframes as expected.
Attachments
2021-04-24 (11).png
2021-04-24 (11).png (489.54 KiB) Viewed 320 times
2021-04-24 (12).png
2021-04-24 (12).png (581.11 KiB) Viewed 320 times
2021-04-24 (13).png
2021-04-24 (13).png (600.95 KiB) Viewed 320 times
Win 10 Home | Intel i7 - 10700f 64 GB 512 GB SSD
RTX-3060 12 GB | Resolve 17.2.1

Win 10 Home | Intel Core I7-7700HQ 32 GB 1 TB NVME SSD 1 TB SATA SSD
GTX-1060-6GB | Resolve 17.2.1
Offline

xunile

  • Posts: 1851
  • Joined: Mon Apr 23, 2018 5:21 am
  • Real Name: Eric Eisenmann

Re: Mask animation with keyframe stretcher is bugged

PostSun Apr 25, 2021 2:31 am

I played with it some more and I think I figured it out. See if the Macro I post below will work on the Edit Page for you. If it has any glitches after changing the length of a clip after adding the Fusion Effect, just toggle the Effect on and off, it should work fine after that.

Code: Select all
{
   Tools = ordered() {
      TestEllipseMask4 = MacroOperator {
         CtrlWZoom = false,
         Inputs = ordered() {
            MainInput1 = InstanceInput {
               SourceOp = "Merge1",
               Source = "Background",
            },
            Input1 = InstanceInput {
               SourceOp = "AnimCurves1",
               Source = "Source",
            },
            Input2 = InstanceInput {
               SourceOp = "AnimCurves1",
               Source = "Curve",
            },
            Input3 = InstanceInput {
               SourceOp = "AnimCurves1",
               Source = "EaseIn",
            },
            Input4 = InstanceInput {
               SourceOp = "AnimCurves1",
               Source = "EaseOut",
            },
            Input5 = InstanceInput {
               SourceOp = "AnimCurves1",
               Source = "Lookup",
               ControlGroup = 6,
            },
            Input6 = InstanceInput {
               SourceOp = "AnimCurves1",
               Source = "Mirror",
            },
            Input7 = InstanceInput {
               SourceOp = "AnimCurves1",
               Source = "Invert",
            }
         },
         Outputs = {
            MainOutput1 = InstanceOutput {
               SourceOp = "Merge1",
               Source = "Output",
            }
         },
         ViewInfo = GroupInfo {
            Pos = { 484.667, 79.803 },
            Flags = {
               Expanded = true,
               AllowPan = false,
               AutoSnap = true,
               RemoveRouters = true
            },
            Size = { 139.333, 190.947, 69.6666, 54.5455 },
            Direction = "Horizontal",
            PipeStyle = "Direct",
            Scale = 1,
            Offset = { 0, 0 }
         },
         Tools = ordered() {
            Merge1 = Merge {
               Inputs = {
                  Foreground = Input {
                     SourceOp = "Background1",
                     Source = "Output",
                  },
                  PerformDepthMerge = Input { Value = 0, },
               },
               ViewInfo = OperatorInfo { Pos = { 6, 103.636 } },
            },
            Background1 = Background {
               Inputs = {
                  EffectMask = Input {
                     SourceOp = "Ellipse1",
                     Source = "Mask",
                  },
                  GlobalOut = Input { Value = 970, },
                  Width = Input { Value = 1920, },
                  Height = Input { Value = 1080, },
                  UseFrameFormatSettings = Input { Value = 1, },
                  ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
               },
               ViewInfo = OperatorInfo { Pos = { -7.3333, 42.6969 } },
            },
            Ellipse1 = EllipseMask {
               Inputs = {
                  Filter = Input { Value = FuID { "Fast Gaussian" }, },
                  Invert = Input { Value = 1, },
                  MaskWidth = Input { Value = 1920, },
                  MaskHeight = Input { Value = 1080, },
                  PixelAspect = Input { Value = { 1, 1 }, },
                  UseFrameFormatSettings = Input { Value = 1, },
                  ClippingMode = Input { Value = FuID { "None" }, },
                  Center = Input {
                     SourceOp = "Path1",
                     Source = "Position",
                  },
               },
               ViewInfo = OperatorInfo { Pos = { -7.3333, 7.87868 } },
            },
            Path1 = PolyPath {
               DrawMode = "InsertAndModify",
               CtrlWZoom = false,
               Inputs = {
                  Displacement = Input {
                     SourceOp = "AnimCurves1",
                     Source = "Value",
                  },
                  PolyLine = Input {
                     Value = Polyline {
                        Points = {
                           { Linear = true, X = -0.767326732673267, Y = 0, RX = 0.264026402640264, RY = 0 },
                           { Linear = true, X = 0.0247524752475248, Y = 0, LX = -0.264026402640264, LY = 0, RX = 0, RY = 0 },
                           { Linear = true, X = 0.0247524753212929, Y = 0, LX = 0, LY = 0, RX = 0.240924092384652, RY = 0 },
                           { Linear = true, X = 0.747524752475248, Y = 0, LX = -0.240924092384652, LY = 0 }
                        }
                     },
                  },
               },
            },
            AnimCurves1 = LUTLookup {
               Inputs = {
                  Source = Input { Value = FuID { "Duration" }, },
                  Curve = Input { Value = FuID { "Custom" }, },
                  Lookup = Input {
                     SourceOp = "AnimCurvesonPath1Lookup",
                     Source = "Value",
                  },
               },
            },
            AnimCurvesonPath1Lookup = LUTBezier {
               KeyColorSplines = {
                  [0] = {
                     [0] = { 0, RH = { 0.11521731112697, 0.174393861209157 }, Flags = { Linear = true } },
                     [0.34565193338091] = { 0.523181583627471, LH = { 0.23043462225394, 0.348787722418314 }, RH = { 0.45843462225394, 0.524787722418314 }, Flags = { Linear = true } },
                     [0.684] = { 0.528, LH = { 0.57121731112697, 0.526393861209157 }, RH = { 0.789333333333333, 0.685333333333333 }, Flags = { Linear = true } },
                     [1] = { 1, LH = { 0.894666666666667, 0.842666666666667 }, Flags = { Linear = true } }
                  }
               },
               SplineColor = { Red = 255, Green = 255, Blue = 255 },
            }
         },
      }
   },
   ActiveTool = "TestEllipseMask4"
}
Attachments
2021-04-24 (3).png
2021-04-24 (3).png (331.59 KiB) Viewed 295 times
2021-04-24 (4).png
2021-04-24 (4).png (451.8 KiB) Viewed 295 times
2021-04-24 (5).png
2021-04-24 (5).png (340.16 KiB) Viewed 295 times
Win 10 Home | Intel i7 - 10700f 64 GB 512 GB SSD
RTX-3060 12 GB | Resolve 17.2.1

Win 10 Home | Intel Core I7-7700HQ 32 GB 1 TB NVME SSD 1 TB SATA SSD
GTX-1060-6GB | Resolve 17.2.1
Offline

ActionJackson

  • Posts: 8
  • Joined: Thu Apr 15, 2021 7:03 pm
  • Real Name: John Anderhill

Re: Mask animation with keyframe stretcher is bugged

PostSun Apr 25, 2021 8:33 pm

YOU GOT IT!!!!! THANK YOU!!!

The last macro you put up works perfectly. And for quick reference to anyone who comes across this problem in the future, here's what he did... When exporting the macro, under AnimCurves1, he checked the attributes for:

Source: Duration
Curve: Custom
and Lookup, which lets you visually change the animation curves.

Now drag and drop works. I don't like that the KeyframeStretcher doesn't work as I'd expect, but this workaround is perfect.

Also just checked your site and youtube channel, and I don't see a donate button. I'm still willing to pay you for the help. I got US dollars or BAT (Brave browser crypto currency, which can be converted into real money via Uphold.com, but you first have to sign up for accepting BAT on your website/YT channel at https://creators.brave.com/sign-up, because I'd just tip one of those directly - ask me if you need help).
Offline

xunile

  • Posts: 1851
  • Joined: Mon Apr 23, 2018 5:21 am
  • Real Name: Eric Eisenmann

Re: Mask animation with keyframe stretcher is bugged

PostMon Apr 26, 2021 4:38 am

You're welcome, and no payment is necessary, I enjoy figuring things out. If you would still like to donate something I have a buymeacoffee page. I will have assets and things like Transitions and Titles on it in the near future.

https://www.buymeacoffee.com/xunile
Win 10 Home | Intel i7 - 10700f 64 GB 512 GB SSD
RTX-3060 12 GB | Resolve 17.2.1

Win 10 Home | Intel Core I7-7700HQ 32 GB 1 TB NVME SSD 1 TB SATA SSD
GTX-1060-6GB | Resolve 17.2.1
Offline

ActionJackson

  • Posts: 8
  • Joined: Thu Apr 15, 2021 7:03 pm
  • Real Name: John Anderhill

Re: Mask animation with keyframe stretcher is bugged

PostMon Apr 26, 2021 6:26 pm

I don't have paypal, and that coffee place automatically sends me to paypal when I click the debit/credit option. Got rid of them long ago cause they screw the business owner with chargebacks (ever heard of Louis Rossmann on youtube? He has a bunch of videos on this).

If you have a regular merchant account, or accept BAT from your website/YT, I can do that.

Whatever you choose, I appreciate the help a lot.

Thanks again.

Return to Fusion

Who is online

Users browsing this forum: No registered users and 10 guests