[help] create a curve by a list of points

   3518   2   1
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
I want to create a curve by a series of points following their respective point numbers. However, the python code used in the Curve node doesn't work.

pts = hou.pwd().geometry().points()

pts_list = “”

for pt in pts:
x = pt.position()
y = pt.position()
z = pt.position()
pts_list = pts_list + str(x) + “,” + str(y) + “,” + str(z) + “ ”

print pts_list


Can anybody kindly help to take a look and advise on what's wrong?

Thanks!

Ji

Attachments:
pt.PNG (5.1 KB)
CreateCurveByPts.hipnc (36.4 KB)

User Avatar
Member
512 posts
Joined: July 2009
Offline
Your file didn't work because instead of iterating through the points of the input node you had your code looking up the points of the curve node itself which caused an infinite recursion.

Check out the attached file,

cheers!

Manu

Attachments:
createcurvebypts_879.hipnc (41.7 KB)

http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
Hi, asnowcappedromance, thanks a lot for your advise! - Ji
  • Quick Links