# Question about GUI.Animations in the profiler

**URL:** <https://forum.defold.com/t/question-about-gui-animations-in-the-profiler/69968>\
**Category:** Questions\
**Created:** [December 22, 2021, 5:41pm UTC](https://forum.defold.com/t/question-about-gui-animations-in-the-profiler/69968 "2021-12-22T17:41:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon95708182](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@anon95708182](https://forum.defold.com/u/anon95708182)\
**Post date:** [December 22, 2021, 5:41pm UTC](https://forum.defold.com/t/question-about-gui-animations-in-the-profiler/69968/1 "2021-12-22T17:41:06Z")

</div>

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.

 ![rect882](https://forum-defold-uploads.b-cdn.net/original/3X/b/a/ba1d4c705518cafa3424e009395d6913eb7d326c.png)

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

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 23, 2021, 5:43am UTC](https://forum.defold.com/t/question-about-gui-animations-in-the-profiler/69968/2 "2021-12-23T05:43:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon95708182](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@anon95708182](https://forum.defold.com/u/anon95708182)\
**Post date:** [December 23, 2021, 8:39am UTC](https://forum.defold.com/t/question-about-gui-animations-in-the-profiler/69968/3 "2021-12-23T08:39:51Z")

</div>

Good morning @britzl,

thank you very much for your reply.

> [@britzl](#):
>
> 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 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](https://forum-defold-uploads.b-cdn.net/original/3X/3/1/31abeef08c36422f4657671bcd85d3204d6ddf65.png)  
A little mystery

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 23, 2021, 7:32pm UTC](https://forum.defold.com/t/question-about-gui-animations-in-the-profiler/69968/4 "2021-12-23T19:32:52Z")

</div>

> [@anon95708182](#):
>
> But… there is no gui.animate() call

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?

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [December 23, 2021, 7:46pm UTC](https://forum.defold.com/t/question-about-gui-animations-in-the-profiler/69968/5 "2021-12-23T19:46:12Z")

</div>

> [@anon95708182](#):
>
> 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).

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

> <https://github.com/defold/defold/blob/e43d9480b44c4852a09a161907e419bfffb56444/engine/gui/src/gui.cpp#L1736-L1737>

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

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 23, 2021, 8:27pm UTC](https://forum.defold.com/t/question-about-gui-animations-in-the-profiler/69968/6 "2021-12-23T20:27:08Z")

</div>

> [@AGulev](#):
>
> `Gui.Animation` is basically count of box nodes with images, but `Gui.ActiveAnimations` is count of playing animations

Ah, that explains it!

---

<div class="post-metadata">

**Author:** ![anon95708182](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@anon95708182](https://forum.defold.com/u/anon95708182)\
**Post date:** [December 24, 2021, 8:25am UTC](https://forum.defold.com/t/question-about-gui-animations-in-the-profiler/69968/7 "2021-12-24T08:25:12Z")

</div>

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

> [@britzl](#):
>
> Oh, sorry, I thought you used gui.animate?

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

> [@AGulev](#):
>
> So, `Gui.Animation` is basically count of box nodes with images, but `Gui.ActiveAnimations` is count of playing animations.

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

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 24, 2021, 9:59am UTC](https://forum.defold.com/t/question-about-gui-animations-in-the-profiler/69968/8 "2021-12-24T09:59:14Z")

</div>

> [@anon95708182](#):
>
> There you go, in case you get bored.  
> [pages copy.zip](https://forum.defold.com/uploads/short-url/nCl3Lqdw8XIqQ78U9WRE44fD6yR.zip) (25.8 KB)

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

---

<div class="post-metadata">

**Author:** ![anon95708182](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/a/ce7236/32.png) [@anon95708182](https://forum.defold.com/u/anon95708182)\
**Post date:** [December 24, 2021, 10:03am UTC](https://forum.defold.com/t/question-about-gui-animations-in-the-profiler/69968/9 "2021-12-24T10:03:41Z")

</div>

ok, file removed.
