Improved sapling tree generator

I would like to share my new version of Blenders tree generator.
I have made many changes to create a wider variety of trees more realistically, added features, and make it more intuitive.

Some changes include:

  • better branch splitting
  • new branching algorithms for more realistic branching structures
  • easy to use and correct leaf orientation
  • options to use an object for the leaves
  • interface partly re-arranged so properties often used together are in the same panels.
  • Back curvature now adds to curvature rather than replace it
  • Vertical attraction can now be set individually for each split level
  • control of the shape of secondary branches
  • an operator to grow multiple trees from a preset
  • and bug fixes

The full list of changes is on GitHub

You can get the add-on on GitHub: https://github.com/abpy/improved-sapling-tree-generator

note: this affects older saved trees which wont look the same with this version.
I have removed some of the presets that didn’t work any more, and added my own presets.

I hope you all find this useful and let me know of any problems you have or features you would like to see.

2 Likes

hi, I recently did some changes to sapling in Blender release.
I’ll certainly give your script a look.
Are you interested in developing sapling in Blender?

hi, what changes were made recently?, I started with the version in blender 2.74.
If blender devs want my version in a release that would be great, but I don’t know what that entails.

any news on those improvements Meta-androcto?

no news yet, I fixed paths in Blenders version & had a good look at all the somewhat iffy menu’s then compared with new sapling version. Pretty sure it’s much better. Stull a couple of things to be done, armature does not work with pruning, it needs a poll or if/else to prevent using the two together. a way to apply the prune also would be good & help with this issue.

@Aaronb, you could submit your updated version here: https://developer.blender.org/maniphest/project/3/type/Patch/
then we can discuss more how to get this approved.

improved versions splitting looks more realistic,thanks.

Add curve > Add tree:

Traceback (most recent call last):
File “C:\Blender\2.75\scripts\addons_contrib\add_curve_sapling_3_init_.py”,
line 626, in invoke
bpy.ops.sapling.importdata(filename = “quaking_aspen.py”)
File “C:\Blender\2.75\scripts\modules\bpy\ops.py”, line 189, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File “C:\Blender\2.75\scripts\addons_contrib\add_curve_sapling_3_init_.py”,
line 124, in execute
f = open(os.path.join(getPresetpath(), self.filename), ‘r’)
FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Users\Juha\AppDat
a\Roaming\Blender Foundation\Blender\2.75\scripts\addons\add_curve_saplin
g_3\presets\quaking_aspen.py’

location: C:\Blender\2.75\scripts\modules\bpy\ops.py:189

Is it still relying on curves which are bevelled?
I would recommend looking into using the new skin modefier on single edges. It makes for much more realistic shapes for the trunk and the branches and especially where they meet.

JuhaW, I will look into that error.

ejnaren, I too would like to have mesh-skininng of the branches. the skin modifier seems to have too many kinking issues to be used for branches. Does any one know of a way to do the curve skinning?

There is s way to use the skin modefier. Either you can set the number if segments or I used the sub division modefier on top of it.
Once I also added a displace in the sub d to roughen up the tree trunk and branches…

Hi, ejnaren, can you show how you do that?, i spent like 3 hrs trying to get a decent shape of a tree. Thanks!

I’ve recently added a lot of useful changes to improve the tree generator.
Try out the new version and if you have any questions or suggestions about it, let me know, I appreciate your feedback.

tried the new version with blender2.74 works well.tree form feels more natural.if you are interested in implementing base offset for branches will be useful to have,another feature is fractal jitter (limited to one or two directions) for branches.



a hemispherical shrub(branch distribution parameter was useful to avoid clumping at top)

I tried this version and I really like the improvements - now need to check the latest release and test the even more improved sapling :wink:

Would it be possible to have the hexagonal leaves UV-mapped as the rectangular ones?
Thanks a lot!

Piergi

I could add that, but I think it would be better to use rectangles for uv texturing.

With the rectangular mesh I have to use an alpha map, and set the transparent bounces to a high level to avoid black spot.
I have noticed that with hexagonal leaves, I can turn off the transparent shadows check-box in the light paths panel, and the render is twice as fast. That is true for external scenes, with lots of trees, of course.

The result looks good to me:



At the moment the work flow is: separate the leaves -> UV unwrap one leaf -> transfer the UV to the others -> join all the leaves.
Separating the leaves takes ages on my laptop :frowning:

Ok, that sounds like a good reason, I’ll add UVs for hexagonal leaves soon.

Super! Thanks a lot.

Piergi

Hi Aaron,
Nice additions :slight_smile: How can I get branches starting with a little arc and then falling straight to the earth like this https://davisla2.files.wordpress.com/2012/04/salix-babylonica.jpg ?