cruiserandmax Posted May 9, 2015 Share Posted May 9, 2015 (edited) Are there any convenience functions in the python HOM to expand/condense "group" type lists of geometry? Or do I have to write my own python functions to handle this? For example I want to change: 1 5 8-11 13 into 1 5 8 9 10 11 13 or the other way around. Also I'd like to be able to clean up: 1-10 5-12 20 into 1-12 20 Before I deal with it myself I figured there might be something in HOM that helps since it's such a standard way of listing geometry in Houdini. Thanks! Edited May 9, 2015 by cruiserandmax Quote Link to comment Share on other sites More sharing options...
edward Posted May 10, 2015 Share Posted May 10, 2015 If you have the actual geometry, then for expanding, you can make use of hou.Geometry's globPoints(), globPrims(), etc. that returns you back a tuple. So untested code would be something like: " ".join([str(pt.number()) for pt in geo.globPoints("1 5 8-11 13")])I'm not sure if there's an easy one liner for condensing though. Quote Link to comment Share on other sites More sharing options...
cruiserandmax Posted May 10, 2015 Author Share Posted May 10, 2015 Thanks, that is an elegant combination of python and globPoints()! 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.