nametopoint in expression

   773   2   1
User Avatar
Member
9 posts
Joined: Feb. 2021
Offline
I am trying to retrieve data off kinefx joints and use it in a parameter.

In vex, I can use the function nametopoint() to identify the correct point number using the name of the joint.

Unfortunately, I can't find the equivalent way to identify the right point number in a parameter expression.
If I use the hscript point() function, I need to know the point number ahead of time and the expression will break every time I modify the skeleton.

Is there an hscript funtion to find a point number based on another attribute (preferably name)? I can't find one.
User Avatar
Member
85 posts
Joined: May 2011
Offline
Not in HScript but in Python :


geo = hou.pwd().geometry()

names = geo.pointStringAttribValues("name")

pt = geo.point(names.index(name)).number()

return pt
— dedeks 3000 —
User Avatar
Member
9 posts
Joined: Feb. 2021
Offline
Aha!
Brilliant, thank you.

I guess I need to focus on Python rather than hscript.
  • Quick Links