Nov
30
Posted on 30-11-2007
Filed Under (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.
    c2t_01.png
  2. I took these models and added bounding meshes, these show the rough shape of the tree canopy.
    c2t_02.png
  3. Same again, in this case it was interesting to add 2 sets for dense clusters.
    c2t_03.png
  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.
    c2t_04.png
  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.
    c2t_05.png
  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.
    c2t_06.png

The renders so far…
birch_003.pngbeech_003.pngoak_002.png

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.

c2t_ui.png

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.

    Read More   

Comments

Paul on 30 November, 2007 at 8:58 pm

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


Paul on 30 November, 2007 at 8:58 pm

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


Roksvamp on 30 November, 2007 at 9:16 pm

Looks great!


Pitel on 30 November, 2007 at 9:41 pm

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


rogper on 30 November, 2007 at 9:44 pm

Awesome!!!
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 ;)


gaalgergely on 30 November, 2007 at 10:48 pm

simply awesome! wooooo…


derek on 1 December, 2007 at 12:18 am

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

great job guys!


Sergeant_oreo on 1 December, 2007 at 12:19 am

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


kernond on 1 December, 2007 at 12:44 am

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.

THANKS!

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


chuckster on 1 December, 2007 at 5:37 am

i’ve crapped better trees..


blackboe on 1 December, 2007 at 6:37 am

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


terence on 1 December, 2007 at 7:14 am

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

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


ccherrett on 1 December, 2007 at 7:38 am

chuckster:

Sorry to hear about your issue :(

I hope it clears up for you.

Awesome script! :)


metalliandy on 1 December, 2007 at 1:55 pm

Looking great!

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


SeanJM on 1 December, 2007 at 3:43 pm

Fibonacci is the key my friend.


andy on 1 December, 2007 at 3:55 pm

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

.andy


squareline on 1 December, 2007 at 6:51 pm

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.


epat on 2 December, 2007 at 2:03 am

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

Cool script!
~epat. :)


rednelb on 2 December, 2007 at 3:35 pm

hi,
do you know this?
http://www.polas.net/trees/index.php


ros on 2 December, 2007 at 8:02 pm

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


BrianH on 2 December, 2007 at 8:07 pm

Definitely an addition to my article here:
http://bchynds.com/index.php?option=com_content&task=view&id=30&Itemid=1

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. :)


Micah Fitch on 3 December, 2007 at 7:17 am

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.


Micah Fitch on 3 December, 2007 at 7:23 am

Check out these:
http://marko.isfoundhere.com/images/tree_leaves.jpg

in this photo you will see that most of the leaves are facing with the normals parallel to that of the camera (not random):
http://images.inmagine.com/img/mixa/mx043/mx043012.jpg

http://www.cirrusimage.com/Trees/Kentucky_coffee_tree_3.jpg

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


[…] de vida natural do projeto. Ao que parece às versões de teste já estão bem funcionais, o Campbell Barton já publicou algumas imagens, da interface do Blender, com a nova ferramenta e de modelos 3D, gerados pelo Blender. O resultado […]


campbell on 3 December, 2007 at 7:00 pm

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.


Blendman on 4 December, 2007 at 10:12 am

HI.
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.


ERM on 4 December, 2007 at 3:03 pm

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


Anthoni_C on 5 December, 2007 at 3:10 pm

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.


sycren on 10 December, 2007 at 1:51 am

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


nawabz on 22 December, 2007 at 2:39 pm

Lucas Da Costa Dantas on 24 December, 2007 at 11:22 pm

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 ..


Gat on 24 December, 2007 at 11:47 pm

will we be getting a forest like this?

http://fc01.deviantart.com/fs17/f/2007/215/7/5/the_Forest_church_2_by_weiweihua.jpg

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.


Satish 'iluvblender' Goda on 26 December, 2007 at 3:19 pm

Cool stuff.

Keep up the good work fellas.


rHid0c3roZ on 31 December, 2007 at 9:09 am

That’s so cool..


elf on 2 January, 2008 at 9:42 am

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.


Joe on 8 January, 2008 at 9:24 pm

Where can i download this from to try it out?


rednelb on 11 January, 2008 at 4:41 pm

Reed on 11 January, 2008 at 11:54 pm

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.


Tio Ilmo on 12 April, 2008 at 10:46 pm

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


Wahooney on 23 April, 2008 at 1:00 pm

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 :)


Post a Comment
Name:
Email:
Website:
Comments: