Particles Density addon

As my daily work depends on planting objects (vegetation) using Particle System, I always find very limiting and time-consuming to manually adjust the particles count all the time as I progress with the scenery.

As I haven’t found any solution so far, I have refreshed my “so-so programming skills” and ended by creating a very simple, but at least for me very useful Blender (2.79) addon, which does this job for me. It is not especially beautiful piece of code, but I think it is very well optimized performance-wise (I tested it on my particles-heavy projects) and it appears to be working :smiley:

Original Behavior

Normally, you set the total Emmission Number to get a density you are happy with.
But as this is the constant number, the density gets lower as you Weight Paint more area (and vice-versa):

Addon Behavior

With the addon, you set the Density parameter instead, and the Emmission Number is adjusted accordingly:

Additionally, even if you modify the emitter mesh, the density keeps the same:

Installation

  • Install it as an usual Addon, search for Density and enable it

  • The new Density settings can be now found in a Particle System tab

Info

  • Each Particle System has now it’s own Density settings (which can be Enabled or Disabled)
  • Once enabled, the initial density value is set automatically to match the current density (so it doesn’t mess-up your work)
  • If enabled, the Emmission Number is now controlled by the addon (so don’t modify it - it will be changed back until you disable the density option)
  • The extra option Update Tolerance is an optimization feature and is useful when using high number of particles - it let’s you set a minimum difference (in percentage) between the configured density and the actual one before the count is updated); it is a global option (Addon Preference), so it will keep the same for all your Blender projects

Limitations

  • The density expects an even mesh as it is currently computed using the overal mesh area, not taking the actual vertex group area into account (this is TODO)
  • As my programming skills are not exactly award-winning ones, maybe the script is doing something extra I am not aware of, so beware :slight_smile:

NOTE: Use at your own risk!
Please be very careful when using the addon, nobody tested it extensively so far (except myself), so even though I haven’t found any bugs, there are almost certainly some - please report any issues you find!

I have placed the addon to Github and would be very happy is someone can test it and report any bugs.

Thanks,
Jan

11 Likes

Hi jendabek,

looks fantastic.
Are you planning a version for Blender 2.8?

1 Like

Hi and thanks, some user on StackExchange already offered making necessary edits to get it work in 2.8, but if it doesn’t happen, I will try it by myself, it should be quite easy. I made 2.79 version because my work relies on features that are no longer available with 2.8 (advanced baking and some BI-specific stuff).

Sounds good to me.
I wish you much success and look forward to the new version.

very useful… thank you.

Really great addon, thanks so much jendabek!

I just released a small addon that in conjunction with yours solves a problem I’ve had constraining consistent amounts of grass and trees in architectural renders to only the cameras I’m using.
Here is the repository: https://github.com/HaroldHyrax/PartiCam

https://blenderartists.org/t/small-addon-that-constrains-particle-generation-to-camera-view-bounds/1285928