Changing label names when ordered menu item selection changes

   3969   3   2
User Avatar
Member
7 posts
Joined: March 2017
Offline
Hi!
Is it possible to change label text for some specific parameters when selecting different menu items?
For example I have an Ordered Menu parameter which contains 2 items in it: ‘squares’ and ‘voronoi’.
I've placed 2 floats below this menu and I want their labels to be changed depending on selected menu parameter item.
When ‘squares’ are selected, the labels should contain ‘size X’ and ‘size Y’ text;
And when ‘voronoi’ are selected, the labels should contain ‘density’ and ‘height’ text.
I've attached some images as example. So is it possible to make some sort of script to change those labels on the fly, especially when using in UE4 or Unity as a Digital Asset.
Thanks!

P.S. sorry, my bad. Posted in the wrong section, Should've posted in “Houdini Indie and Apprentice ”
Edited by Ivan_Titov - March 15, 2017 18:03:49

Attachments:
Capture.PNG (3.7 KB)
Capture2.PNG (6.7 KB)
Capture3.PNG (4.0 KB)

User Avatar
Member
85 posts
Joined: May 2011
Offline
try hide-show instead.
something like this :

menu A choice –> parm 1-2 show parm 3-4 hide
menu B choice –> parm 1-2 hide parm 3-4 show


hope it's clear enought.
Edited by dedeks2999 - March 16, 2017 16:16:01
— dedeks 3000 —
User Avatar
Member
7 posts
Joined: March 2017
Offline
Thanks for the advice.
I've learned some python scripting and made a simple script in DA scripts section that runs when menu item selection changes:
def onListSelectEx(me, parm):
    if parm.eval() == "squares":
        me.parm("sizeX").hide(True)
        me.parm("sizeY").hide(True)
        me.parm("density").hide(False)
        me.parm("height").hide(False)
    else:
        me.parm("sizeX").hide(False)
        me.parm("sizeY").hide(False)
        me.parm("density").hide(True)
        me.parm("height").hide(True)
It works fine in houdini, but it doesn't works in Unreal Engine.
It could be a dumb question, but does python scripts works in digital assets outside Houdini, when using in Unreal Engine or Unity?
Thanks!

Upd. uh, just forgot to press “recook asset”. It's good now
Edited by Ivan_Titov - March 17, 2017 08:46:07
User Avatar
Member
7 posts
Joined: March 2017
Offline
I'm also trying to change parameter labels in the same script, but it doesn't works. Any ideas why? Here is an example:
me.parmTuple("strParam1").parmTemplate().setLabel("New Label")
Edited by Ivan_Titov - March 17, 2017 10:39:38
  • Quick Links