Page MenuHome

new 'Scatter Objects' addon [WIP]
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Oct 12 2018, 2:33 PM.
Tags
None
Tokens
"Love" token, awarded by hitrpr."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.

Details

Summary

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

Repository
rBA Blender Add-ons
Branch
object_scatter
Build Status
Buildable 2213
Build 2213: arc lint + arc unit

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.
object_scatter/operator.py
53

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.

342–349

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

418–423

Why not use Pythons random functions?

object_scatter/ui.py
126–129

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.

@Jacques Lucke (JacquesLucke) this is an amazing scatter tool! For total usefulness, how do you see any option to make some grid patterns, like hex, quad, radial, and some offsets? useful for hardsurfaces, city buildings and so.

@Jacques Lucke (JacquesLucke) this is an amazing scatter tool! For total usefulness, how do you see any option to make some grid patterns, like hex, quad, radial, and some offsets? useful for hardsurfaces, city buildings and so.

Totally support this, a few patterns could be a very good addition to this :)

@Jacques Lucke (JacquesLucke) this is an amazing scatter tool! For total usefulness, how do you see any option to make some grid patterns, like hex, quad, radial, and some offsets? useful for hardsurfaces, city buildings and so.

That will be awesome!!

Any news on the state of this tool? Is it ready to be used in 2.8? we are testing different options for scatteting large amounts of objects in gigantic environments and I'd love to test this under EEVEE to see how it can hope with high poly assets.