Skip to content

Instantly share code, notes, and snippets.

@taikomatsu
Created July 2, 2015 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taikomatsu/944e3a62ce638509f6fc to your computer and use it in GitHub Desktop.
Save taikomatsu/944e3a62ce638509f6fc to your computer and use it in GitHub Desktop.
Get all (readable) attributes value and set it to another (only settable)
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