FIXED: Menu Source Function is call way too often

Hi,
The menu source function of a menu is call way too often.
It’s call anytime a parameter of the COMP change even if the parameter is on a different page that the one that contains the menu.
That is problematic as it quickly slow down everything


menuobject.toe (3.6 KB)
TouchDesigner 2020.25380_ C__Users_whitevoid_Desktop_menuobject.1.toe_ 2020-10-13 13-09-01.zip (3.1 MB)

Cheers,
Colas

2 Likes

+1 same problem here

Can also reproduce this :confused:

Thanks, looking into it.

There was some discussion on this topic, including some ways to avoid the extra updating here:

Cheers.

Hi Rob,
Thanks for the reply.
I can understand why the call back is called frequently.
But I don’t understand why it needs to be called 4 times when I expand a menu that contains 3 elements.
I still believe that there is some behavior that can’t be correct.
For example :
If i change the value of a completely unrelated parameter on a different page than the menu, the menu callback is still called 4 times per value change.
Why does this happen when the menu is not even visible ?
You can see that behavior in the video I attached to the original post.
We put a caching system in place to compensate the fact that the callback is called too frequently.
Cheers,
Colas

2 Likes

Thanks for the extra information.
I’ll see if I can reduce the number of updates in this case, but currently it’s based on its existence in the parameter dialog, which may be accessed by a number of locations,
not whether or not it is currently visible.
Cheers,
Rob.

1 Like

Update: we’ve reduced a number of the extra calls in 2020.45430, during menu clicks
and menu rollovers, but still keep in mind the callbacks may be called during other times.

callbacks may be called during other times.

Can you quickly explain what events besides clicks and hovers could trigger those callbacks?

The next largest source of calls is when other parameters on the operator are changed, and we’re looking into that one as a general optimization task.
In general its mainly when the values of the parameters need to be refreshed for the UI.

2 Likes

Great thanks a lot :slight_smile: