// =========================================================================== // 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 uv sets on instances for // per-instance uv sets. // // Given a selected set of instances, it finds the current uv set for the // first selected instance and it moves the subsequently selected instances // into that set. // // global proc polyUVShareInstances() { string $sel[] = `ls -sl`; if (size($sel) == 0) { error( (uiRes("m_polyUVShareInstances.kUVShareNothingSelected"))); } else { int $foundIt = 0; for ($ii = 0; $ii < size($sel); $ii++) { string $currSet[] = `polyUVSet -q -currentPerInstanceUVSet $sel[$ii]`; if (size($currSet) > 0) { polyUVSet -uvSet $currSet[0] -shareInstances; // redo the selection to trigger the uv set editor to update // its display // select -r $sel; $foundIt = true; break; } } if (! $foundIt) { warning( (uiRes("m_polyUVShareInstances.kNoPerInstance"))); } } }