marckury
02-27-2008, 06:18 PM
i asked the same in another post but maybe this is the right one because is a thing about mel ,
so the problem is this mel is to connect toonline in only one selected object and its instance , so would be better the same but selecting multiple objects and conecting to multiple instances at the same time if instead of 1 object you have 5 objects inside a group and you instance that group ...
// then with the original object selected, apply
int $i = 0;
string $toon = "pfxToonShape1";
string $shapeName = "pCubeShape1";
// replace with your shape name string $toon = "pfxToonShape1";
// replace with your toon name
$numInstances = 7;
for( $i = 1; $i < $numInstances; $i++ ){
connectAttr ($shapeName + ".outMesh") ($toon + ".inputSurface["+$i+"].surface");
connectAttr ($shapeName + ".worldMatrix["+$i+"]") ($toon + ".inputSurface ["+$i+"].inputWorldMatrix");
}
so the problem is this mel is to connect toonline in only one selected object and its instance , so would be better the same but selecting multiple objects and conecting to multiple instances at the same time if instead of 1 object you have 5 objects inside a group and you instance that group ...
// then with the original object selected, apply
int $i = 0;
string $toon = "pfxToonShape1";
string $shapeName = "pCubeShape1";
// replace with your shape name string $toon = "pfxToonShape1";
// replace with your toon name
$numInstances = 7;
for( $i = 1; $i < $numInstances; $i++ ){
connectAttr ($shapeName + ".outMesh") ($toon + ".inputSurface["+$i+"].surface");
connectAttr ($shapeName + ".worldMatrix["+$i+"]") ($toon + ".inputSurface ["+$i+"].inputWorldMatrix");
}
