Jump to: Board index » General » Fusion

Simple Macro but runs really slow... Is it normal?

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

brunocbreis

  • Posts: 94
  • Joined: Fri Jun 21, 2019 8:54 pm
  • Location: São Paulo, Brazil
  • Real Name: Bruno Reis

Simple Macro but runs really slow... Is it normal?

PostThu May 28, 2020 8:26 pm

I made a macro for creating text bubbles and I thought they were really simple but I'm having major performance issues. When I add two of them or more to a composition it starts playing back at a very slow frame rate even when I haven't animated a thing, and won't render cache properly (it's as if it keeps calculating over and over again even though I haven't changed any parameters).

Let me contextualize: I wanted to create iMessage-like text bubbles but I had to use some expressions in order to keep their look consistent. For instance, the corner radius needs to be kept constant no matter the height of the bubble (I realized corner radius is measured relative to the height, so dividing it by the height solved the problem). I also wanted the width to be anchored to one side, so that changing it won't mess with the position of the little arrow in a text bubble.

There's also an expression that keeps the text aligned left even when the bubble itself is aligned right: I made it so whenever the width of the bubble is increased, the text moves left accordingly.

Anyway, in my head those were very minor things that could be quickly solved with simple math, and indeed they were, but I'm starting to think Fusion didn't find what I wrote that simple, since it takes so much longer to render.

Could somebody please take a look at my little tool and maybe point me out to what I did wrong? Is there some hidden loop I'm causing in the logic that I can't see? I've attached the setting file with the macro. The expressions are in the nodes "bubble" and "merge_sent" (lines 426 and 585 of the code). I suspect the problem is there somewhere but I really don't understand why.
Attachments
text_bubble_2.setting.zip
the macro!!
(3.2 KiB) Downloaded 123 times
Mac Studio (2022)
M1 Max 64GB
DVR / Fusion Studio 18.6
Offline
User avatar

roger.magnusson

  • Posts: 3398
  • Joined: Wed Sep 23, 2015 4:58 pm

Re: Simple Macro but runs really slow... Is it normal?

PostThu May 28, 2020 9:39 pm

Things that you don't need to animate you can put behind a TimeStretcher node. That way you're not re-rendering everything on every frame. Or will you be animating the size of the bubbles?

You might also try using Simple Expressions directly on the inputs instead of the Render Frame Scripts and see if they're faster (I don't know, but I've heard Render Frame Scripts are slow).

On my machine it looks like it caches fine after a playthrough, but I suppose the Render Frame Scripts might affect the cache, since you're setting values for Center and CornerRadius on each frame.
Offline
User avatar

brunocbreis

  • Posts: 94
  • Joined: Fri Jun 21, 2019 8:54 pm
  • Location: São Paulo, Brazil
  • Real Name: Bruno Reis

Re: Simple Macro but runs really slow... Is it normal?

PostThu May 28, 2020 10:58 pm

I did try it, and it runs just as slow. I actually tried using simple expressions at first, it doesn't seem to make a difference.

Also, yes, I do plan on animating them, so there's no point in freezing time... It just seems to me like the calculations it has to make are WAY too simple for it to be this slow?? Or am I missing something
Mac Studio (2022)
M1 Max 64GB
DVR / Fusion Studio 18.6

Return to Fusion

Who is online

Users browsing this forum: Hideki Inoue and 30 guests