Yes this DOES export to SWF or Flash format. Just tested it. Of course it isn't "optimized" which would be expected.
To better understand the concept think of these "path" constraints just like "bones". They are like mini bone paths... uh... sort of. You constrain point/s to these paths as you might bind a point or points to a bone. You treat these "constraint paths" just like any other vector. They can be bound to a bone or flexi-bound what ever.
The key is that any point bound to this path follows the path where ever it goes. If the path is bound to a spinning bone a point will traverse the path as it is spun by the bone.
The thing I need to do now is to finish the set up and expand the concept for longer paths. I have to do some math... stuff... to figure out how to use more than 3 point splines.
Here's what the script does:
A vector layer has a mesh. A mesh is made up of curves. A curve is made up of points/segments. Each segment has two points.
In the test script the path I'm using has two segments. there is a function or property called:
First I need to identify the curve. Then to find a point along the curve I have to identify each segment of the curve. In this example there are two segments (3 points). So I have segID = 0 (0 is the first segment) And then I convert the bone's rotation to a percent value to find a spot along that segment.
There are two segments so I have to fiddle with the math and "split" the percentage so the point travels 100% to the end of the first segment and then skips to the next one and does the same thing.
This is easy with two segments, but if the path has 4 or 6 or 20 segments, I need to come up with a formula to make a percentage along each segment so it adds up to the WHOLE segment.
I was thinking of just limiting this to 2 segments for the joint volume issue. A 3 point path is all that would be needed in that case... but I hate to limit it to just 3 points and I know there is way to calculate the whole path. I can count the segments and divide 100% by whatever... times... uh... something.... blah blah blah. I'll figure it out eventually.
I will have to use named bones and point groups to "match" a path to it's "point". I am doing that in the example above. I have a named group for the joint path and a named group for the point that moves along the path. Works like a charm. The movement along the path is driven by the bone rotation. There has to be some way to "drive" the point along the path and obviously a bone rotation is the way to do this. I suppose it could be modified for bone translation or scale as well.
the other option I want to add is multiple points following a path. If a set of points follow the path they could be set to follow along using "relative" locations. Instead of all jumping to one single point they jump to that location relative to their original location. This should be fairly easy to include... and leads to my other exciting use for this script...
The "2.5D" head/body turning. Imagine a curved path. An ellipse that defines a circular path for a head turn. This path would be moved and distorted by simple bone motion to change it's shape.
Other bones that control the facial features would be forced to travel along this path by another bone. This provides a simple and totally user controlled mechanism for creating head turns.
Because BONES are moving along the path instead of points you could add in additional bones to distort the paths as well. Just like my complex face rig with over 200 bones you could have a turning head able to do lip sync from any angle using a tiny fraction of those bones to achieve this.
You could have a series of paths for different parts of the face; eyes, nose, mouth etc. This completely eliminates the need for those "springy" bones I've been using for face rigs. The drawn PATH defines this circular motion creating a 3D turn using very few bones and very simple scripting.
I haven't worked out all the details to pull this off but it's going to be WAY easier than how I was doing it before using ALL bones. Using drawn paths to "predefine" the rotation path will solve a ton of issues and provide a lot of ability to "visibly" tweak this rotation. You will be able to "see" the rotation path.
Other things that can be done with this haven't really been explored yet. The options seem endless. Total motion controlled by drawn vectors. At some point with more options you could theoretically "draw" the motion instead of key framing a ton of bones. All the motion could be driven by the paths and just a few bone rotations. Or maybe the points on the path determine the motion and no key frames are needed.
This is further down the road but I'm very excited about the possibilities.
-vern