Jump to content
wixman

Get point number based on ID or other attribute

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

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×