tfreitag Posted May 29, 2018 Share Posted May 29, 2018 Hey, I have the following issue. I have an ID attribtues wich looks following: 0,0,0,1,1,344,344,344,344,999,999 Now I want increase by one, like so: 0,0,0,1,1,1,2,2,2,3,3,3 I tried a lot i.e. partition sop, loopings with vex...but no success. Does anyone have an idea? thanks. tom Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted May 29, 2018 Share Posted May 29, 2018 If i understood you right then... sort_id.hipnc 1 Quote Link to comment Share on other sites More sharing options...
tfreitag Posted May 29, 2018 Author Share Posted May 29, 2018 (edited) perfect!! thats what I want. i did the vex code in point mode...so detail mode and the loop over you point is way to go. thanks! Edited May 29, 2018 by tfreitag Quote Link to comment Share on other sites More sharing options...
Noobini Posted May 30, 2018 Share Posted May 30, 2018 I had a go with python..and for good measure, I sabotaged the nicely ordered ID sequence by randomizing the order 0,0,0,1,1,344,344,344,344,999,999. beside needing an extra partition node, the python code is actually quite succinct. node = hou.pwd() geo = node.geometry() i = 0 for group in geo.pointGroups(): # loop for each group for point in group.points(): point.setAttribValue("id",i) # reset id to sequential counter i += 1 sort_id_python.hipnc 1 Quote Link to comment Share on other sites More sharing options...
tfreitag Posted June 3, 2018 Author Share Posted June 3, 2018 thanks for sharing the python approach. good to have a alternative solution. 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.