still cant figure out how to check for a string in a string in mel, but if mel is required you could always do this. string $layers[] = `ls -type "displayLayer"`;for ($i in $layers){ if (python("'LPL'" + "in" + "'" + $i +"'")) { setAttr($i + ".visibility", 1); }} though as you seen it is most easily done via python edit:…
Thanks guys the script worked for me. I made some changes and here they are:string $layerlist[] = `ls -type "displayLayer"`;for ($layer in $layerlist) { if ($layer != "defaultLayer") { string $lyrChk = endsWith ($layer, "LPL"); if ($lyrChk) { setAttr ($layer+".visibility") 1; } } } @Passerby: I agree mel seems outdated…
well in python you could do something like this import maya.cmds as cmdslayers = cmds.ls(type='displayLayer')for i in layers: if "LPL" in i: cmds.setAttr('%s.visibility' % i, 1) mel code would be something likestring $layers[] = `ls -type "displayLayer"`; for ($i in $layers) { setAttr ($i + ".visibility") 1; } but you…