resetControls v0.2

Got tired of manually zeroing out my animation controls so wrote this script for it.
Name all the controls you want to be reset with the ending _CTRL. And yes the caps on CTRL does matter.
If you want to use an other extension I’m confident in you being smart enough to figure out what line to change and to what :)

Updated 3rd june 2009

##
## valueSwitcher
## -------------
## 17 maj 2009
## Jan-Erik "Jonne" Östman (jonne@jonne.net)
##
## www.jonne.net
##
##
## Instructions:
## -------------
## Requires TWO selected objects
## Transfers the value from object A to object B and from object B to object A.
## Used to switch controls on for instance feet in a walkcykle when creating the
## opposite pose
##
## v0.2 - 090603
##	Fixed a bug to allow switching values when the channelbox
##	contains locked values
##
##
## v0.1 - 090517
##	Rough proof of concept. Worked in the test I did.
##	Still remains to be tested "live"
##
## ---------------------------------------------------------------------------

import maya.cmds as cmds

# Get selection
sel = cmds.ls(sl=1)

# Get all keyable attributes from selected objects and add them to an array
attrListSource = cmds.listAttr(sel[0],k=1, w=1)
attrListTarget = cmds.listAttr(sel[1],k=1, w=1)

# Loop through each object and set values
for i in range(len(attrListSource)):

	## Get attribute names
	objSourceName = sel[0] + '.' + attrListSource[i]
	objTargetName = sel[1] + '.' + attrListTarget[i]

	## Get attribute values
	objSourceValue = cmds.getAttr(sel[0] + '.' + attrListSource[i])
	objTargetValue = cmds.getAttr(sel[1] + '.' + attrListSource[i])

	## Check if attribute is unlocked and swap values
	if (cmds.getAttr(objSourceName, se=1)) == 1 : cmds.setAttr(objSourceName, objTargetValue)
	if (cmds.getAttr(objTargetName, se=1)) == 1 : cmds.setAttr(objTargetName, objSourceValue)
I wish to do something Great and Wonderful, but I must start by doing the little things like they were Great and Wonderful”
~ Albert Einstein