Jump to content

Altering Particle/point Attributes


Recommended Posts

Is there a way to modify a particle/points attribute(s) (while this point is NOT being accessed in say an attribute create SOP / POP? You know, something very similar to the point() or poppoint() expression but a "set_point()" expression.

e.g.:

{

for (float i = 0; i < $NPT; i++)

{

set_point(i, "myAttribute", 0, i);

}

}

Given this is a trivial example and there's a better way to do this, but the question remains.

Thanks in advance.

Link to comment
Share on other sites

Is there a way to modify a particle/points attribute(s) (while this point is NOT being accessed in say an attribute create SOP / POP? You know, something very similar to the point() or poppoint() expression but a "set_point()" expression.

e.g.:

{

for (float i = 0; i < $NPT; i++)

{

set_point(i, "myAttribute", 0, i);

}

}

Given this is a trivial example and there's a better way to do this, but the question remains.

Thanks in advance.

I am not sure if that's what you need, but I would suggest grouping your particles in 2 groups: "Accessed particles" and "Non-accessed particles" and change the attrubutes, based on particles grouping.

-oink-oink

Link to comment
Share on other sites

I am not sure if that's what you need, but I would suggest grouping your particles in 2 groups: "Accessed particles" and "Non-accessed particles" and change the attrubutes, based on particles grouping.

-oink-oink

No, I don't think that's going to be what I need/mean. There's actually no current project I'm working on that I need this for, but I have found in past projects I've frequently wanted this feature.

For example, in my last project, "tiny" (if you're not familiar with "tiny" you can check it out in the WIP forum). But in there I had spaceships that flew around and blew the crap out of each other. To determine if a laser had hit a ship or not, there was a for loop that looped through all of the ships, and checked if there was a laser beam that was within a certain distance from the ship to the laser. If that threshold was met, the ship's particle would be killed. Simple enough. But let's say, I wanted to kill the laser particle as well - do I have to do another for loop that iterates through every laser to see if it's within the distance of a ship? Doesn't that seem repetitive (and slow)?

Link to comment
Share on other sites

No, I don't think that's going to be what I need/mean. There's actually no current project I'm working on that I need this for, but I have found in past projects I've frequently wanted this feature.

For example, in my last project, "tiny" (if you're not familiar with "tiny" you can check it out in the WIP forum). But in there I had spaceships that flew around and blew the crap out of each other. To determine if a laser had hit a ship or not, there was a for loop that looped through all of the ships, and checked if there was a laser beam that was within a certain distance from the ship to the laser. If that threshold was met, the ship's particle would be killed. Simple enough. But let's say, I wanted to kill the laser particle as well - do I have to do another for loop that iterates through every laser to see if it's within the distance of a ship? Doesn't that seem repetitive (and slow)?

Hey,

Not sure if this helps for your "tiny" example, but couldnt you just use an attribute transfer from the ships particle to the laser particle to get a distance threshold or use a proximity pop and "add nearest distance" attribute to get your distance threshold?

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...