Search Instagram Twitter Facebook Spotify Grid Tag Date Folder Chat Pencil

Tools Programming – Tree Finalizer

After a tree is made by the tree generator, all the parts are actually separate individual components, parented to the object it spawned from.

As you can see here by the object hierarchy on the right:


This is necessary, because often I still need to do a bit of editing to the tree – removing overlapping branches, rotating trunk pieces, etc.

Once that is done, all the trunk and branch pieces need to get merged together, as well as the leaves, and then everything needs to have the appropriate materials and scripts applied.

There are also some additional considerations, such as adding the “tree base cube” – this is the cube at the base of the tree that the tree grew from, the soil patch, and also any cubes that are growing from the tree.

Instead of manually dragging the scripts and prefabs and placing them in the hierarchy, it’s just much easier to automate this with a tool.

Here’s what the tree finalizer window looks like:


A bunch of the processing is optional. In the case in the above image, everything is selected, and we’re generated 2 cubes to grow from the tree.

When you click to finalize the tree, a warning message comes up. This is important as the trunk and leaves are merged into separate individual meshes and there is no undo.


Here’s what it looks like when the tree has been finalized.


Note the hierarchy of objects on the right. There’s the “branch” object, the “leaf” object, leafShadow is an object specifically for the shadow of the leaf due to some weirdness with shaders. Note that there are two CubeSpawnPoints. They are both placed at the base of the tree so they’re overlapping. You have to manually move them to the position you want, but this is something that I wouldn’t want to be automated anyway, as the placement needs to be carefully designed.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.