Jump to content

Python built menu return index not a string


ben

Recommended Posts

Hi,

I'm still fighting with menues and once again I'm stuck...

here is the problem :

For a python built menu

items = ["Square","Square",
         "Round","Round",
         "Plane","Plane",
         "Corner","Corner"]
return items

I try to get the result in another node :

`chs("../Menu_Script/menu")`

but it returns an int(index of the menu) not a string.

If I built exactly the same menu using Menu_Items, It works as expected and I get a string.

I'm probably missing something very obvious...

any idea ?

thx

MenuItemsVSMenuScript.hipnc

Link to comment
Share on other sites

Unfortunately it is not possible to evaluate script built menus as strings due to something deep down in Houdini that is not easily changed. I tried to have this "fixed" a long time ago but it wasn't something that could happen. The only way to get the token is to use the value and then index into the menu items list at that index.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...