// lock/unlock the set driven keys for the selected node(s). // this is specific to ford birds, which has many blendweighted nodes in // between the sdk's.. global proc meLockSDK(int $lock) { //string $sel[] = `ls -sl`; string $drivenAttrs[] = setDrivenKeyframe("-q","-driven",`ls -sl`); if ($drivenAttrs[0] == "No driven attributes found on the selected item.") { print "no set driven keys found."; return; } int $totalCount = 0; for ($atr in $drivenAttrs) { string $connections[] = listConnections("-s",1,"-d",0,"-p",0,"-c", 0, "-scn",1,$atr); for ($each in $connections) { string $nodeType = nodeType ($each); if ($nodeType == "blendWeighted") { string $animCurves[] = `listConnections -s 1 -d 0 -p 0 -c 0 -type "animCurve" -scn 1 $each`; for ($crv in $animCurves) { setAttr -lock $lock ($crv+".keyTimeValue"); $totalCount++; } } else if (size(match("animCurve",$nodeType)) > 0) { setAttr -lock $lock ($each+".keyTimeValue"); $totalCount++; } } } if ($lock == 1) print ($totalCount+" sdk curves locked."); if ($lock == 0) print ($totalCount+" sdk curves unlocked."); }