get ptnum from an id in a pop

   9271   4   1
User Avatar
Member
26 posts
Joined: Nov. 2008
Offline
Does anyone know how to get a point number of a point if I have an id (in a pop network)? I'd like to write my own follow vop pop, and I'd like to use “import_attribute” using an id rather than ptnum. poppointid is very similar to what I want, except that's an expression, and I'd rather contain this all in a pop vop.
Scott Peterson, Machine Learning Graphics Engineer, Unity
User Avatar
Member
89 posts
Joined: April 2008
Offline
Hi Scott,

In a vop pop, you should have “ptnum” available as a global variable. If you're trying to get to that in sops, you can either export ptnum from the vop, or use the attribute pop with $PT as the value. Does that help?
User Avatar
Member
26 posts
Joined: Nov. 2008
Offline
Sorry, that's not what I'm looking for.

I want the ptnum for a different particle than the one that I'm processing. I would like to look up the position and velocity of a parent particle. I can do this by adding attributes and using the expression poppointid(“P”, $PARENT, 0), but I'd like to do this all within a pop vop if possible, and without adding the extra attributes.
Scott Peterson, Machine Learning Graphics Engineer, Unity
User Avatar
Member
89 posts
Joined: April 2008
Offline
sorry misread your question.

If its only a matter of containing everything inside the vop maybe you could use the expression on a parameter vop, otherwise not sure how to go about that.
User Avatar
Member
665 posts
Joined: July 2005
Offline
We developed a slick way of doing this with the Python SOP.

I'm not sure what you're after, but basically, we had to run a for loop over the points, and compare it to the id list.

This can provide good matching, if a bit overhead. Also notice the new Point SOP can match by attributes, instead of just Point Numbers!

Heh, yea… there's not a direct way for this, but hope you can find a sweet work around.

cheers,
-j
  • Quick Links