pymel.core.modeling.polyAppendVertex

polyAppendVertex(*args, **kwargs)

Appends a new face to the selected polygonal object. The direction of the normal is given by the vertex order: the face normal points towards the user when the vertices rotate counter clockwise. Note that holes must be described in the opposite direction. Only works with one object selected.

Flags:

Long Name / Short Name Argument Types Properties
append / a float, float, float ../../../_images/create.gif
  Append a vertex or a point to the selected object, or mark the start of a hole. This flag may also be used in place of the hole, vertexand pointflags. If no argument is passed to the appendflag, then it marks the beginning of a hole (use an empty tuple in Python ‘()’). If one argument is passed, then the argument is considered to be an index into the vertices of the selected object, as with the vertexflag. If three arguments are passed, then it is interpreted as the coordinates of a new point which will be inserted, as with the pointflag.
constructionHistory / ch bool ../../../_images/create.gif ../../../_images/query.gif
  Turn the construction history on or off (where applicable). If construction history is on then the corresponding node will be inserted into the history chain for the mesh. If construction history is off then the operation will be performed directly on the object. Note:If the object already has construction history then this flag is ignored and the node will always be inserted into the history chain.
hole / h bool ../../../_images/create.gif
  Add a hole. The following points and edges will define a hole. Note that this flag should be avoided in Python. You may use the appendflag instead and pass an empty tuple ‘()’ to specify the start of a hole.
name / n unicode ../../../_images/create.gif
  Sets the name of the newly-created node. If it contains namespace path, the new node will be created under the specified namespace; if the namespace does not exist, it will be created. Flag can have multiple arguments, passed either as a tuple or a list.
point / p float, float, float ../../../_images/create.gif
  Adds a new point to the new face. Coordinates of free points are given in the local object reference. Note that this flag should be avoided in Python. You may use the appendflag instead and pass three arguments.
texture / tx int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Specifies how new faces are mapped. 0 - None; 1 - Normalize; 2 - Unitize C: Default is 0 (no mapping). Q: When queried, this flag returns an int
vertex / v int ../../../_images/create.gif
  Adds the given vertex of the selected object to the new face. Note that this flag should be avoided in Python. You may use the appendflag instead and pass one argument. Common flags

Derived from mel command maya.cmds.polyAppendVertex

Example:

import pymel.core as pm

pm.polyPlane( sx=3, sy=3 )

# add a new face
pm.polyAppendVertex( a=[6, 10, (.167, .3, -.167), (.167, .3, .167)] )

# add a new holed face
pm.polyAppendVertex( a=[9, 5, (-.167, .3, .167), (-.167, .3, -.167), (), (-.167, .2, .1), (-.167, .1, 0), (-.167, .2, -.1)] )

# connect the two new faces
pm.polyAppendVertex( a=[18, 17, 16, 19] )

# add a new unconnected quad
pm.polyAppendVertex( a=[(-.5, .5, -.5), (.5, .5, -.5), (.5, .5, .5), (-.5, .5, .5)] )