So it occurred to me that I've been spending a lot of time figuring out how my muscles are going to interact with each other and pretty much taking the fact that they'll stick to the bones to get their primary movement as a given. I decided I should look into that and figure out how I'm actually going to do it. After a bit of research, I found that constraining an object to an arbitrary point on a mesh is generally referred to as "riveting", at least amongst the people writing the scripts that do it. I found 2 implementations that seemed like good approaches.
The first is Rivet (button) 1.0 which works by allowing the user to select 2 edges which it then creates a loft node between. It then uses a pointOnSurface node to drive a locators position and the surface tangent of the loft to drive an aim constraint for orientation. This method works rather well, however it requires the locator be exactly in the center of the 2 edges. The muscle control object would have to be parented to the locator with an offset, which could result in some imprecision. However, I believe that the creator of the muscles could probably setup the muscles to have more custom muscles that would implement a u,v positioning other than the 0.5, 0.5 that the original script assumes. Another problem with this script is that it requires the user to specify which edges it will be using. In the case where muscles need to attach to a part of another creature, it will need to know where its supposed to attach. This would probably have to be stored somewhere, associated with each bone of each creature for every muscle that must attach to it.
The second script, djRivet, which actually credits the original script works by creating a Maya hair follicle at the closest place on the mesh it is attaching to, and parents the object to the follicle. This solution, while more precise on positioning, has several disadvantages. It doesn't maintain orientation as well as rivet. It relies on finding the closest point to the object on the mesh, which isn't generally what I'll want for this case, as where the muscle needs to go and where the closest point on the mesh are will often be very different things. Additionally, this method requires the object has non-overlapping uv's, which would require an extra, otherwise unneccesary step of uv-mapping the bones. And finally, this relies on Maya hair follicles, which is a departure from my policy of avoiding Maya-specific tools.
As such, the original riveting method will probably work out best for my needs. With a few tweaks to the implementation, and the creation of some additional data in the existing bone attribute files, it should work well.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment