how to "sync" 2 ordered menu

   3229   3   1
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
suppose I have two ordered menus as show in the first 2 images below.

May I ask how to use python code within the “Menu Script” area of the 2nd ordered menu to make the 2nd menu automatically show an item with the same index as that of the item currently chosen in the 1st menu (see the last 2 images)?

Thanks!

Attachments:
Screen Shot 2014-10-22 at 4.58.06 pm.png (45.4 KB)
Screen Shot 2014-10-22 at 4.58.25 pm.png (51.2 KB)
Screen Shot 2014-10-22 at 4.58.50 pm.png (10.2 KB)
Screen Shot 2014-10-22 at 4.59.04 pm.png (9.7 KB)

User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
any suggestions?

Thank you!
User Avatar
Member
387 posts
Joined: Nov. 2008
Offline
Use callback script on driver (first) menu that controls driven (second) menu.
In python something like:
hou.pwd().parm('menu_driven').set(hou.pwd().parm('menu_driver').eval())
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
Thank you very much, pezetko!

a minor variation of your suggestion:

hou.pwd().parm('menu_driven').set(hou.pwd().evalParm(menu_driver'))

I found that the code works when it is in the the main “Code” area of the Python operator node. But it doesn't work when put in the “Callback Script” area for the “driven” menu.

Am I missing something about how to use “callback script” here?

Much obliged!
  • Quick Links