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:…
I'm trying to write a Mel script to set all Display layers with "LPL in it's name to visible. Display layers seems to have very bad documentation and I cant find anything. I've got many many layers and switching each one on one by muda-nuckin one is getting bothersome. Any help is much appreciated. :) Till then I shall be…
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…
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…