luoqiulin Posted November 13, 2009 Share Posted November 13, 2009 when i use python >>>a = hou.node("obj/grid_object1/group1").evalParm('pattern') >>>a '40 50-52 60-63 70-74 80-85 90-95 ' how can i change the it like this? '40 50 51 52 60 61 62 63 70 71 72 73 74 80 81 82 83 84 85 90 91 92 93 94 95 Quote Link to comment Share on other sites More sharing options...
johner Posted November 13, 2009 Share Posted November 13, 2009 when i use python >>>a = hou.node("obj/grid_object1/group1").evalParm('pattern') >>>a '40 50-52 60-63 70-74 80-85 90-95 ' how can i change the it like this? '40 50 51 52 60 61 62 63 70 71 72 73 74 80 81 82 83 84 85 90 91 92 93 94 95 If you're using hscript, you can use the pointpattern expression to do this, so: pointpattern("obj/grid_object1/group1", "40 50-52 60-63 70-74 80-85 90-95") will yield the series of individual point numbers. In Python you can do it with hou.Geometry.globPoints then turn the point numbers in to a string, if that's what you need, so something like: n = hou.node("obj/grid_object1/group1") pattern = n.evalParm('pattern') pts = n.geometry().globPoints(pattern) return " ".join(str(pt.number()) for pt in pts) Something along those lines should work, I think. 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.