Ejemplo n.º 1
0
def reverseSmoothing(obj_list = None):
    for obj in obj_list if not obj_list is None else pm.selected():
        outputmaya.displayPrint('正在逆向平滑:%s'%obj.nodeName())
        pm.select(obj.vtx[-1])
        pm.mel.ConvertSelectionToEdges()
        pm.mel.SelectEdgeLoopSp()
        pm.mel.polySelectEdgesEveryN('edgeRing',2)
        pm.mel.SelectEdgeLoopSp()
        pm.mel.SelectEdgeLoopSp()
        pm.mel.SelectEdgeLoopSp()
        pm.mel.polySelectEdgesEveryN('edgeRing',2)
        pm.polyDelEdge(cv=True,ch=False)
        outputmaya.displayPrint('逆向平滑 %s 完成'%obj.nodeName())
Ejemplo n.º 2
0
def createPreviewGrid( gridScale=1000):
    mesh = pm.polyPlane(sh=10,sw=10)
    mesh[0].s.set(gridScale,gridScale,gridScale) #그리드 하나당 1m
    mesh[0].getShape().overrideEnabled.set(True)
    mesh[0].getShape().overrideDisplayType.set(1) # 템플릿
    mesh[0].getShape().instObjGroups.disconnect()
    pm.polyDelEdge( [mesh[0].e[11], mesh[0].e[32], mesh[0].e[53], mesh[0].e[74], mesh[0].e[95], mesh[0].e[105], mesh[0].e[107], mesh[0].e[109], mesh[0].e[111], mesh[0].e[113], mesh[0].e[115:117], mesh[0].e[119], mesh[0].e[121], mesh[0].e[123], mesh[0].e[137], mesh[0].e[158], mesh[0].e[179], mesh[0].e[200]], cv=True, ch=1 )

    mesh2 = pm.polyPlane(sh=2,sw=2,h=1.005,w=1.005)
    #mesh2[0].s.set(gridScale,gridScale,gridScale) #그리드 하나당 1m
    mesh2[0].getShape().overrideEnabled.set(True)
    mesh2[0].getShape().overrideDisplayType.set(2) # 템플릿
    mesh2[0].getShape().instObjGroups.disconnect()

    pm.parent( mesh2[0].getShape(), mesh[0], s=True, r=True )
    pm.delete( mesh2[0] )   
    
    mesh[0].rename('previewGrid_10mx10m')

    if pm.objExists('Hips'):
        pm.delete( pm.pointConstraint('Hips',mesh[0]) )
        mesh[0].ty.set(0)
Ejemplo n.º 3
0
    pm.polySelectConstraint( where=0 )
    pm.select()
    allEdges = pm.ls( selection=True, fl=True )
    
    # initilize the inside edges list
    insideEdges = []
    
    # remove border edges
    for edge in range(len(borderEdges)):
        allEdges.remove( borderEdges[edge] )
    
    # create a list of interior edges from the list of all edges with the border edges removed    
    for edge in range(len(allEdges)):
        insideEdges.append(allEdges[edge])
    
    # clear selection
    pm.select( cl=True )  
    
    # randomly select and delete an interior edge   
    for iEdge in range(len(insideEdges)):
        if random.randrange( 0, 9 ) > 5:
            pm.select( insideEdges[iEdge] )
            pm.polyDelEdge( cv=False )
    
    # Clean up the winged vertices that are along straight edges, preserving corners        
    pm.selectType( pv=True )
    pm.polySelectConstraint( angle=1, type=0x0001, mode=3, anglebound=[ 91.0, 181.0 ] )
    pm.select()
    pm.polyDelVertex()
    pm.polySelectConstraint( angle=0 )