The sphere command creates a new sphere. The number of spans in the in each direction of the sphere is determined by the useTolerance attribute. If -ut is true then the -tolerance attribute will be used. If -ut is false then the -sections attribute will be used.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
axis (ax) | float, float, float | ||
|
|||
caching (cch) | bool | ||
|
|||
constructionHistory (ch) | bool | ||
|
|||
degree (d) | int | ||
|
|||
endSweep (esw) | float | ||
|
|||
heightRatio (hr) | float | ||
|
|||
name (n) | unicode | ||
|
|||
nodeState (nds) | int | ||
|
|||
object (o) | bool | ||
|
|||
pivot (p) | float, float, float | ||
|
|||
polygon (po) | int | ||
The value of this argument controls the type of the object created by this operation 0: nurbs surface1: polygon (use nurbsToPolygonsPref to set the parameters for the conversion)2: subdivision surface (use nurbsToSubdivPref to set the parameters for the conversion)3: Bezier surface4: subdivision surface solid (use nurbsToSubdivPref to set the parameters for the conversion)Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
radius (r) | float | ||
|
|||
sections (s) | int | ||
|
|||
spans (nsp) | int | ||
|
|||
startSweep (ssw) | float | ||
|
|||
tolerance (tol) | float | ||
|
|||
useTolerance (ut) | bool | ||
|
Derived from mel command maya.cmds.sphere
Example:
import pymel.core as pm
import maya.cmds as cmds
# Create sphere with radius 10
pm.sphere( r=10 )
# Result: [nt.Transform(u'nurbsSphere1'), nt.MakeNurbSphere(u'makeNurbSphere1')] #
# Query the radius of the new sphere
r = pm.sphere( 'nurbsSphere1', q=True, r=True )
# Create half sphere
pm.sphere( ssw=0, esw=180 )
# Result: [nt.Transform(u'nurbsSphere2'), nt.MakeNurbSphere(u'makeNurbSphere2')] #
# Use tolerance to determine how many spans the new sphere has
pm.sphere( ut=True, tol=0.01 )
# Result: [nt.Transform(u'nurbsSphere3'), nt.MakeNurbSphere(u'makeNurbSphere3')] #
# Use sections to determine how many spans the new sphere has
pm.sphere( ut=False, s=8 )
# Result: [nt.Transform(u'nurbsSphere4'), nt.MakeNurbSphere(u'makeNurbSphere4')] #