Page MenuHome

new 'Scatter Objects' addon [WIP]

Authored by Jacques Lucke (JacquesLucke) on Oct 12 2018, 2:33 PM.
"Love" token, awarded by n-pigeon."Love" token, awarded by 0o00o0oo."Love" token, awarded by ostapblender."Love" token, awarded by dpdp."Love" token, awarded by ambient."Love" token, awarded by stephen_leger.



The goal is to build a new and improved alternative to the 'Grease Scatter Objects' addon which should be removed if this addon is accepted.

The addon is not ready yet.

It might turn this functionality into a tool, however the API for that is not done yet.
Also this code depends a little bit on this patch: D3779
Removing this dependency is easy though. I'm just working on the gpu api and the addon at the same time.

Diff Detail

Event Timeline

last diff was against master -.-

  • cleanup
  • better default
  • cleanup
  • better naming
  • cleanup
  • add newline at end of files
  • cleanup
  • cache line batch
Dan Pool (dpdp) rescinded a token.
Dan Pool (dpdp) awarded a token.
Dan Pool (dpdp) added a subscriber: Dan Pool (dpdp).

What Blender truly needs is a proper tool for instancing and scattering objects. This looks just like a random object painter tool. There are already dozen of ways to do this in Blender, but there is not a single way to for example scatter 10 000 high poly trees along with 20 000 000 high poly grass patches. That's why you don't see pretty much any large scale environments ever done in Blender.

What I would like this to turn into is something like ForestPack. A tool where you can scatter large amount of high poly instances, while having them represented in the viewport as low poly boxes or sparse point cloud, and be able to draw only small % of instances in the viewport but render them all. Currently, even particle system instancing fails at that. This would actually allow Blender users to finally create large scale environments and terrains. Something Blender has been extremely weak at so far.

Looks good. Where can i download the zip file or do i have to download the raw file. I have download the raw file and saved with .py extension. I have installed in 2.79b version but it did not installed. Is that only for 2.8 or where can i download the zip file or the complete addon. Thanks

This addon currently depends on an incomplete API, so unfortunately you can't easily test it atm.

Campbell Barton (campbellbarton) requested changes to this revision.Oct 22 2018, 2:54 AM
Campbell Barton (campbellbarton) added inline comments.

Having poll get selected object list isn't efficient since poll often runs on redraw and this could be 1000's of objects.

Normally these kinds of slow checks are moved into the operator.


suggest to always use tuples if the data can be immutable.


Why not use Pythons random functions?


Use tuples.

This revision now requires changes to proceed.Oct 22 2018, 2:54 AM
  • cleanup and speedup poll
Jacques Lucke (JacquesLucke) marked 3 inline comments as done.Oct 22 2018, 10:08 AM

I implemented the suggested changes.

Pythons random functions are designed to be used in the case when you want to set a seed once and then get many random numbers.
Therefor setting the seed is relatively slow (resetting it for every new random number is not an object).
However this is exactly what I want because it this way I have much more control about how seeds propagate through the functions. One of the benefits in this specific scenario is that increasing the "density" only adds new objects but does not alter the matrices of already visible objects. I found that to be a desirable property.

So instead of using normal random number generator I use this function which basically generates a hash for every integer. I found this specific function to work very well; It is the main source of randomness in Animation Nodes.

@Jacques Lucke (JacquesLucke), ok, makes sense, in that case it would be good to add this statement as a comment in the code.

This revision is now accepted and ready to land.Oct 29 2018, 9:31 PM
This revision was automatically updated to reflect the committed changes.