// =========================================================================== // 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. // =========================================================================== global proc updateBlendShapeEditHUD() // // Description: // Update the blendshape target editing hud message. The // blendShapeEditHUD optionVar controls the visibility of // the HUD message // // Input Arguments: // None // // Return Value: // None // { if( `optionVar -ex "blendShapeEditHUD"` == 0 ) optionVar -iv "blendShapeEditHUD" 1; int $wantHUD = `optionVar -q "blendShapeEditHUD"`; string $tgtName = ""; if( $wantHUD != 0 ) { // find all blendshape nodes in the scene // determine if any are in edit mode string $bsn[] = `ls -type "blendShape"`; int $nbEdits = 0; for( $i = 0; $i < size($bsn) && $nbEdits < 2; $i++ ) { string $attr = $bsn[$i] + ".inputTarget"; int $tgts[] = `getAttr -multiIndices $attr`; for( $j = 0; $j < size( $tgts ); $j++ ) { $attr = $bsn[$i] + ".inputTarget[" + $tgts[$j] + "].sculptTargetIndex"; int $idx = `getAttr $attr`; if( $idx != -1 ) { if( $nbEdits++ == 0 ) { // first time we've seen a target in edit mode. $attr = $bsn[$i] + ".weight[" + $idx + "]"; $tgtName = `aliasAttr -q $attr`; } else { $tgtName += ", ..."; break; } } } } if( $nbEdits == 0 ) $wantHUD = 0; } setHUDBlendShapeEdit( $wantHUD, $tgtName ); }