csp Posted July 28, 2014 Share Posted July 28, 2014 (edited) I am using stamp() to change the value of the ordered menu connected to a copySOP. I want to change based on the token value and not their order (0,1,2,3). How that can be achieved? Edited July 28, 2014 by cparliaros Quote Link to comment Share on other sites More sharing options...
holycause Posted July 28, 2014 Share Posted July 28, 2014 right click on you menu - expression -edit expression stamp_example.hip Quote Link to comment Share on other sites More sharing options...
csp Posted July 29, 2014 Author Share Posted July 29, 2014 (edited) Thanks for your reply Puben, but this not what I was looking for. I know how to use stamp. My questions is... in a custom ordered menu: index: 0, token: 1, name: one index: 1, token: 5, name: five index: 2, token: 10, name: ten how the value that comes from stamp will change the selection in ordered menu based on its match with the token and not the index. So, if the values that come from stamp is 1 will match with index 0 which has token 1 and not with index 1 which has token 5. In the example attached , there 3 points with ids 5,6,8 and on the other side of the copy there is an null with custom ordered menu with 3 items, where by default stamp try to match with index of menu's items but it will not as there are out of range (0-2) and gives an error. The idea is to match with their token values. token_example.hip Edited July 29, 2014 by cparliaros Quote Link to comment Share on other sites More sharing options...
holycause Posted July 29, 2014 Share Posted July 29, 2014 (edited) my bad, I used python instead of hscript menu_items = {5:0, 6:1, 8:2} copySop = hou.node('/obj/STAMP_EXAMPLE/copy1') token = copySop.stampValue("token", 1) return menu_items[token] token_example_python.hip Edited July 29, 2014 by holycause 1 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.