// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // This script helps to re-adjust the sharing of color sets on instances for // per-instance color sets. // // Given a selected set of instances, it finds the current color set for the // first selected instance and it moves the subsequently selected instances // into that set. // // global proc polyColorShareInstances() { string $sel[] = `ls -sl`; if (size($sel) == 0) { error( (uiRes("m_polyColorShareInstances.kColorShareNothingSelected"))); } else { int $foundIt = 0; for ($ii = 0; $ii < size($sel); $ii++) { string $currSet[] = `polyColorSet -q -currentPerInstanceSet $sel[$ii]`; if (size($currSet) > 0) { polyColorSet -colorSet $currSet[0] -shareInstances; // redo the selection to trigger the color set editor to update // its display // select -r $sel; $foundIt = true; break; } } if (! $foundIt) { warning( (uiRes("m_polyColorShareInstances.kNoPerInstance"))); } } }