Posted in Development, Production by campbell

curve2tree screenshot

Recently I’ve been writing a tree maker to speed up our tree creation pipeline, but generating nice looking trees turned out to be a lot harder then I expected.

Having a tree generator where you hit a button and pop out a perfect tree is the artists dream but realistically they need a lot of control as well.

The main difference between this and other tools is that it doesn’t do all the work for you.

We had to compromise in a number of areas: what we expected the artists to do by hand, amount of detail and artistic style. Also with the time limit, how good should we expect the trees to look anyway?

Enrico, Andy and myself did quite a bit of testing and finally we came up with a way to make trees!

  1. The tree trunk needs to have character and look interesting. They’re seen close in a number of shots, so a simple round cylinder just wont cut it. Andy hand modeled all the trunks.
  2. I took these models and added bounding meshes, these show the rough shape of the tree canopy.
  3. Same again, in this case it was interesting to add 2 sets for dense clusters.
  4. Now the branches need to be added as 3d curves. The radius for each point is used to set the branch width. I also tweaked blenders curve editing a bit to make this easier – (‘Smooth Radius’ in the specials menu, and handle hiding so they don’t get in the way while editing). We could make the whole tree this way, but the trunk would be too simple and the twigs would take too much time.
  5. Twigs! This is where the bounding mesh comes in. The ‘Fill Twigs’ option adds twigs between the bounding mesh (green) and the curves. There are options for randomness, size, joint style, generations, etc – enough so trees don’t have twigs that look the same, these blend in seamlessly with the handmade curve.
  6. The last step is to add leaves onto the twigs, this is interesting because you need to have heaps of twigs to fill up a space with leaves. I tried 2 other ways to add leaves, but having floating leaves looked horrible. Similar to twigs, the leaves have options for the branches they grow on: placement angle, random size/pitch/roll, etc. At the moment duplifaces are used to instance the leaves, but we hope to have them as particles eventually.

The renders so far…

This is the python script – “Tree from curves, its in Blender SVN development repository so any recent build of blender will include it (Script Window > Wizards > Tree from Curves), however usibility hasn’t been a priority yet! I’d like to document it and add presets when I have some time.


Main Features…

  • UV mapping
  • Joint blending texture alpha blending
  • Grow twigs from branches
  • Fill twigs in a bounding area
  • Grow leaves
  • Variation – Moves the curves you add to create variants of each tree.
  • Animation – Automatically creates an armature, weights, and moves the limbs using any texture as a basis for the motion.
  • Stores settings on each curve so you can regenerate the mesh easily.


41 Responses

  1. Paul Writes:

    Looks great!
    I’m looking forward to suing this tool!

  2. Paul Writes:

    Sorry.. I mean’t “use” it.. not sue it..

  3. Roksvamp Writes:

    Looks great!

  4. Pitel Writes:

    Can you make a Suzanne-shaped tree/bush? :D

  5. rogper Writes:

    I’ve been using the TreeGen script, but this one looks way more artist and animator oriented/friendly. And that explains why the trunks appeared separated of the branches in the weekly video.
    To stunning Live trees make much Power now we have ;)

  6. gaalgergely Writes:

    simply awesome! wooooo…

  7. derek Writes:

    sue… lol
    I am also really looking forward to suing this tool!

    great job guys!

  8. Sergeant_oreo Writes:

    Thanks for coding it Campbell, and thank you to @ndy and Enrico for testing it!

  9. kernond Writes:

    Wow!! That is VERY nice! And, complete with armatures and texture-based animation potential? …that’s pretty freakin’ sweet. And I love the workflow, it will definitely help you to focus more on the artistic aspect.


    I can’t wait to get some time to test it.

  10. chuckster Writes:

    i’ve crapped better trees..

  11. blackboe Writes:

    chuckster: I guess you haven’t been taking your metamucil, then. stay regular, man

  12. terence Writes:

    @chuckster: that’s really gotta hurt. You have my sympathy

    as to the script – looks great and looking forward to trying it out

  13. ccherrett Writes:


    Sorry to hear about your issue :(

    I hope it clears up for you.

    Awesome script! :)

  14. metalliandy Writes:

    Looking great!

    with the apricot project looming closer…will the trees be usable for real-time game rendering?

  15. SeanJM Writes:

    Fibonacci is the key my friend.

  16. andy Writes:

    metalliandy: most likely not, currently a highres foreground tree can have over 11 mil faces…


  17. squareline Writes:

    Hello, Peach Team, i thinking about how create a runner/clasper on any surface with retopology tool more easily. If the retopo tool have an offset parameter you can set i.e. 0.5 and for branch curves set radius 1.0 this way can fit on surface well.

  18. epat Writes:

    @chuckster: Maybe you need more peaches – they’re a great laxative!… ;)

    Cool script!
    ~epat. :)

  19. rednelb Writes:

    do you know this?

  20. ros Writes:

    Great tool- I was using Lsystem,but this is so much improvement. Thanks too all!

  21. BrianH Writes:

    Definitely an addition to my article here:

    I’ll add it in once it hits the stable release. It’ll probably be the best one listed, since it’s functionality far exceeds the ones listed. Great work guys. :)

  22. Micah Fitch Writes:

    This is really cool!

    The only thing I see is that it looks like some of the leaves are oriented in unlikely directions, such as straight upward. I feel like leaves are mostly facing so that their top (shiny) sides are in some way toward the sun, but they will also all point downward in some way because of gravity.

  23. Micah Fitch Writes:

    Check out these:

    in this photo you will see that most of the leaves are facing with the normals parallel to that of the camera (not random):

    this isn’t the law or anything, and it really doesn’t matter that much, but it might make a difference.

  24. campbell Writes:

    hey guys, Im really surprised so many people are interested in this ;)

    some reply…
    Tree’s are very low poly – because each segment is just 4 quads, they only become higher poly when they are subsurfed. Still, for a game you’d probably be better off with alpha mapped faces.

    leaf placement can be improved. the random direction is a bit too much in the pics, however turning the random sliders down would do the trick ;).

    Animating from textures is way cool – you can have the blend file playing, and slide the texture settings about realtime and see the tree’s motion change! – however its IS slow and its not responding to any wind direction, so baked ipo’s with some wind direction would be a great improvement.

    Some people dont like the current twigs so much, and I agree they can be improved, however its not hard at all to plug new algo’s in to the tree maker (could even make them separate files and have it modular) – so if you work out a nicer auto-twig algo – we could probably include it as an option.

  25. Blendman Writes:

    IT’s a great tool. Thank you !.

    I have tried it and now I use it for some of my games(3D iso) or animation trailer – movies :).

    Just a little suggestion : the title of the project is “peach”, so what do you think to add an option to add fruits (like add “leaf” for exemple) ;) ?
    Thank again.

  26. ERM Writes:

    man, I can’t wait until that’s in the main build!

  27. Anthoni_C Writes:

    It would be nice if we could choose a mesh that would replace the static particles of a certain mesh. Have like a Option in the menu to use a certain mesh with a textbox indicating the object. Then leaves would be easy.

  28. sycren Writes:

    hi, just wondering if you could incorporate the ivy script into this script. It may make the tree’s more interesting and realistic.

  29. nawabz Writes:

    will we be getting a forest like this?

  30. Lucas Da Costa Dantas Writes:

    Iam dead .
    I don’t know what to do ,
    and don’t know how to make things perfect .
    I don’t have the vision of the final thing i want to made ,
    and can’t go forward with the “crap” iam try to made .

    Well ,that tool looks perfect ,
    i dream to use my brain to code\create something like that or anything .
    I don’t know what to do with my drawings ,
    iam not that good to do the stuffs ..

    I thing a suicide this time of the year
    go to be perfect … :)

    Well i just losse my focus somewhere ,
    when i currently trying to get inspirated .
    That’s a great news ,even for now only for reading ..

  31. Gat Writes:

    will we be getting a forest like this?

    I might be wrong but if I remember right that was not a render, but painted in 2D. On the other hand this can be done now too, all you have to do is model those trees and then use the script to add branches where you want to, or you can use a ivy generator program.

  32. Satish 'iluvblender' Goda Writes:

    Cool stuff.

    Keep up the good work fellas.

  33. rHid0c3roZ Writes:

    That’s so cool..

  34. elf Writes:

    Hi. While this way of building trees seems nice enough, I think there may be other ways as well, namely techniques from the field of algorithmic botany. As an example, a book that is a classic in this field: The Algorithmic Beauty of Plants.

  35. Joe Writes:

    Where can i download this from to try it out?

  36. rednelb Writes:

  37. Reed Writes:

    Cool. I wouldn’t mind having a “floating leaves” option, and other such options that make it less realistic, either for a more abstract style, or for eventual realtime use.

  38. Tio Ilmo Writes:

    It sounds a good idea having inside the Blender a tool to make trees. Do you have a step by step tutorial to help us test the script?

    Best regards,

    Tio Ilmo

  39. Wahooney Writes:

    A video on how to create a simple tree with this script would be very useful.

    From what I can tell this script is very powerful and flexible, great work guys :)

  40. mantas Writes:

    very interesting post. i am not a blener user, but i am very interested in tree generators. as far as i understand this is not a part of blender yet?
    it would be very interesting to see more detailed pictures,so we could compare this tool with xfrog and vue :)
    anyways i am so interested it topick cos i kind of tryed to write tree generator myself, well actuualy only tree trunk generator.
    here i have my blg and some alternative and crazy ideas on tree generation. (implicit surfaces for trees )
    and some other stuff.
    btw, cogrts with big bunny, blender is stepig on big guys toes :) keep it on!

  41. bob marley Writes:

    I created a tree taller than the Empire State Building.
    It fell on me.
    My lawyer will be calling your lawyer.

    Just kidding.
    I can say ‘cool’ ‘wow’ all that stuff and it doesn’t add up to the thanks I really want to say.

    Microsoft be scared, be very scared. Open Source is a fenominome like no other. It is Genisus.