Jump to: Board index » General » Fusion

CustomTool output not updating in MediaOut

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

Rutvik

  • Posts: 9
  • Joined: Wed Aug 25, 2021 5:15 pm
  • Real Name: Rutvik Choudhary

CustomTool output not updating in MediaOut

PostSun Oct 17, 2021 7:26 pm

I imported an SVG of an eye into Resolve and am trying to animate it with the Custom Tool node. I connected the iris layers into the the node and am animating the color channels to move around independently to achieve some kind of chromatic aberration.

This is what my node workflow looks like:

Image

The left scope shows the Custom Tool output while the right scope shows MediaOut. These are the Setup and RGB equations for the CustomTool:

Code: Select all
s6 = n1/100
s7 = s6*sin(n2*time-80) + s6
s8 = s7/sqrt(2)

r = getr1d(x-s8,y-s8)
g = getg1d(x+s8,y-s8)
b = getb1d(x,y+s7)


In the CustomTool scope I see what I expect: https://i.imgur.com/cerQZRT.mp4

However, the MediaOut scope doesn't show any updates. Even if I render, the video is static. The weird thing is if I change any property of the node right after the CustomTool (i.e. Merge13), the MediaOut scope updates to whatever the CustomTool node output should be at the current frame, but then it doesn't update again. Is the weird behavior is caused by some setting I need to enable/disable for any of the nodes?

I had tested out code like that in another project (that I deleted since then unfortunately) and it seemed to work there. Although in that case, the input to the CustomTool node was an image, not layers from an SVG, which of course are just masked background nodes. Maybe it's worth noting that buried in the graph of those masked background nodes, there's a Transform node. Does that change things?

I'm currently running Resolve 17.3.2 on Mac OS 10.14 (Mojave).
Offline
User avatar

Bryan Ray

  • Posts: 2478
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: CustomTool output not updating in MediaOut

PostMon Oct 18, 2021 2:18 am

It doesn't sound like you're doing anything wrong. Do you get the same results if you connect the CustomTool directly to the MediaOut? My guess is some kind of cache issue or a corrupted node.

Make sure the drive containing your temp directory isn't full; that can cause strange behavior sometimes, and Fusion isn't always great at cleaning up after itself. Not sure if Resolve's Fusion page has the same problem there.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline
User avatar

TheBloke

  • Posts: 1905
  • Joined: Sat Nov 02, 2019 11:49 pm
  • Location: UK
  • Real Name: Tom Jobbins

Re: CustomTool output not updating in MediaOut

PostMon Oct 18, 2021 6:15 am

Rutvik, can you share the comp? I'm wondering if there's some kind of caching bug caused by certain combinations of nodes. I discovered a bug like that a week or so ago in the Planar Tracker - where the Planar Tracker node worked fine when you viewed it directly, but if you viewed any node downstream of it, the output was cropped.

In Resolve you can do: File -> Export -> Fusion Composition. This will give you a .comp file. You can then ZIP that and attach it here. It won't include any media, but it will include the SVG because, as you say, it's just masks and background nodes.

If it won't let you attach files because you're a new user, you could upload the .comp to a file sharing site like Google Drive or Dropbox, then paste the link here in a code box (as it won't let new users post direct links either, but a code box gets around that.)
Resolve Studio 17.4.3 and Fusion Studio 17.4.3 on macOS 11.6.1

Hackintosh:: X299, Intel i9-10980XE, 128GB DDR4, AMD 6900XT 16GB
Monitors: 1 x 3840x2160 & 3 x 1920x1200
Disk: 2TB NVMe + 4TB RAID0 NVMe; NAS: 36TB RAID6
BMD Speed Editor
Offline

Rutvik

  • Posts: 9
  • Joined: Wed Aug 25, 2021 5:15 pm
  • Real Name: Rutvik Choudhary

Re: CustomTool output not updating in MediaOut

PostMon Oct 18, 2021 6:21 pm

Bryan Ray wrote:Do you get the same results if you connect the CustomTool directly to the MediaOut?


If I hook up the CustomTool to MediaOut the preview seems to reflect the animation. If I render, the final video does what I expect it to.

Bryan Ray wrote:Make sure the drive containing your temp directory isn't full


I tried clearing /Users/rutvik/Movies/CacheClip but that didn't seem to help.

TheBloke wrote:Rutvik, can you share the comp? I'm wondering if there's some kind of caching bug caused by certain combinations of nodes.


Here is a link to my comp file, let me know if there's any problems accessing/downloading it:

Code: Select all
https://drive.google.com/file/d/1ri8NAwlRdr_7NKNVU9D9f_5wn5nwdATp/view?usp=sharing
Offline

Rutvik

  • Posts: 9
  • Joined: Wed Aug 25, 2021 5:15 pm
  • Real Name: Rutvik Choudhary

Re: CustomTool output not updating in MediaOut

PostMon Oct 18, 2021 9:27 pm

Update! I posted on the subreddit as well and one person gave this advice:


At a guess, I think that resolve doesn't see any change to the input, so it don't update the nodes. Somehow it's missing the frame value in the custom tool and not triggering a recompute.

Try adding 'time' for a control that you don't need. that may trigger it.



I took their advice and for the Merge node right after the CustomTool node, I added an expression to the Angle property and set its value to time*0. This did the trick and now the CustomTool output is rendered!

Is there a less hack-y way to accomplish the same thing though? Maybe some parameter I forgot to set? Not sure if this is caused by a bug in Fusion or if it's just a consequence of my particular node setup.
Offline
User avatar

TheBloke

  • Posts: 1905
  • Joined: Sat Nov 02, 2019 11:49 pm
  • Location: UK
  • Real Name: Tom Jobbins

Re: CustomTool output not updating in MediaOut

PostTue Oct 19, 2021 7:48 am

Yeah looks like a bug on the CustomTool node. It works fine if you view the CT itself, but as soon as you view the Merge afterwards, it stops updating the CustomTool node.

Adding a Dissolve node after the CT works - viewing the Dissolve node shows updates on the CT. But then connecting that Dissolve to a Merge stops updating again.

The image before the CT node is static, so the only node changing anything is the CT, and it seems to have this bug that means Fusion doesn't detect the expressions on the CT as changing the image.

It becomes quite obvious when you select the Merge node after the CT. Its cache bar goes green for the entire frame range - the same thing it would do with a static input image. It thinks it can cache the whole range in one go because the input is unchanging - it's not detecting the CT as something that will change the image on each frame.

Another workaround, very similar to yours, is to put a pair of keyframes on one of the CT's expression fields, like "Z Expression". Set one keyframe on the first frame, one on the last frame. Then Fusion sees the keyframes and thinks the CT is changing, even though the expression is the same. The result is basically the same as the method you used, I didn't notice much performance difference. Just another option.

I tried your comp in Fusion 9 and it had exactly the same issue. So this isn't a new bug. Maybe CT has always had this problem! Just it's not normally noticeable because it's quite rare for the CT node to be the only node in the comp that's changing the image.
Resolve Studio 17.4.3 and Fusion Studio 17.4.3 on macOS 11.6.1

Hackintosh:: X299, Intel i9-10980XE, 128GB DDR4, AMD 6900XT 16GB
Monitors: 1 x 3840x2160 & 3 x 1920x1200
Disk: 2TB NVMe + 4TB RAID0 NVMe; NAS: 36TB RAID6
BMD Speed Editor
Offline
User avatar

Bryan Ray

  • Posts: 2478
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: CustomTool output not updating in MediaOut

PostTue Oct 19, 2021 4:16 pm

Wow, yeah; good catch, unknown Redditor! (Would you mind revealing who this helpful soul was? I don't do Reddit, and if there are knowledgeable folk there who don't overlap with this forum and WSL, it would be good to be aware of them.)

You don't even need an expression that changes every frame. Fusion will issue a new request on every frame for any tool that has an expression of any kind on a control. I just added an expression to NumberIn8 and left it at '0', and the error condition cleared.

Here's a simplified demo of the problem:

Code: Select all
{
   Tools = ordered() {
      CustomTool2 = Custom {
         CtrlWZoom = false,
         Inputs = {
            LUTIn1 = Input {
               SourceOp = "CustomTool2LUTIn1",
               Source = "Value",
            },
            LUTIn2 = Input {
               SourceOp = "CustomTool2LUTIn2",
               Source = "Value",
            },
            LUTIn3 = Input {
               SourceOp = "CustomTool2LUTIn3",
               Source = "Value",
            },
            LUTIn4 = Input {
               SourceOp = "CustomTool2LUTIn4",
               Source = "Value",
            },
            RedExpression = Input { Value = "sin(time)", },
            Image1 = Input {
               SourceOp = "Background14",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 1044.72, -216.215 } },
      },
      CustomTool2LUTIn1 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 0, Blue = 0 },
         NameSet = true,
      },
      CustomTool2LUTIn2 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 204, Blue = 0 },
         NameSet = true,
      },
      CustomTool2LUTIn3 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 0, Green = 0, Blue = 204 },
         NameSet = true,
      },
      CustomTool2LUTIn4 = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0, RH = { 0.333333333333333, 0.333333333333333 }, Flags = { Linear = true } },
               [1] = { 1, LH = { 0.666666666666667, 0.666666666666667 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 204, Green = 204, Blue = 204 },
         NameSet = true,
      },
      Background14 = Background {
         Inputs = {
            GlobalOut = Input { Value = 299, },
            Width = Input { Value = 2560, },
            Height = Input { Value = 1440, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 934.719, -217.098 } },
      },
      Merge12 = Merge {
         Inputs = {
            Background = Input {
               SourceOp = "Background15",
               Source = "Output",
            },
            Foreground = Input {
               SourceOp = "CustomTool2",
               Source = "Output",
            },
            PerformDepthMerge = Input { Value = 0, },
         },
         ViewInfo = OperatorInfo { Pos = { 1154.72, -217.098 } },
      },
      Background15 = Background {
         Inputs = {
            GlobalOut = Input { Value = 299, },
            Width = Input { Value = 2560, },
            Height = Input { Value = 1440, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
         },
         ViewInfo = OperatorInfo { Pos = { 1154.26, -259.487 } },
      }
   }
}
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

Rutvik

  • Posts: 9
  • Joined: Wed Aug 25, 2021 5:15 pm
  • Real Name: Rutvik Choudhary

Re: CustomTool output not updating in MediaOut

PostTue Oct 19, 2021 5:48 pm

TheBloke wrote:Another workaround, very similar to yours, is to put a pair of keyframes on one of the CT's expression fields, like "Z Expression". Set one keyframe on the first frame, one on the last frame. Then Fusion sees the keyframes and thinks the CT is changing, even though the expression is the same. The result is basically the same as the method you used, I didn't notice much performance difference. Just another option.

I tried your comp in Fusion 9 and it had exactly the same issue. So this isn't a new bug. Maybe CT has always had this problem! Just it's not normally noticeable because it's quite rare for the CT node to be the only node in the comp that's changing the image.


Actually funnily enough I was planning on putting Transform nodes somewhere in the node graph before the CustomTool node, and I was gonna animate the position property of the Transform node with keyframes. Had I done that first, this issue would have never cropped up! :lol:

Bryan Ray wrote:Wow, yeah; good catch, unknown Redditor! (Would you mind revealing who this helpful soul was? I don't do Reddit, and if there are knowledgeable folk there who don't overlap with this forum and WSL, it would be good to be aware of them.)


My hero was u/kijarni!

Bryan Ray wrote:You don't even need an expression that changes every frame. Fusion will issue a new request on every frame for any tool that has an expression of any kind on a control


Oh that's good to know, thanks! :)

Return to Fusion

Who is online

Users browsing this forum: No registered users and 32 guests