Go to: Synopsis. Return value. Related.
Flags. Python
examples.
polyPrimitive([axis=[linear, linear, linear]], [constructionHistory=boolean],
[name=string], [object=boolean], [polyType=int], [radius=linear], [sideLength=linear])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
polyPrimitive is undoable, queryable, and editable.
Create a polygon primative
string[] |
Object name and node name. |
In query mode, return type is based on queried flag.
polyCone, polyCube, polyPipe,
polyPrism, polyPyramid, polySphere, polyTorus
axis, constructionHistory, name, object, polyType, radius,
sideLength
Long name (short name) |
Argument types |
Properties |
axis(ax) |
[linear, linear, linear] |
   |
|
This flag specifies the primitive axis used to build the
primitive polygon.
Q: When queried, this flag returns a float[3]. |
|
radius(r) |
linear |
   |
|
This flag specifies the radius of the primitive polygon.
C: Default is 1.0.
Q: When queried, this flag returns a float. |
|
sideLength(l) |
linear |
   |
|
This flag specifies the side length of primitive polygon.
C: Default is 1.0.
Q: When queried, this flag returns a float. |
|
polyType(pt) |
int |
 |
|
This flag allows a specific primitive poly to be selected for
creation of mesh,
The valid values is 0
0 implies soccer ball to be created.
C: Default is 0 |
|
Common flags |
object(o) |
boolean |
 |
|
Create the result, or just the dependency node (where
applicable). |
|
Common flags |
name(n) |
string |
 |
|
Give a name to the resulting node. |
|
constructionHistory(ch) |
boolean |
  |
|
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. |
|
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. |
import maya.cmds as cmds
# Create a soccerBall with radius 1 side length 0.4037
cmds.polyPrimitive( r=1, l=0.4036, pt=0)