Forum: Autodesk Maya
Posted By: Jenki
Post Time: 04-22-2016 at 03:51 PM
Text:
Hello, I have small MEL script that clone one object to another by vertex.
global proc PolyUniteToShape() {
string $sel[] = `ls -sl`;
string $from = $sel[0];
string $to = $sel[1];
string $fromShape[] = `listRelatives -path -shapes -noIntermediate $from`;
string $toShape[] = `listRelatives -path -shapes -noIntermediate $to`;
string $unite = `createNode -ss polyUnite`;
connectAttr -f ($fromShape[0]+".worldMatrix[0]") ($unite+".inputMat[0]");
connectAttr -f ($fromShape[0]+".worldMesh[0]") ($unite+".inputPoly[0]");
connectAttr -f ($unite+".output") ($toShape[0]+".inMesh");
}
it was mentioned here: http://forums.cgsociety.org/archive...p?t-838109.html
But my question is how to make it work the same but let the cloned object keep it UV?
there is -muv flag for polyUnite but don't know how to use it here.
Can anyone help me with it?
thanks
Posted By: Jenki
Post Time: 04-22-2016 at 03:51 PM
Text:
Hello, I have small MEL script that clone one object to another by vertex.
global proc PolyUniteToShape() {
string $sel[] = `ls -sl`;
string $from = $sel[0];
string $to = $sel[1];
string $fromShape[] = `listRelatives -path -shapes -noIntermediate $from`;
string $toShape[] = `listRelatives -path -shapes -noIntermediate $to`;
string $unite = `createNode -ss polyUnite`;
connectAttr -f ($fromShape[0]+".worldMatrix[0]") ($unite+".inputMat[0]");
connectAttr -f ($fromShape[0]+".worldMesh[0]") ($unite+".inputPoly[0]");
connectAttr -f ($unite+".output") ($toShape[0]+".inMesh");
}
it was mentioned here: http://forums.cgsociety.org/archive...p?t-838109.html
But my question is how to make it work the same but let the cloned object keep it UV?
there is -muv flag for polyUnite but don't know how to use it here.
Can anyone help me with it?
thanks