SpeedTree
    Show / Hide Table of Contents

    Shape control

    Shape control is a feature of the Branch Generator that lets you quickly confine your tree within a shape that is anchored somewhere in the tree's hierarchy.

    Shape control serves as an alternative to using a Geometry Force to create a tree shape but offers the additional benefit of being able to control the distribution of branches as they fill the shape.

    Shape

    A sphere is the default shape used for shape control, and you can do many things with it. However, you may use any shape mesh to guide the growth. You set this by choosing 'Mesh' in the Shape Control:Style property. you need to load the mesh you wish to use in the mesh asset tab and then turn it into a 'geometry force'.

    To turn a mesh into a Mesh force, you need to go to your 'Forces' push button in the toolbar above the viewport → 'Add Force' → 'Mesh' and select the mesh. You will want to scale the Mesh force to an appropriate size by using the 'Mesh Force' properties that appear when you converted your mesh into a Mesh force.

    Note

    For a custom mesh, the branches are distributed within the force mesh as one object. For multiple shapes at each branch level, copy and paste the custom mesh. This will create multiple mesh forces, so make sure to enable the Mesh Forces in the Generator's → 'Forces' group that has the Shape Control enabled.

    Position

    Where you place your shape is an important part of shape control that determines its effect on the tree. Shape control can be set to any level of your tree structure. Once applied, it will automatically include all of the generators after it in the hierarchy until you manually turn off the levels you don't want to include by changing the Spine:Stop shape control property.

    A generator hierarchy and a tree with shape control enabled. One large circle encompasses the entire tree. A generator hierarchy and a tree with shape control enabled. Many circles encompass different clusters of branches on the tree.
    Shape control is enabled on the trunk. This will create a round "lollipop" tree Shape control is enabled on a second tier generator. This will create "puffs" on the branches.

    Adjusting the position and size of your shape can result in very different effects.

    Two trees with shape control enabled. The first tree has a circle with a radius that encompasses the branches above the trunk. Its shape is more upward-reaching. The second tree has a circle with a radius that extends far below the trunk and branches of the tree. The result is a squished-looking tree with downward-reaching branches.

    Note

    Turning on hints in the Tree Window allows you to see the shape's position and size.

    Distribution

    Once enabled, shape control will override the length settings on any affected branches to fit within the correct shape. The total "length" is divided among the branches that will follow. You can affect this with the "Shape Control:Distribution" property. For example, sliding distribution to the right will create longer lengths in the first set of branches and shorter ones in the last set.

    Note

    All of your edits for branch distribution are done in the generator in which you have started shape control.Sometimes shape control can result in some errant branches extending in directions you don't want. Pruning, especially "down" pruning on most trees, can be very helpful to get rid of these to clean up the shape of the tree. See below.

    Two trees with shape control enabled. The first tree has branches near the bottom that extend downward. The second tree is the same as the first but with these downward branches removed.

    Post-shape deformations

    Deformations done to the branch spine, such as noise, gravity, and forces, all happen after shape control. Because of this, they are capable of pulling your branches outside the desired shape, as shown below. The easiest modeling method while working with shape control is to keep your generators free of these deformations until you've gotten your shape control working correctly. Then, you can proceed to the other deformations.

    A tree with shape control enabled. Due to gravity deformations, some of the branches near the bottom droop excessively.

    Copyright © 2023 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX.