Question about GUI.Animations in the profiler

Hello all,
I just profiling my app and found an output that I cannot understand.
The screen in question is a scrolling page, it consists of 10 pages that are dragged along. 2 pages are visible at a time, the rest gets disabled. All share one texture to reduce draw calls.
At init, all disabled pages report back as having an animation (as the pages get dragged along the screen, the amount of GUI.Animations reduces and finally, the profiler reports no more animations).
According to the manual, “Disabled nodes are not rendered and animations acting on them are not evaluated”.
I am quite curious and would like to understand what is happening.

P.S. Happy holidays and a great next year to all of you!

If you add a gui.animate() call to each node and then disable them I guess they still have one animation each. This is reasonable and I would expect this to be seen in the profiler.

I’m not entirely sure what happens to the animation if you enable and disable multiple times during the duration of the animation. My guess is that the property that is animated (for instance position) only gets updated when the node is enabled and left at its current value while disabled.

1 Like

Good morning @britzl,

thank you very much for your reply.

I agree, this makes sense. But… there is no gui.animate() call, all the nodes do is share one atlas that consists of one image. And if I comment the line in init out, the profiler does what I expect, report no animation:
init1
A little mystery

Oh, sorry, I thought you used gui.animate? Then I can’t explain what they gui animations are. Can you reproduce the same result in a small sample project?

1 Like

When I look into source code I see two different counters:

So, Gui.Animation is basically count of box nodes with images, but Gui.ActiveAnimations is count of playing animations.

2 Likes

Ah, that explains it!

2 Likes

@britzl, @AGulev, hello you two.
Thanks a lot for looking into my question.

Animations? Moi? What are you thinking :grinning: No, sorry, I should have made myself clearer.

This is very interesting, thank you very much for having a look at the source code. I wasn’t aware that there are two counters and now I know.

Happy holidays!

Brigitte

Thanks. But I believe what @AGulev found explains it.

ok, file removed.

1 Like