I'm struggling to change the values across multiple objects using a GUI slider.
I have everything working on single objects, but when trying to do the same with multiple I run into problems.
Here is the script below -
global proc globalBrushWidth()
{
// Get polys in selection
string $origSelect[] = ls -sl
;
$polysInSelection = filterExpand -selectionMask 12
;
select $polysInSelection;
for ($node in $polysInSelection)
{
string $history[] = listHistory $node
;
int $histArraySize = size($history)
;
$brushIndex = ($histArraySize - 3);
select $history[ $brushIndex ];
string $brushSel[] = ls -sl
;
// Output to slider
$brushWidth = $brushSel[0] + ".globalScale";
float $brushWidthVal = floatSliderGrp -q -value setBrushWidthSlider
;
setAttr $brushWidth $brushWidthVal;
}
select $polysInSelection;
}
Thanks for the help in advance
global proc globalBrushWidth()
{
// Get polys in selection
string $origSelect[] = ls -sl
;
$polysInSelection = filterExpand -selectionMask 12
;
select $polysInSelection;
for ($node in $polysInSelection)
{
string $history[] = listHistory $node
;
int $histArraySize = size($history)
;
$brushIndex = ($histArraySize - 3);
select $history[ $brushIndex ];
string $brushSel[] = ls -sl
;
// Output to slider
$brushWidth = $brushSel[0] + ".globalScale";
float $brushWidthVal = floatSliderGrp -q -value setBrushWidthSlider
;
setAttr $brushWidth $brushWidthVal;
}
select $polysInSelection;
}