Go to: Synopsis. Return value. Related. Flags. Python examples.

Synopsis

polyListComponentConversion( selectionItem[] , [border=boolean], [fromEdge=boolean], [fromFace=boolean], [fromUV=boolean], [fromVertex=boolean], [fromVertexFace=boolean], [internal=boolean], [toEdge=boolean], [toFace=boolean], [toUV=boolean], [toVertex=boolean], [toVertexFace=boolean], [uvShell=boolean], [vertexFaceAllEdges=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

polyListComponentConversion is undoable, NOT queryable, and NOT editable.

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

Return value

selectionItem[]List of poly components

Related

polyInstallAction, polySelectConstraint, polySelectConstraintMonitor

Flags

border, fromEdge, fromFace, fromUV, fromVertex, fromVertexFace, internal, toEdge, toFace, toUV, toVertex, toVertexFace, uvShell, vertexFaceAllEdges
Long name (short name) Argument types Properties
border(bo) boolean create
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) boolean create
fromFace(ff) boolean create
fromUV(fuv) boolean create
fromVertex(fv) boolean create
fromVertexFace(fvf) boolean create
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) boolean create
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) boolean create
toFace(tf) boolean create
toUV(tuv) boolean create
toVertex(tv) boolean create
toVertexFace(tvf) boolean create
Indicates the component type to convert to. If none of them is provided, it is assumed to the object.
uvShell(uvs) boolean create
Will return UV components within the same UV shell. Only works with -tuv and -fuv flags.
vertexFaceAllEdges(vfa) boolean create
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 command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

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

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

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

# Convert vertices to faces on selectionList and list results.
cmds.select( 'plg.vtx[0]', 'plg.vtx[3]', 'plg.vtx[8]', r=True )
cmds.polyListComponentConversion( fv=True, tf=True )
# Result: 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.
cmds.polyPlane( w=1, h=1, sx=1, sy=1 )
# Will return the edges in numeric order:
cmds.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 = cmds.polyListComponentConversion( 'pPlane1.f[0]', ff=True, tvf=True )
vfList = cmds.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 = cmds.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
cmds.polyPlane( w=1, h=1, sx=1, sy=1 )
cmds.select( 'pPlane1.vtxFace[0][0]', r=True )
# Get the edge that originates at the selected face vertex
print cmds.polyListComponentConversion( fvf=True, te=True )
# Result: pPlane1.e[0]
# Get both edges that adjoin the selected face vertex
print cmds.polyListComponentConversion( fvf=True, te=True, vfa=True )
# Result: pPlane1.e[0:1]