← All ideas
  • Published 6 Dec 2022

Add a total # of points as a cap on density (for Distrbute Points on Faces node)

I t would be nice to have the ability to cap the total number of points that a "Distribute points on faces" is able to generate.

This would be like a safety check where you could force the node to stop generating points after a certain # of points. By default it could be set to 1000 (or some other arbitrarily low number). Then the user could up that value to a level that they feel their system can handle. Perhaps that could even be set as a preference so that it sticks across sessions.

Currently it is far too easy to have a density set very very low (like .0001) and then, absentmindedly, plug in a texture and suddenly you have a value of 1 (for example) and you lock up your Blender session. And since scale interacts so closely with density, it is extremely easy to overwhelm your Blender session.

The cap would force this to limit itself to whatever safety value you had set and allow you to recover from these issues.

Ideally there would also be an attribute you could use to ignore this value - so that renders could use the full density amount without limitation.

If the limit is hit, the node should warn the user that the limit was hit before the total density calculation was completed.

66.7%

Development Status: Open

Upvote 2 Downvote 1
bvz
6 Dec 2022

4 Comments

Ismir_Egal

It's not hard to randomly discard a percentage of your points based on a set maximum. This step can be done quick - both regarding the setup and the performance.

bvz Author

That is correct (and helpful, thanks). But unfortunately it still does not fix the original problem. Since density is tightly coupled with scale, if you have a large scale you can VERY easily lock up your Blender session by accidentally triggering it to generate hundreds of millions of points. That means you have to kill your session (and lose all of your work if you haven't properly saved yet).

Randomly discarding is of no use at this point because you have already crashed your scene.

And this can happen extremely fast and easily. Here are just a few examples of everyday things that can lock up your scene if you have one of these nodes in it:

  1. You have scaled up your object and then you decide to apply your scale.

  2. You simply attach a Distribute Points of Faces node with the default density setting to a large object (thinking you will insert the node first and then adjust the density).

  3. You have carefully adjusted the density to .00001 and then you attach a map to the density parameter. (or any other input that might have a default value much greater than .00001).

There are other examples, but these are just some of the ways I have managed to crash Blender in the last day or so.

If we had a cap, then making an innocent step like the above would not result in a locked up Blender session. Instead it would hit its limit, indicate somehow that it has hit the limit before hitting the max number of points, and then stop. Returning control to the user.

I am open to other options, including a global setting that pops up a dialog before generating more than a (user-defined) number of points. But somehow we need to make sure that every day actions that are normal for one scene does not lead to a crash in another.

1
Ismir_Egal

This reactive setup works for up to half a billion points. If you use the bounding box to calculate the absolute size, the issues from scaling can be avoided proactive as well. However, this is just me defending myself - i just don't want to see that parameter on the node, since other ones have similar, often hardware-dependent problems.

If we expand this Blender in general, you're absolutely right - we definitely need a way to set these limits. Nodes like DPoF have a proportional error - if the user changes the input by a factor of x, the output will feature a change in the same magnitude. Some operations are so much worse, like the voxel remesh, which features hyperbolic growth. Pulling the "Voxel Size" slider all the way to the left makes you go from no issues straight to crashing Blender in less than a centimetre. The most common example would be Subdivision, featuring exponential growth. Here, the input has been limited by soft limits, but the problem applies here as well.

The global setting would mentioned would be perfect. Not node-specific, but rather a gloabal maximum vertex count, a point limit, ect. Any operations performed should then check themselves if they infringe these limits.

1
bvz Author

I think you have convinced me. A global preference does make a lot more sense than putting it on the node itself. Should I edit my original posting to indicate that I would prefer a different solution?

The other option that I would like to see is the option to specify the total number of points instead of a density value (like Clarisse iFx or MASH). I find that I tend to dial the density to hit my desired number of points rather than just set it straight away. In Clarisse I approach it from the other direction: I dial the number of points to achieve my density. From a "safety" standpoint this is a lot easier to control my scene.

Yes, there is the need to have density maintained across different geometries, so I would not eliminate the density option. But I find I am more likely to mess with the scale (or plug something into the "Distribute points on faces" node to control the distribution) than I am to try to have exact density matches across meshes.