magneto Posted April 2, 2012 Share Posted April 2, 2012 This is similar to the VOP problem I had but different because at the object level I can't figure out how to refer to it. I have an ordered menu where the type is set to string and looks something like this: token / name nurbs / NURBS poly / Polygons but using ch("../menu") == "nurbs" chs("../menu") == "nurbs" etc doesn't work for the Select Input of the Switch SOP. Any ideas? Thanks Quote Link to comment Share on other sites More sharing options...
anim Posted April 2, 2012 Share Posted April 2, 2012 why aren't you using integer ordered menus? 0 'NURBS' 1 'POLY' . . . it's so much easier to use in Switch SOP, since you immediately know the value Quote Link to comment Share on other sites More sharing options...
magneto Posted April 2, 2012 Author Share Posted April 2, 2012 I could use it but I copied the Composite VOP that was also using strings. I think this might be due to having them in code makes it more self-explanatory. Since I did the same and brought those parameters to asset level, I am facing the same problem at the geometry level. Also I have 6 menu items. Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted April 2, 2012 Share Posted April 2, 2012 (edited) Try something with python, where you use the chs() to find the index in an array. That will convert the string to an integer for the switch. EDIT: http://stackoverflow...ent-in-an-array I think the second answer is what you need, cause you're list will be constant. Edited April 2, 2012 by hopbin9 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted April 2, 2012 Author Share Posted April 2, 2012 Thanks hopbin. How do I access the menu item array? I was actually expecting chs to work with the comparison because it works if I use it for a name field like the Group name in backticks. So it actually gets the correct token string, but just not in a comparison. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.