How can i do this in Vex instead of Python?
i have managed to get the index of the ordered menu but not the label
VEX - get ordered menu label
4053 6 1-
- papsphilip
- Member
- 388 posts
- Joined: July 2018
- Offline
-
- tamte
- Member
- 9696 posts
- Joined: July 2007
- Offline
I don't think you can get menu labels in VEX, VEX would potentially have to evaluate the menu script to get the labels which would be a huge bottleneck and probably not even thread safe
do you have a reason for not having the menu value and label being the same?
like instead of having your menu defined as:
0 | something
1 | something else
2 | one more thing
you can have:
something | something
something else | something else
one more thing | one more thing
and then you should get expected string using your code
do you have a reason for not having the menu value and label being the same?
like instead of having your menu defined as:
0 | something
1 | something else
2 | one more thing
you can have:
something | something
something else | something else
one more thing | one more thing
and then you should get expected string using your code
Edited by tamte - April 11, 2022 15:06:29
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- papsphilip
- Member
- 388 posts
- Joined: July 2018
- Offline
tamte
I don't think you can get menu labels in VEX, VEX would potentially have to evaluate the menu script to get the labels which would be a huge bottleneck and probably not even thread safe
do you have a reason for not having the menu value and label being the same?
like instead of having your menu defined as:
0 | something
1 | something else
2 | one more thing
you can have:
something | something
something else | something else
one more thing | one more thing
and then you should get expected string using your code
Thank you! nice and simple
btw i was doing this in python module in order to pick an object and change its pscale but python was throwing me an error that the geometry is read only. i remember reading something about that. That python cant alter geometry?attributes? so i moved the setup to VEX. i am probably wrong but didnt have much time for debugging
Edited by papsphilip - April 13, 2022 15:52:41
-
- tamte
- Member
- 9696 posts
- Joined: July 2007
- Offline
papsphilipit can
. That python cant alter geometry?
- either during the cook of Python SOP, so as long as your code is in Python SOP you can alter currently cooked geo same way as Wrangle is affecting currently cooked geo using VEX
- or you can alter any geo that's not read only, like frozen geo copy in memory and then inject it into Geometry Data parameters for example
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- papsphilip
- Member
- 388 posts
- Joined: July 2018
- Offline
-
- tamte
- Member
- 9696 posts
- Joined: July 2007
- Offline
papsphilipbig difference
i was trying to do that in a python module actually. Is there a difference?
since Python SOP executes the python when it's cooking the node, so it's allowed to process the input geo and create output geo
Python anywhere else can't modify geometry of another node, it can modify geometry of Geometry Data parameters for example or geometry in memory, etc
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- papsphilip
- Member
- 388 posts
- Joined: July 2018
- Offline
-
- Quick Links

