wixman Posted March 4, 2012 Share Posted March 4, 2012 (edited) 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 March 4, 2012 by wixman Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted March 4, 2012 Share Posted March 4, 2012 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. Quote Link to comment Share on other sites More sharing options...
wixman Posted March 4, 2012 Author Share Posted March 4, 2012 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? Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted March 4, 2012 Share Posted March 4, 2012 (edited) 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 March 4, 2012 by hopbin9 Quote Link to comment Share on other sites More sharing options...
wixman Posted March 4, 2012 Author Share Posted March 4, 2012 (edited) 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 March 4, 2012 by wixman Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted March 5, 2012 Share Posted March 5, 2012 (edited) 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 March 5, 2012 by hopbin9 Quote Link to comment Share on other sites More sharing options...
wixman Posted March 5, 2012 Author Share Posted March 5, 2012 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 Quote Link to comment Share on other sites More sharing options...
wixman Posted March 5, 2012 Author Share Posted March 5, 2012 done. phew. PATH_DEFORM_TEST.hipnc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.