Animation method for grass, trees and other flora. (cross-posted at blender.org)
Two of the things I’ve always wanted to see done in Blender wer a nicely moving tree in the wind, and a field of grass likewise perturbed. Up until now there hasn’t been a great way to do it. Well, there still is a great way to do it, but the tools finally all exist in Blender. Any Orange Project animators who want to do something like this in the Project can bug the developers about making this process easier. At the end of this post, I’ll give a little explanation of how that could be done.
First, lets use a tree for and example. It would be awesome to make a tree with L-system, or even Arboro, apply softbodies to it, then hit it with the wind. Of course, you’d get bending tree limbs, etc., not to mention the fact that it’s waaaay to many verts to efficiently calculate. It probably wouldn’t even work. The same for a field of grass - the geometry is too complex.
So what you do is this: once you have your tree built, you make a simple edge skeleton that follows the branch structure. Then, you do softbodies/wind on this simplified skeleton until it looks good. Example (click for quicktime motion):
In the next step, you attach empties via vertex parenting to each vertex in the skeleton. Run (or bake) your softbody simulation. The Empties now move with the skeleton. Then, you take your final tree mesh, and use hooks to attach the relevant sections of the tree to the relevant Empties, with some overlap for smoothest results.
Does it work? Yes.
Bad bad, lazy example:
That sphere in the middle of the tree (it’s an uh… apple or fruit or something) is being deformed via hooks attached to the empties which are attached in turn to the softbody solution for the tree skeleton.
But, you say, oh Orange Project or other interested person, that’s a gigantic pain in the rear, and with any kind of complex tree, you’d be making empties and hooks all day!
You’re right. And that’s why we need to bug the coders while they’re working on all of this animation stuff. Clearly, the building blocks for an animation system like this are already there. We just need a better way to get to it.
Here’s what would work: a Cage deformer. You make one mesh a deformation parent of another. Parent mesh deforms child mesh based on vertex group affinity. It’s as simple as that. The cool thing is that scripts like l-system (or Fiber for that matter) could be modified, and rather minorly I think, to generate these vertex groups and skeletons during the creation of the mesh.
So in an advanced animation world for Blender, you’d run Fiber (or L-system), do a softbody wind solution for the simplified skeleton (or guide fibers), then make that skeleton object the Mesh Cage Parent of the more complex object. The vertex groups all link up, and you get nicely deforming flora with relative ease.
Of course, you can take it up even another notch, and include Deformation Delay, based on more vertex groups. You would be able to assign a delay to mesh deformation based on named vertex groups. Let the leaves on a tree deform naturally, but make the vertex group for the thinnest branches lag them by two frames. Then make the group the next thickest branches lag by two more frames. This would give the illusion that the wind was pushing the leaves first, which were in turn pulling around the branches.
Once again, this sort of vertex group creation could most easily be done at the time the mesh is generated.
Do both of these things, Cage deformation and delayed deform, and you’ll add tools to better leverage the animation capabilities that are already in Blender, and probably create some really cool natural-looking animation in the process.