Jump to content

Get point number based on ID or other attribute


wixman

Recommended Posts

I need to reference a point attribute on a particle system from within a forEach SOP -

I'm using this expression right now:

point("../../PSCALE_OUT", stamp("..", "FORVALUE",0), "pscale", 0)

With the FORVALUE being used to select the point number, which works fine, until particles start dying and and point numbers are shifted. I'd like to use the particle's ID as this is constant, and I'm aware of functions like "poppointnum" but as far as I know these only work from within POPs.

Edited by wixman
Link to comment
Share on other sites

This would only work if the ForEach SOP was iterating points, and that the point counts of the ForEach SOP and Particle system were the same.

If this is true, then use the Attribute Copy SOP to copy the pscale attribute over from the particles before you start the ForEach SOP, then all you have to do is use $PSCALE in the ForEach SOP.

Link to comment
Share on other sites

This would only work if the ForEach SOP was iterating points, and that the point counts of the ForEach SOP and Particle system were the same.

If this is true, then use the Attribute Copy SOP to copy the pscale attribute over from the particles before you start the ForEach SOP, then all you have to do is use $PSCALE in the ForEach SOP.

I'm iterating over primitives (curves) generated from the particles in pops and creeping geometry over this curves in a foreach. There are the same number of curves that there are particles though - so this should still work right?

Link to comment
Share on other sites

Did you create the curves using the Trail SOP? cause it will keep the point attributes from the POP.

If the points for the curves still have the pscale attribute, then you could use the Attribute Promote SOP to copy pscale from the point level up to the primitive level

EDIT: I actually do this exact thing in my next tutorial.

Edited by hopbin9
Link to comment
Share on other sites

Did you create the curves using the Trail SOP? cause it will keep the point attributes from the POP.

If the points for the curves still have the pscale attribute, then you could use the Attribute Promote SOP to copy pscale from the point level up to the primitive level

EDIT: I actually do this exact thing in my next tutorial.

Bah! Tried for a bit, but couldn't get it to work!

Would you mind looking at my test scene?

Look in the 2nd foreach for a sticky with a note

PATH_DEFORM_TEST.hipnc

Edited by wixman
Link to comment
Share on other sites

These ribbons you're using to creep the spheres. They have pscale on their points, but pscale is not constant across the length of the ribbon. Take a look in Details View. So which pscale, and also why use pscale?

I fail to see why or what you're trying to achieve.

Are you just trying to stretch the sphere's in the direction of travel?

Edited by hopbin9
Link to comment
Share on other sites

I'm trying to get the same effect as copying spheres to the original particle system but with the geometry deforming to match the arc of motion. So I was creating ribbons to creep the spheres across using a secondary particle system

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...