// =========================================================================== // 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 poseInterpolatorRenamePose(string $tpl, string $poseOldName, string $poseNewName) { // to rename the poseInterpolator pose. $tpl = poseInterpolatorTransform($tpl); poseInterpolator -edit -rename $poseOldName $poseNewName $tpl; // to rename the associated blendShape target. source bsTargetIndex.mel; // for proc getIndexForBlendShapeTarget. string $blendShapeNodes[] = poseInterpolatorConnectedShapeDeformers($tpl); for ($blendShape in $blendShapeNodes) { int $targetIndex = -1; $targetIndex = getIndexForBlendShapeTarget($poseOldName, $blendShape); if ($targetIndex > -1) { string $attrStr = $blendShape + ".w[" + $targetIndex + "]"; aliasAttr $poseNewName $attrStr; } } }