Hey There...
I'm currently stuck on crafting this mel script to compensate for the weak exporter I'm forced to use.
I created some animations using the Blend Shape stuff but found out too late that that particular deformer wasn't supported by the exporter. To get around this I thought I would Bake the animation into the poly mesh. It turns out that Vertex animation isn't supported either.
I've cooked up the following script that gets me a joint at the location of each vertex in a duplicate of the animated, shape blended model. I'm currently skinning the model by hand but would love to figure out a way to do it via this script.
The main thing I really need to figure out how to do is to take the vertecise from the shape blended model and have them drive the animation of the Joints on the duplicate model. (does that make any sense?).
I've found that I can't bind a Joint or nearly anything else to a vertex and so I really don't know what I can do here. If any of you kind people with loads of freetime and a breathtaking knowledge of the wonders of Mel could help out this relative newcomer, I'm sure he would be most grateful and would mention all benefactors in his yearly letter to Santa.
proc string[] jointsToVerts()
{
string $sel[] = ls -sl
;
float $selPos[3] = xform -ws -q -t $sel
;
PolySelectConvert 3;
string $verts[] = ls -sl -fl
;
select -clear;
string $jParent = joint -name "jParent" -p $selPos[0] $selPos[1] $selPos[2]
;
for ($v in $verts)
{
float $pos[3] = xform -ws -q -t $v
;
select $jParent;
joint -p $pos[0] $pos[1] $pos[2];
}
skinCluster $jParent $sel;
return $sel;
};
Thanks for any help you can offer.
~Israel~