Sapling: A Tree Generator Add-On for Blender (OSX Fix 10 Aug 2011)

very cool, thanks for the addon :slight_smile:

Hey Guys!
Saw this script and thought it looked good, but I canā€™t find where to download it! You said ā€œdownload the file aboveā€ but there is no file above. Or maybe iā€™m just not seeing itā€¦thatā€™s possible! But thanks for the help!

Oh Wait, I found it! Silly me! Thanks~:D

and I was hoping youā€™d say where you found it ā€¦ Iā€™m definitely also being a bit silly because I really cannot find it either :eek:

I did find the SVN browse page, where there is a add_curve_sapling/ directory, and under that there is:
init.py
presets/
utils.py

Iā€™ll look further into those files; but still I suspect that I am looking over something very obvious.

Read the original post, where it says version to there is a blue hightlighted ā€œhereā€ link. Enjoy :slight_smile:

No roots?

Take a look at the one I posted and you will see a realistic-looking tree is actually not complex (as all that!) because the logic of program execution branches by itself. If anyone is interested in exploring the mathematics and symmetry of trees using python, get involved! Right now we are attempting to apply the Fibonacci series to get spiral symmetry in the branching.

PS if you want a tree with roots, execute tree-gui twice and create two in the same place, once with height negative. Donā€™t forget to turn the leaves off for those sections!

Ah, thank you. Got it.
I was looking on http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/Curve/Sapling_Tree; where I arrived via the downloads link on the Blender main site: Download -> Resources -> Python Scripts -> wiki.blender.org Python Repository
I must admit that I expected to see a link to the .py on that page :slight_smile:

Hi all, sorry I havenā€™t been active, Iā€™ve been on hiatus till I finished some work that needed doing. Happy to be back, so Iā€™ll try and answer some questions!

Hi rben13,
What sort of control are you looking for? At the moment there are two ways to control the trunk splits: Base Splits and Segment Splits. The former controls the first split of the trunk and the latter the splits after that. Iā€™m thinking about roots now, the implementation Iā€™m using is based on a technical paper which didnā€™t address roots but it shouldnā€™t be too hard to adapt. Actually having the roots grow on a mesh would be cool! User specified leaf object is planned, just wanted to get the first leaves in a proof of concept. Hopefully Iā€™ll find the time for this soon!

Hi nemasis,
This is weird! It should perfectly replicate the tree if all parameters are the same. If you could post a method on how you managed it, Iā€™ll hopefully be able to fix it if thereā€™s a problem.

Hi numby,
I originally starting trying to build a script similar to yours using some mathematical rules to build the entire tree. While this replicates the natural process of the growing tree and makes for concise code, it is ultimately very difficult for an artist to control the tree shape or replicate a specific tree. Keep up the mathematical investigation!

Hope that answers some important questions!

Cheers,
Truman

One problem ithink u forgot to mention where u download it unless i missed something please help i ask because i canā€™t find a proper download link for it i even copied and pasted the script title into google andā€¦nothing.

hi, hereā€™s the zip file, uploaded to the Projects page.
http://projects.blender.org/tracker/download.php/153/468/27226/16781/add_curve_sapling.7z
truman, you can update the script as a zip here, I understand itā€™s hard for users to get your script easily. :wink:

Hi All,

First post has been updated so itā€™s easier to find the addon and the tracker link is now fixed. Thanks for the feedback on this. Hope you can all enjoy the script problem free now!

Thanks meta! Seems a bit more difficult to manage now itā€™s a multi-script addon

Cheers,
Truman

Hi All,

The script has been updated with a few changes;

  • Updated to 2.58 API
  • Added the ability to start the tree at an angle to the ground via startCurv
  • Fixed an issue where, even if the seed value was the same, the tree generated would be different
  • Fixed calculation of upward attraction for correct implementation
  • Added presets for CA Black Oak and Weeping Willow.

See the first post for the link and let me know what you think!

Cheers,
Truman

Dang, it has a distributed architecture now. I can not just run the script.

Hi Atom,

Yeah, unfortunately it became necessary to split it into multiple scripts. I canā€™t remember precisely why, Iā€™ll check it out to make sure itā€™s still absolutely necessary as I agree itā€™s not ideal.

Cheers,
Truman

Hi,

Thanks for this great script.
I have a problem with presets : the script seems to look for them in blenderā€™s installation directory (/usr/local/blender/2.58/scripts/addons in my case), although my scripts are located in my home folder ( /home/me/./blender/2.58/scripts/addons)

Hereā€™s the console output :

Traceback (most recent call last):
  File "/home/xxx/.blender/2.58/scripts/addons/add_curve_sapling/__init__.py", line 132, in draw
    presets = [a for a in os.listdir(os.path.join(bpy.utils.script_paths()[0], 'addons', 'add_curve_sapling', 'presets')) if a[-3:] == '.py']
OSError: [Errno 2] No such file or directory: '/usr/local/blender/2.58/scripts/addons/add_curve_sapling/presets'

Using ubuntu 11.04
blender 2.58 r37980

Also I was thinking of something : would it be possible for the script to assign a vertex group to the branches carrying leaves ?
That way it would be possible to manage leaves through a particle system, allowing much more flexibility.

Hi DrBouvierleduc
I was already trying to achieve this, and some of it is already working great. i am still having some issues but i think i will get to it. i am new to python and i am having some health issues so maybe it could take some more weeks or even months who knows. but if you would like to see some work you can check my Blog http://kaicent.wordpress.com/.
or you could check some older posts i already made in this thread.

greetings Kai-Cent

Having issues installing. I unzip the folder into my Addons folder, but Blender isnā€™t seeing it.

Hi StAnonymous,

Can you check if thereā€™s an error showing up in the console window? If the console isnā€™t open you can open it from the help menu. Also, is your addon folder in the normal place or have you moved it? Hopefully we can get it working for you!

Cheers,
Truman

Perhaps your unzipping program is set up to unzip multiple files into an enclosing folder like this:


Then you should move the green marked files into the blue folder and remove the red folder.

Afterthoughts:
It has do be the internal Blender ā€œaddonsā€-folder which holds all the preinstalled addons of course. If you copy the unzipped files to a self defined folder like ā€œMySuperDuperScriptsā€ it will not work at all.

The problem is that the usual addon installation procedure by using the preferences panel is limited. It allows to install one python script (*.py) only at a time. However this script uses a folder hierarchy, which can not be imported with the ā€œInstall Add-Onā€¦ā€ button directly.

can anyone show examples of trees?