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.
Flags:
Long Name / Short Name | Argument Types | Properties | |
---|---|---|---|
axis / ax | float, float, float | ![]() ![]() ![]() |
|
|
|||
caching / cch | bool | ![]() ![]() ![]() |
|
|
|||
constructionHistory / ch | bool | ![]() |
|
|
|||
degree / d | int | ![]() ![]() ![]() |
|
|
|||
endSweep / esw | float | ![]() ![]() ![]() |
|
|
|||
frozen / fzn | bool | ![]() ![]() |
|
heightRatio / hr | float | ![]() ![]() ![]() |
|
|
|||
name / n | unicode | ![]() |
|
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. |
|||
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 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
# 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')] #