pymel.core.modeling.polySmooth

static modeling.polySmooth(*args, **kwargs)

Smooth a polygonal object. This command works on polygonal objects or faces.

Flags:
Long name (short name) Argument Types Properties
boundaryRule (bnr) int  
   
caching (cch) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Toggle caching for all attributes so that no recomputation is needed
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.

continuity (c) float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This flag specifies the smoothness parameter. The minimum value of 0.0 specifies that the faces should only be subdivided. Maximum value of 1.0 smooths the faces as much as possible. C: Default is 1.0 Q: When queried, this flag returns a float.

degree (deg) int  
   
divisions (dv) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
This flag specifies the number of recursive smoothing steps. C: Default is 1. Q: When queried, this flag returns an int.
divisionsPerEdge (dpe) int  
   
keepBorder (kb) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
If on, the border of the object will not move during smoothing operation. C: Default is on. Q: When queried, this flag returns an int.
keepHardEdge (khe) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
If true, vertices on hard edges will not be modified. C: Default is false. Q: When queried, this flag returns a boolean.
keepMapBorders (kmb) int  
   
keepSelectionBorder (ksb) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
If true, vertices on border of the selection will not be modified. C: Default is false. Q: When queried, this flag returns a boolean.
keepTesselation (xkt) bool  
   
keepTessellation (kt) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

If true, the object will be tessellated consistently at each frame. If false, non-starlike faces will be triangulated before being subdivided, to avoid self- overlapping faces. C: Default is true. Q: When queried, this flag returns a boolean. Common flagsCommon flags

method (mth) int  
   
name (n) unicode ../../../_images/create.gif
 
Give a name to the resulting node.
nodeState (nds) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Defines how to evaluate the node. 0: Normal1: PassThrough2: Blocking3: Internally disabled. Will return to Normal state when enabled4: Internally disabled. Will return to PassThrough state when enabled5: Internally disabled. Will return to Blocking state when enabledFlag can have multiple arguments, passed either as a tuple or a list.

propagateEdgeHardness (peh) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

If true, edges which are a result of smoothed edges will be given the same value for their edge hardness. New subdivided edges will always be smooth. C: Default is false. Q: When queried, this flag returns a boolean.

pushStrength (ps) float  
   
roundness (ro) float  
   
smoothUVs (suv) bool  
   
subdivisionLevels (sl) int  
   

Derived from mel command maya.cmds.polySmooth

Example:

import pymel.core as pm

pm.polyCube( n='plg1' )
pm.move( -3, 0, 2 )
pm.polyCube( n='plg2' )
pm.move( -3, 0, -2 )
pm.polyCube( n='plg3' )
pm.move( 0, 0, 2 )
pm.delete( 'plg3.f[1]' )
pm.polyCube( n='plg4' )
pm.move( 0, 0, -2 )
pm.delete( 'plg4.f[1]' )
pm.polyCube( n='plg5' )
pm.move( 3, 0, 2 )
pm.polyCube( n='plg6' )
pm.move( 3, 0, -2 )

pm.polyOptions( ao=True, db=1 )

# only one division:
pm.polySmooth( 'plg1.f[0:5]', dv=1 )

# 2 divisions produces a round-ish object
pm.polySmooth( 'plg2.f[0:5]', dv=2 )

# keep border edges
pm.select( 'plg3.f[0:4]' )
pm.polySmooth( kb=1 )

# don't keep border edges
pm.select( 'plg4.f[0:4]' )
pm.polySmooth( kb=0 )

# 1 division, continuity 0.2
pm.select( 'plg5' )
pm.polySmooth( c=0.2 )

# 1 division, continuity 0.8
pm.polySmooth( 'plg6.f[0:5]', c=0.8 )

Previous topic

pymel.core.modeling.polySlideEdge

Next topic

pymel.core.modeling.polySoftEdge

Core

Core Modules

Other Modules

This Page