Exemple #1
0
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
Exemple #2
0
 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
Exemple #3
0
 #### 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
Exemple #5
0
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 )
Exemple #6
0
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)