1
$\begingroup$

Is it possible to count how many particles are located inside a cube in a given frame?

enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

If you create a BVHTree from the cube, you can test individual particles

Counting Particles in a Cube

Here's a node setup using Animation Nodes. I iterate through the particle locations, and test whether particle locations are within a cube using the BVH "Is Inside Volume" node. Then I just count the boolean YES results.

I'm sure this could be done in python using similar logic.

$\endgroup$
1
  • $\begingroup$ Works great. Thank you! I wonder how easy it would be to give particles inside the cube a different color. $\endgroup$ Commented Mar 4, 2020 at 18:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .