Get the name value from Context Option Editor

   2771   1   2
User Avatar
Member
41 posts
Joined: Dec. 2017
Offline
Hey all,

Is it possible to get the name value from a string menu?

I'm using the int value to drive a switch but I'd also like to use the name for driving render paths etc


Thanks as always!

Attachments:
image_2021-06-08_120339.png (35.5 KB)

User Avatar
Member
41 posts
Joined: Dec. 2017
Offline
Just adding some extra information here that was received from the devs and support:

"If you don't mind parsing then `hou.contextOptionConfig` contains that information (among other stuff). I don't think there is a way to directly access it though. You could also build a render path using the int value `shot_1` has int value `1`, `shot_100` has int value 100."

A better option for what I needed it for specifically is this:

"You could use a multi-line parameter expression, as you probably want to catch updates to the context option menu. A nicer solution is to drive your switch by name instead of by index, then add a null at the end of the shots that describes the shot name. Then instead of your string menu having integers as value you could have the shot names and drive your switch with that value."

Cheers!
  • Quick Links