Hello lovely peeps, I'm very new to writing scripts but have always wanted to get more into it! I'm currently trying to write a MEL script that selects all objects with the suffix of hg in the mesh name, adds the existing lambert to all, polySoftEdges everything, deletes input history, and cleans up the scene. I've added…
Try this import maya.cmds as cmds
import maya.mel as mel #Get all the transform nodes that have hg in it's name
geo_list = cmds.ls('*hg*',type='transform') #run through all the geometry
for geo in geo_list: #Ch=0 so that the soft edge won't end up in history cmds.polySoftEdge(geo,a=180,ch=0) #Get shapes to assign material…
(Don't have access to Maya atm to test) but you can just select each mesh in your for loop. Also, you don't need semicolons in Python, FYI. for m in models: cmds.select(m) cmds.polySoftEdge(a=180)
Or better yet, if easier to do in python (tho I haven't figured out how to translate sets -e -forceElement initialShadingGroup into python yet..) import maya.cmds as cmds import maya.mel as mel cmds.select("*hg*"); models = cmds.ls(sl=True) for m in models: cmds.polySoftEdge( a=180 ); cmds.delete(all=True, ch=True);…