def setCreaseValueOnSelection( v ): objs = pm.ls(selection=True) ## removed flatten=True because it makes it crazy slow for obj in objs: try: creaseValue = pm.polyCrease( obj, value = v ) except: pass ## we don't care if this fails, no big deal
def setCreaseValueOnSelection(v): objs = pm.ls(selection=True, flatten=True) for obj in objs: try: creaseValue = pm.polyCrease(obj, value=v) except: pass ## we don't care if this fails, no big deal
#### DeprecationWarning - use version in Static.Mesh @classmethod def uncreaseSelectedEdges(cls): cls.setCreaseValueOnSelection( 0.0 ) #### DeprecationWarning - use version in Static.Mesh @staticmethod
def setCreaseValueOnSelection( v ): objs = pm.ls(selection=True, flatten=True) for obj in objs: try: creaseValue = pm.polyCrease( obj, value = v ) except: pass ## we don't care if this fails, no big deal
def convertSelectionToCreasedEdges(): pm.mel.eval( "ConvertSelectionToEdges;" ) objs = pm.ls(selection=True, flatten=True) objsToSelect = [] for obj in objs: try: creaseValue = pm.polyCrease( obj, query=True, value=True ) creaseValue = creaseValue[0] except: creaseValue = 0 if creaseValue > 0.01: #print( "found a creased edge" ) objsToSelect.append(obj) if len(objsToSelect) > 0: #print(objsToSelect) #print("selecting") pm.select( objsToSelect, replace=True ) else: pm.select( clear=True )
def convertSelectionToCreasedEdges(): pm.mel.eval("ConvertSelectionToEdges;") objs = pm.ls(selection=True, flatten=True) objsToSelect = [] for obj in objs: try: creaseValue = pm.polyCrease(obj, query=True, value=True) creaseValue = creaseValue[0] except: creaseValue = 0 if creaseValue > 0.01: #print( "found a creased edge" ) objsToSelect.append(obj) if len(objsToSelect) > 0: #print(objsToSelect) #print("selecting") pm.select(objsToSelect, replace=True) else: pm.select(clear=True)