Hello!
I am writing a menu script and I notice that it was called multiple times when activated. Is there a way to have it call the menu script once only?
Thanks!
Menu script called multiple times
3328 6 4- benC
- Member
- 49 posts
- Joined: Feb. 2016
- Offline
- jsmack
- Member
- 7659 posts
- Joined: Sept. 2011
- Offline
- benC
- Member
- 49 posts
- Joined: Feb. 2016
- Offline
- pbowmar
- Member
- 7024 posts
- Joined: July 2005
- Offline
- mike.battcock
- Member
- 22 posts
- Joined: Oct. 2018
- Offline
Is there any update on this?
My menu script is being called 17 times when I select the node.. And I have another menu script that evaluates the first one so combined they get called 64 times…..!
I'm going to try and timestamp the call and only allow another call to the function after one second but we shouldn't have to do that..
My menu script is being called 17 times when I select the node.. And I have another menu script that evaluates the first one so combined they get called 64 times…..!
I'm going to try and timestamp the call and only allow another call to the function after one second but we shouldn't have to do that..
- benC
- Member
- 49 posts
- Joined: Feb. 2016
- Offline
mike.battcockIf you still getting the problem then it probably was't fixed yet. Maybe you can report it as a bug.
Is there any update on this?
My menu script is being called 17 times when I select the node.. And I have another menu script that evaluates the first one so combined they get called 64 times…..!
I'm going to try and timestamp the call and only allow another call to the function after one second but we shouldn't have to do that..
- Andr
- Member
- 900 posts
- Joined: Feb. 2016
- Offline
The other problem is that each menus script is evaluated (6 times) on ANY parameter changes of the node.
Anyway it's not a “bug”. I contacted the support team few days ago for the same concern, I was told the following:
This make the menu script not advisable to be used in an instance of a multiparm folder.
For example, my scenario was the following:
Need to use 4 different Menu Scripts inside a multiparm block list.
Each Menu Script performs a 3 cycles for-loop with some basic paramater evaluation.
On average I have 25 multiparm istances.
Math says that at each parameter change of my digital asset I would trigger 4(menu scripts) * 3(loop-cycles) * 25(instances) * 6(times) = 1800 (!!) loop cycles.
Anyway it's not a “bug”. I contacted the support team few days ago for the same concern, I was told the following:
Multi calls are expected because the results of evaluated parameter scripts and expressions are never cached and typically there are are a few different components in Houdini that are interested in the parameter's menu entries.
This make the menu script not advisable to be used in an instance of a multiparm folder.
For example, my scenario was the following:
Need to use 4 different Menu Scripts inside a multiparm block list.
Each Menu Script performs a 3 cycles for-loop with some basic paramater evaluation.
On average I have 25 multiparm istances.
Math says that at each parameter change of my digital asset I would trigger 4(menu scripts) * 3(loop-cycles) * 25(instances) * 6(times) = 1800 (!!) loop cycles.
Edited by Andr - Sept. 16, 2019 03:37:30
-
- Quick Links