does anyone know how I can query the skinweight of vertexA on object X and then apply that skinweight to vertexB on objectY?
hope that makes sense!
does anyone know how I can query the skinweight of vertexA on object X and then apply that skinweight to vertexB on objectY?
hope that makes sense!
Well, not all that, but here's how you can find the skinCluster on an object, mabye it'll get you started:
global proc string[] returnSkinCluster(string $object)
{
string $shape[] = listRelatives -ni -s $object;
string $history[] = listHistory -pdo true $shape[0];
string $skinClust[] = ls -type "skinCluster" $history;
return $skinClust;
}
returnSkinCluster myObjectName;
Thanks for that, but I already have a bit of mel to get me that far! Thanks anyway though. This is driving me absolutely nuts!
To do this you need to know a couple of things.
The vertex on objectA and objectB and the skinCluster for both objects, along with the joint name. Let's assume you know all of these...
string $vertexA="objectA.vtx[23]";
string $vertexB="objectB.vtx[43]";
string $skinClusterA="skinCluster1";
string $skinClusterB="B_skinCluster1";
string $jointsA[]={"foot","lowerLeg","upperLeg","hip"};
string $jointsB[]={"B_foot","B_lowerLeg","B_upperLeg","B_hip"};
float $weights;
string $cmd="skinPercent ";
for($i=0;$i < size($jointsA);$i++)
{
$weights=skinPercent -t $jointsA[$ii] -q $skinClusterA $vertexA;
$cmd=($cmd+" -tv "+$jointsB[$i]+" "+$weights);
}
$cmd=($cmd+" "+$skinClusterB+" "+$vertexB);
eval($cmd);
I haven't tested this, but it should get you pretty close to what you need.
--g
Fantastic - I'll give that a try. Thanks.