Again: Greenery
You may remember me being not really happy with my Sapling trees, and I planned to replace them. But this won't be topic here. This is about organizing objects.
You might as well remember me adding lots of OpenStreetmap trees to my scenery and converting them from mesh data into group instances (if you have forgotten, just look here).
At the moment my scenery contains about 30.000 trees and shrubs - each of them being a group instance, represented by an empty. This seemed to be a good idea to me, because it keeps the amount of vertices low.
But now I have to recognize that this architecture is slowing down my system extremely - almost making it impossible to work with the file.
I'll have to look for some alternative.
And finally you may remember the reason for me doing so: Each single OSM tree object coming along with unique information about location, size and rotation, and I wanted to copy those attributes to my tree instances.
As you've seen I got what I wanted. But if the price would be a huge, un-editable file, it's not worth while.
Let's have a short look at those informations I wanted to keep:
- Location: Okay. This is a "must".
- Rotation: What the hell? Who would ever care if a tree is angled 45 degrees against Z, or 234 or whatever? I guess the only thing being important here is having the trees rotated in a certain individual angle at all, just to have them not looking like copies...
- Size: that's the only point I was wondering about. Being not an OSM specialist at all I was insecure if this information was authentical (traced by users), or if the addon just brings in some size variation by the use of some random-based algorithm.
Somewhere I read Blender wasn't designed to deal with thousands of objects. Respecting this it's obvious why my file isn't working.
On the other hand I never heard about difficulties if you have to deal with objects consisting of thousands of vertices...
Therefor I decided to do another attempt working with particle systems.
Generally the idea is having one single mesh including all tree objects as single verts (each of them being at the given location of course), then set up a particle system using "Hair" option and having each hair replaced by a tree.
Furthermore saving the information, which kind of tree or shrub it should be.
The operating process follows the same logical rules than before; it's just the opposite way. So I'm gonna keep it quite short:
- Define a group consisting of exactly one vertex, located at 0/0/0.
- Replace the former tree instances through single-vert-group instances. Do so for each tree and shrub variation (Select / Linked / Dupligroup).
- Make duplicates real (Ctrl + Shift + "A").
- Result will be multiple one-vertex-objects which could easily be joined to one mesh.
- Important to know: You'll get linked data doing so, that means you'll have to set them to "Make single user" (easiest way to do is clicking the number in Properties panel).
- Finally check your group mesh: by joining the instances you'll modify the group itself (why? Linked data of course). In Edit mode simply select all verts and merge them at world's origin - working with 2.79 this means placing cursor at 0/0/0 first, then merge to cursor).
Result will be one mesh for each tree and shrub variation, having one vertex at each location.
Going on:
- Define a vertex group for each of those mesh objects, assign all of its vertices to this group.
- Now join those meshes.
Next step isn't necessary indeed; I did it to have my work visualized: selecting all the verts, connecting them to one quite ugly face:
... as you may notice storing information about 3 different alley trees, 3 different ordinary trees, 5 kinds of shrubs, and something special dealing with hedges.
Now let's set up particle systems. You'll need one particle system for each tree and shrub variation.
I'm gonna walk through from top to bottom:
- Particle Type is "Hair". You'll need to check the "Advanced" option.
- Emission section: The Number has to correspondent with the amount of vertices being connected to this vertex group - otherwise you may get doubled trees, which may look a little funny ;-)
Set "Hair Length" to 1. - Emit from Verts, uncheck "Random".
- The Rotation section (has to be checked) might be a bit tricky. We want our trees being randomly rotated around Z but still growing straight upward. So we need "Global Z" as initial orientation.
Don't be shocked - this will rotate your trees in some unwanted 90 degree angle - we're gonna fix this in just a minute... - Again Rotation section: Set "Phase" to 1, leave the first "Random" untouched (Zero), set the second one to 1.
- In the Render section uncheck "Emitter", select "Group" and choose your actual group instance you want to grow. Check "Whole Group".
- Again Render section: "Size" should be about 1 (you may choose it a little bigger if you're funny).
"Random Size" defines the maximum value instances will be diminished. Example: Having Size=1 and Random Size=0.8 means that the smallest particles will have 20% of the original size (get diminished by 80%). - Vertex Groups: For "Density" check the actual vertex group; you may leave the other options untouched.
Important: All the particle systems need unique settings, so it might be a good idea to check them for some shared data (which might occur by duplicating/copying particle systems):
One last step to do: All the affected groups have to be rotated about 90 degrees around Y:
... but Attention: if you use those group instances besides particle systems you'll have to respect that of course.
I think this is a bit annoying and not very intuitive. Obviously Blender programmers think that hair should always be rotated in Y direction, so they defined it as the default orientation...
Short summary
Replacing thousands of group instances through particles seemed to be a really good idea - the file is much "handier" than before, and I'm again able to work with my model directly instead of doing changes in a separate file and paste them afterwards.
Leave a comment
Attention! Comments including hyperlinks or mail adresses within the "Message" field will be automatically spammed.