User Tools

Site Tools


Mesh Forces

A Mesh Force behaves like other Forces you add to a scene, except that its shape is a Mesh. This shape can affect the area in which the force is applied, but also what happens when things are inside, are outside, or collide with the mesh.

You might use this function, for instance, in making vines grow on a fence, roots growing into a rock or a tree nestled into a structure.

Adding Mesh Forces

mesh_force.jpg Mesh forces are just a combination of a Mesh and a Force that lets you do more complicated things than would otherwise be possible with a non-mesh force.

You can add a Mesh force directly through one of the methods for adding regular forces. Or, you can switch an existing force to a Mesh force by changing the "Force:Type" property to “Mesh.”

To apply the mesh asset you want, change the “Mesh:Mesh” property or drag and drop the asset onto the force in the Tree Window. This can be a normal mesh asset you imported, or it can be a Collection if you want the mesh to be generated by other parts of the tree.

Note: For a shortcut to add a Mesh force, drag and drop a mesh asset into the scene. The mesh wizard that pops up has an option for creating a Mesh force.

Mesh Actions

A mesh force has properties for controlling what effect it has on branch spines, either attracting, repelling, or taking no action. There are also controls for what happens when a branch spine collides, or touches, the Mesh force. You can do things such as obstruct the branch, prune it, or even remove it entirely.

Including Mesh in Model

Sometimes you may want a mesh to actually be part of the tree. For instance, a tree grows among some rocks that are added as a Mesh force, and you wish to export the whole thing as a mesh.

For this, you would enable the “Mesh:Include in model” property and set a Material Asset to the Mesh force. This mesh force will then render in the Tree Window similarly to other parts of the tree, and it will be included on export.

Containers

container_force.jpg One additional feature that mesh forces have is they can be used as “containers” for any of the other Forces. You can indicate an area to be included or excluded for a particular force by setting the corresponding properties in the “Container Force” property group to the name(s) of the mesh forces you wish to use as containers.

In the picture to the right, there are four forces: two direction forces and two mesh forces with a sphere mesh indicating the area of effect for the corresponding direction force. The branch is affected by the direction forces in a very precise manner.




How To . . .

. . . Wrap Roots Around a Rock

Import a rock mesh and create a Mesh force from it. This mesh force should have an attract action and an obstruct collide action. Then, make the root generator(s) of the tree react to the rock mesh force. As you move the rock mesh force around, the roots should dynamically update to wrap around them. If you wish the rocks to be included in the model, enable “Include in Model” and set a material on the Mesh force.

. . . Grow Vines Up a Tree

Make an empty mesh asset and make it a Collection. Set the trunk and major branches to contribute to this collection. Then, make a Mesh force from this mesh and make sure it lines up exactly with the tree (probably by resetting the translation to (0,0,0)). Set the “Force action” to attract and the “Collide action” to obstruct. Enable this Mesh force on the vine generator to have the vines wrap around the tree. The addition of a Direction force to “push” the vines up the tree may be necessary.

. . . Prune a Bush

For complicated pruning, a mesh can be imported. But usually, a flat plane is all that is needed, and this can be created in the Cutout Editor. Make a Mesh force from this with no force action and a prune collide action. Enable the force on all of the branches of the bush. As you move, rotate, and scale this plane in the Tree Window, you will be slicing parts of the model off.

. . . Avoid Obstacles

A mesh force of a building or other obstacle can be used with an obstruct collide action so the tree grows around it. Sometimes a little attract/avoid force action can get it to look more realistic, depending on the situation.

. . . Direct Growth

You may have a plant that you wish to direct Growth on very precisely, to have it grow up a wall, then cascade over the other side, for instance. For this, you would use mesh forces as containers on direction forces that push the plant in various directions as it grows longer.