Dylan Payne

Dylagent

About Me

EXPERTISE
Student
INDUSTRY
Film/TV

Connect

LOCATION
United States

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Generate Bones/Nulls on Points using Python April 9, 2019, 2:22 p.m.

I'm experiencing some trouble spawning null nodes to points in the Python Script node.

What I'm eventually trying to accomplish is a rig that will adjust to changes in a geometry, and add bones based on how many spawns of an object I have. For example, if I have a circle with 12 points, I'll want 12 bone chains (their length determined by a line node) to begin at those points and follow the spawned geometry. If I change that in an hda and reduce the points to 6, I want the rig to update its bones to only have 6 bone chains.

I believe the best way of accomplishing this is to run through the points in the circle node, get their world space positions, and create the nullNode at that position, which the bones will eventually be spawned onto. I'm having trouble actually getting those point values however, and as such can't spawn the null nodes correctly (type_01). the Bones from Curve shelf tool does something very similar to what I'm trying to accomplish.
I'm sure it's something as simple as running through the points in a for loop, getting some sort of vector3 value, and running through those values in another for loop when spawning the null nodes, but I haven't been able to access those point values.

The other way would be to do a lot of math in the python script, and essentially recreate the circle from the obj node (type_02) and mimic the transformations made in the obj network. This solution feels inefficient however.

Delete Geometry when Intersect April 30, 2018, 4:02 p.m.

Ah I see, so I didn't need to enable the compiling. I was a little worried if this shouldn't be done or not, but it works just fine without it.
Thanks!

Delete Geometry when Intersect April 29, 2018, 6:18 p.m.

Should I be putting this into my for-each loop?
At the moment when I do this, it fails to let me compile in the last node of the loop.