Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pymel.core import *
- def assMat(s,matSG):
- #print s, matSG
- try:
- sets(matSG[0], e=1, forceElement = s)
- except:
- try:
- hyperShade(s, matSG = slMat)
- except:
- print "could not assign material to:", s
- def getMat(s):# get material from selected
- matSG = s.getShape().listConnections(t="shadingEngine")
- mat = ls(listConnections(matSG),materials=1)[:1]
- return mat, matSG
- def matTran(sorce, destination):
- mat = getMat(sorce)
- assMat(destination,mat[1])
- sl = selected()
- matTran(sl[0],sl[1])
Advertisement
Add Comment
Please, Sign In to add comment