Created
July 2, 2015 15:05
-
-
Save taikomatsu/944e3a62ce638509f6fc to your computer and use it in GitHub Desktop.
Get all (readable) attributes value and set it to another (only settable)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymel.core import * | |
# get all (readable) attributes value | |
o = selected()[0] | |
attrs = {} | |
for a in listAttr(o): | |
try: | |
v = o.attr(a).get() | |
attrs[a] = v | |
except Exception, e: | |
print e | |
# ------------------------------------------------- | |
# set to another (only settable) | |
o = selected()[0] | |
for a in listAttr(o): | |
try: | |
o.attr(a).set(attrs[a]) | |
except Exception, e: | |
print e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment