.simple

simplicity. time to focus on quality… substance… real meat… no frills… just content.

students asked if a tool existed to select all the hard or soft edges in their meshes so we whipped up a bit of python to do just that.

[sourcecode language=”python” wraplines=”false” collapse=”false”]
# set EDGETYPE variable to 0,1,2
import maya.cmds as cmds

# Set these values from GUI
SELECTION = cmds.ls(sl=True)
MODE = 3
TYPE = 0x8000 # 0x0000(none), 0x0001(vertex), 0x8000(edge), 0x0008(face), 0x0010(texture coordinates)
EDGETYPE = 1 # 0 = all, 1=HARD, 2=SOFT

def mrEdgeSoftness(SELECTION, MODE, TYPE, EDGETYPE):
# error check inputs
if SELECTION == 0 or ”:
SELECTION = cmds.ls(sl=True)

# iterate through selection and select based on mode, type, edgetype
for x in SELECTION:
edgeSelect = cmds.polySelectConstraint( m=MODE, t=TYPE, sm=EDGETYPE )

print ‘type: %s selected’ %str(EDGETYPE)
mrEdgeSoftness(SELECTION, MODE, TYPE, EDGETYPE)
[/sourcecode]

softedge

Leave a Reply

Your email address will not be published. Required fields are marked *