pymel.core.modeling.polyListComponentConversion

polyListComponentConversion(*args, **kwargs)

This command converts poly components from one or more types to another one or more types, and returns the list of the conversion. It doesn’t change anything of the current database.

Flags:
Long name (short name) Argument Types Properties
border (bo) bool ../../../_images/create.gif
 
Indicates that the converted components must be on the border of the selection. If it is not provided, the converted components will be the related ones.
fromEdge (fe) bool ../../../_images/create.gif
   
fromFace (ff) bool ../../../_images/create.gif
   
fromUV (fuv) bool ../../../_images/create.gif
   
fromVertex (fv) bool ../../../_images/create.gif
   
fromVertexFace (fvf) bool ../../../_images/create.gif
 
Indicates the component type to convert from. If none of them is provided, it is assumed to be all of them, including poly objects.
internal (internal) bool ../../../_images/create.gif
 

Indicates that the converted components must be totally envolved by the source components. E.g. a converted face must have all of its surrounding vertices being given. If it is not provided, the converted components will be the related ones.

toEdge (te) bool ../../../_images/create.gif
   
toFace (tf) bool ../../../_images/create.gif
   
toUV (tuv) bool ../../../_images/create.gif
   
toVertex (tv) bool ../../../_images/create.gif
   
toVertexFace (tvf) bool ../../../_images/create.gif
 
Indicates the component type to convert to. If none of them is provided, it is assumed to the object.
vertexFaceAllEdges (vfa) bool ../../../_images/create.gif
 

When converting from face vertices to edges, indicates that all edges with an end at the face vertex should be included. Without this flag, the default behaviour is to only include one edge per face vertex.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.polyListComponentConversion

Example:

import pymel.core as pm

import maya.cmds as cmds

# Convert the vertices to envolved poly face(s) and list results.
pm.polyListComponentConversion( 'plg.vtx[5:6]', 'plg.vtx[9:10]', fv=True, tf=True, internal=True )
plg.f[4]

# Convert anything to related poly face(s) and list results.
pm.polyListComponentConversion( 'plg.vtx[0]', 'plg.vtx[3]', 'plg.vtx[8]', tf=True )
plg.f[0] plg.f[2] plg.f[3] plg.f[6]

# Convert an object to faces and list results.
pm.polyListComponentConversion( 'plg', tf=True )
plg.f[*]

# Convert vertices to faces on selectionList and list results.
pm.select( 'plg.vtx[0]', 'plg.vtx[3]', 'plg.vtx[8]', r=True )
pm.polyListComponentConversion( fv=True, tf=True )
plg.f[0] plg.f[2] plg.f[3] plg.f[6]

# Use several calls of the command to list edges in the order
# in which they appear in a face.
pm.polyPlane( w=1, h=1, sx=1, sy=1 )
# Will return the edges in numeric order:
pm.polyListComponentConversion( 'pPlane1.f[0]', ff=True, te=True )
# Result: pPlane1.e[0:3]
# Now convert to vertexFace and then to edge to get the edges in the order they
# appear within the face:
vfList = pm.polyListComponentConversion( 'pPlane1.f[0]', ff=True, tvf=True )
vfList = pm.ls( vfList, flatten=True )
# Result: pPlane1.vtxFace[0][0] pPlane1.vtxFace[1][0] pPlane1.vtxFace[3][0] pPlane1.vtxFace[2][0]
for vf in vfList:
        edge = pm.polyListComponentConversion( vf, fvf=True, te=True )
        print edge
# Prints out the edges in the order they show up in the face.
pPlane1.e[0]
pPlane1.e[2]
pPlane1.e[3]
pPlane1.e[1]

# Illustrate the vertexFaceAllEdges flag
pm.polyPlane( w=1, h=1, sx=1, sy=1 )
pm.select( 'pPlane1.vtxFace[0][0]', r=True )
# Get the edge that originates at the selected face vertex
print pm.polyListComponentConversion( fvf=True, te=True )
# Result: pPlane1.e[0]
# Get both edges that adjoin the selected face vertex
print pm.polyListComponentConversion( fvf=True, te=True, vfa=True )
# Result: pPlane1.e[0:1]

Previous topic

pymel.core.modeling.polyLayoutUV

Next topic

pymel.core.modeling.polyMapCut

Core

Core Modules

Other Modules

This Page