Hey All, I'm trying to use pymel to create a scriptJob that will assign a
particular material to whatever object(s) you have selected. When you
select something else, I need the previously selected objects to switch
back their original material. Making it assign a material based on
selection was not too hard, but I haven't been able to figure out how to
re-assign the original material once the object is no longer selected.
Thanks for any help!
from pymel.core import *
def assignBlueMatFn():
curSel = ls(sl=True)
for i in curSel:
hyperShade(i, assign='Blue_MAT')
scriptJob(event=['SelectionChanged', 'assignBlueMatFn()'])
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/cb1e5b7e-b8a7-45fe-ae71-1e6af723ce11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.