|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| Provide ID to particle in a specific order
|
|
|
Sorry if this as been answer before, but I did not find any information about it.
I have sorted my particles by Y value from the lowest one at 0 and the highest one at 1. Now, I would like to have integer id using that order for every particles. If I have 10 particles, I would like to have the lowest one be 1 and the highest one be 10 and have all integer id in between.
Does anyone know a clever way to do this?
Thanks.
| Attachment
|
|
|
|
|
|
If I understand correctly, that may be rescale from 0-1 to 1-10, round to integer, convert back to scalar if you need.
|
|
|
|
Unfortunatly, no. The 1 to 10 exemple was just to demonstrate my problem. If you look in the image, their are particles with values as close as 0.0039 and 0.0085. Rounding is not a solution.
For now, I am using iteration to provide ID to particles within ranges. I can have layers of particles that way, but it is pretty uggly. I hope to find a better solution that can be boil down to every particles.
Thanks anyway.
|
|
|
|
Hi there,
if I understand correctly, you could use ordered arrays for this type of thing. Be warned though, I’ve found arrays, particularly ‘find in array’ to be pretty slow if you have many particles.
| Attachment
|
|
|
|
|
|
Wow! This is so much cleaner than anything I could come up with. This is exactly what I was looking for. Thanks a lot CiaranM!
|
|
|
|
|
|