Generate Bones/Nulls on Points using Python

   1207   1   1
User Avatar
Member
6 posts
Joined: Feb. 2018
Offline
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.

Attachments:
bonesToPoints.hipnc (897.0 KB)

User Avatar
Member
19 posts
Joined: March 2019
Offline
I couldn't open your file . Can you check it
  • Quick Links