if(`window -ex ma_multiAttrEdWin`)deleteUI ma_multiAttrEdWin; window -t "final3 Multiple renderStatsEditor" -wh 285 295 ma_multiAttrEdWin; columnLayout; rowColumnLayout -nc 2 -cw 1 154 -cw 2 122 -h 230; frameLayout -l "objects:" -fn "smallFixedWidthFont" -bs "etchedIn" -h 232; columnLayout; textScrollList -w 150 -h 190 -ams 1 ma_multiAttrEdTSL; button -l "update selection" -w 148 -c ma_multiAttrEdList; setParent..; setParent..; frameLayout -l "options:" -fn "smallFixedWidthFont" -bs "etchedIn" -h 200; columnLayout optionsColumn; ma_multiAttrEdList; showWindow ma_multiAttrEdWin; global proc ma_multiAttrEdList () { string $ma_selected[] = `ls -sl`; if (!(`size($ma_selected)`)) { warning "nothing selected. List will not display any objects"; } else { textScrollList -e -ra ma_multiAttrEdTSL; for ($ma_sel in $ma_selected) { string $pickWalked[] = `pickWalk -d down $ma_sel`; textScrollList -e -a $pickWalked ma_multiAttrEdTSL; } } } //Array that defines the commands I want to use global string $ma_meshArray[] = {"castsShadows" , "receiveShadows" , "motionBlur", "primaryVisibility" , "smoothShading" , "visibleInReflections" , "visibleInRefractions" , "doubleSided" , "opposite"}; //A loop building all the "options" - UI for ($i = 0; $i < `size($ma_meshArray)`; $i++) { checkBox -l $ma_meshArray[$i] -v 1 -p optionsColumn ($ma_meshArray[$i] + "checkBox"); } separator -h 46 -w 115; button -w 116 -l "Edit RenderStats"; //The proc that executes on checkBox' changeCommand global proc ma_renderStatCommand (int $ma_whichCommand) { global string $ma_meshArray[]; string $ma_listShapes[] = `textScrollList -q -si ma_multiAttrEdTSL`; for ($ma_shapes in $ma_listShapes) { setAttr ($ma_shapes + "." + $ma_meshArray[$ma_whichCommand]) (`checkBox -q -v ($ma_meshArray[$ma_whichCommand] + "checkBox")`); } } //Check the checkBox-values and edit the renderStats: global proc ma_cycleValues() { for ($i = 0; $i <= 8; $i++) { ma_renderStatCommand $i; } }