// =========================================================================== // 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 int deletePoseInterpolatorNode(string $tpl) // // Description: // Delete the specified poseInterpolator node // // Return value: // { if (!isPoseInterpolator($tpl)) return 0; int $indices[] = poseInterpolatorPoseIndices($tpl); string $targetsToRemove[] = {}; for ($i in $indices) { string $sPlug = $tpl + ".output[" + $i + "]"; string $connections[] = `listConnections -plugs on -source off -type "blendShape" $sPlug`; $targetsToRemove = stringArrayCatenate($targetsToRemove, $connections); } delete $tpl; for ($target in $targetsToRemove) { string $buffer[]; tokenize($target, ".", $buffer); string $node = $buffer[0]; string $attr = $buffer[1]; string $parentAttr = $node + ".weight"; int $indices[] = `getAttr -multiIndices $parentAttr`; for ($j in $indices) { string $childAttr = $node + ".weight[" + $j + "]"; string $alias = `aliasAttr -q $childAttr`; if ($attr == $alias) { blendShapeDeleteTargetGroup($node, $j); } } } return 1; }