Array
May 7, 2008 22:58:53
Hey guys,
I have a curve which was defined as such:
curve = hou.node('/obj').createNode('geo', ‘curve’)
curve.node('file1').destroy()
curve.createNode('curve')
And I am accessing the data in the curve as follows:
curve = hou.node('/obj/curve/curve1').geometry()
How do I add points to this curve procedurally using Python? I looked into createPoint(), but that just confused me further. :?
edward
May 8, 2008 02:20:24
Nodes such as SOP are meant to create the geometry data from its parameters. So modifying the output of the node is not a good idea. So you have two choices:
- Manipulate the node's parameters instead, OR
- Create a Python SOP operator, which then you can write the code for that creates the geometry.
Array
May 8, 2008 10:22:38
Hmmm, is there any way to declare a curve and all of its points in one fell swoop then?
edward
May 8, 2008 10:31:11
Setting point positions on the Curve SOP's parameters (in python) should be ok, no?
Array
May 8, 2008 11:27:36
edward
Setting point positions on the Curve SOP's parameters (in python) should be ok, no?
I'm not quite sure what you mean. Can you elaborate please?
I think I should have been more specific in the outset of this thread…what I'm trying to do is to make a curve which follows the geometry of a polygonal object. That is to say, given that I have an object in the scene, I want to make a curve whose set of points is a superset of the verticies of a polygonal object.
edward
May 8, 2008 13:21:21
Here's how to do it using the Curve SOP. If you want to do it in python, then it's just a matter of setting the Curve SOP's parameter to the appropriate point numbers.
Array
May 8, 2008 21:13:19
edward
Here's how to do it using the Curve SOP. If you want to do it in python, then it's just a matter of setting the Curve SOP's parameter to the appropriate point numbers.
Cool, thanks for taking the time to upload that file. I guess what I'm really having trouble with is figuring out just how to set the parameters using Python.