- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi:
I am new in MEL programming.
I need a MEL script to connect a selected object color attribute and apply to the same object to transparency attribute.
It may have this format or other if proposed:
connectAttr -f file1_png.outTransparency file1obj.transparency;
where file1_png is the selected color file and file1obj is the selected object file
I tried to read selected data as next:
//Select an object first
string $mySel[] = `ls -sl`;
if (size($mySel) == 0) {
$msgbox = `confirmDialog -title "Error"
-message "Please select the objects that need apply transparency!"
-button "Ok"`;
}
string $shapes[] = ls("-sl", "-o", "-dag", "-s");
string $myMaterial[] = `listConnections -type "shadingEngine" $shapes`;
for ($items in $myMaterial)
{
string $surfaceShader[0] = `listConnections ($items + ".surfaceShader")`;
print ($surfaceShader[0]);
string $A = ($surfaceShader[0]);
}
But I do not know where and how apply connectAttr command
I hope anyone can help me
Thanks
Solved! Go to Solution.