pymel.core.modeling.polyOptions¶
- polyOptions(*args, **kwargs)¶
Changes the global display polygonal attributes. In query mode, return type is based on queried flag.
Flags:
Long Name / Short Name Argument Types Properties activeObjects / ao bool
Apply user choices for all active objects. allEdges / ae bool
Display all edges in solid line. backCullVertex / bcv bool
BackCull vertices. backCulling / bc bool
Display with no back culling. colorMaterialChannel / cm unicode
If colorShadedDisplay is true, then determines which material channel to display color per vertex in. The options are: none: disable material shadingambient: ambient material channelambientDiffuse: ambient and diffuse material channeldiffuse: diffuse material channelspecular: specular material channelemission: emission material channel colorShadedDisplay / cs bool
Use color per vertex display in shaded mode. displayAlphaAsGreyScale / dal bool
Display alpha as grey scale. displayBorder / db bool
Highlight border edge. displayCenter / dc bool
Display facet centers. displayCreaseEdge / dce bool
Highlight creased edges displayCreaseVertex / dcv bool
Highlight creased vertices displayGeometry / dg bool
Display geometry. displayInvisibleFaces / dif bool
Highlight invisible faces displayItemNumbers / din bool, bool, bool, bool
Displays item numbers (vertices edges facets uvs) displayMapBorder / dmb bool
Highlight map border edge. displayMetadata / dmt bool, bool, bool
Displays component metadata (vertices edges facets vertexFaces) displayNormal / dn bool
Display normals. displayShellBorder / dsb bool displaySubdComps / dsc bool
Display subdivided components when in Smooth Mesh Preview mode. displayTangent / dtn bool displayTriangle / dt bool
Display triangulation. displayUVTopology / uvt bool
Option on UV display to display UVs topologically. displayUVs / duv bool
Display UVs. displayVertex / dv bool
Display vertices. displayWarp / dw bool
Highlight warped facets. facet / f bool
For use with -dn flag. Set the normal display style to facet display. fullBack / fb bool
Display with full back culling. gl / gl bool
Apply user choices for all objects. hardBack / hb bool
Backculled hard edges only for backculled faces. hardEdge / he bool
Display only hard edges. hardEdgeColor / hec bool
Display hard edges as separate color. materialBlend / mb unicode
The options are: overwriteaddsubtractmultiplydivideaveragemodulate2x newPolymesh / np bool
Set component display state of new polymesh objects. point / pt bool
For use with -dn flag. Set the normal display style to vertex display. pointFacet / pf bool
For use with -dn flag. Set the normal display style to vertex and face display. relative / r bool
When this flag is used with flags dealing with size, the value (size) is a multiplication factor : i.e for flags : -sizeNormal, -sizeBorder. When this flag is used with flags dealing with a boolean value, the boolean value is toggled : i.e for flags : displayVertex, displayCenter, displayTriangle, displayBorder, backCullVertex, displayWarp, displayItemNumbers. reuseTriangles / rt bool
Avoid regenerating triangles, by reusing the old triangles upstream in the construction history. The construction history is searched upstream and downstream for other mesh nodes, and the given boolean value is set on those mesh nodes. Note, that this command does not set the value on the given mesh node. That has to be done using the setAttr command. This option would affect only the interactive 3d viewport. The batch-rendering would use the properly computed triangles. This is useful only for interactive performance such as skinning playback, when the display mode is shaded (or wireframe with triangles displayed) Using this option for wireframe display mode is not recomended. sizeBorder / sb float
Set the size of the polygonal border edges. sizeNormal / sn float
Set the size of the polygonal normals. sizeUV / suv float
Set the size of the polygonal UV. sizeVertex / sv float
Set the size of the polygonal vertex. smoothDrawType / sdt int
This setting only works with the newPolymesh flag. Sets a new default attribute value for the smoothDrawType attribute on a polymesh object. Options are: 0: Catmull-Clark 1: Linear 2: OpenSubdiv Catmull-Clark Uniform 3: OpenSubdiv Catmull-Clark Adaptive softEdge / se bool
Display soft edges in dotted lines. vertexNormalMethod / vnm int
This setting only works with the newPolymesh flag. Sets a new default attribute value for the vertexNormalMethod attribute on a polymesh object. Options are: 0: Unweighted 1: Angle Weighted 2: Area Weighted 3: Angle And Area Weighted wireBackCulling / wbc bool
Backculled faces are in wireframe. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.polyOptions
Example:
import pymel.core as pm pm.polyCube( n='plg', sx=3, sy=3, sz=3, w=5, h=5, d=5 ) pm.delete( 'plg.f[9:17]' ) # Vertices pm.polyOptions( displayVertex=True ) # Toggle vertices pm.polyOptions( r=True, displayVertex=True ) # Toggle, whatever the value given to the flag in this command. # It was previously true, it is set to false : vertices are not drawn. # Facet centers pm.polyOptions( displayCenter=True ) pm.polyOptions( displayCenter=False ) # Triangulation pm.polyOptions( displayTriangle=True ) pm.polyOptions( displayTriangle=False ) # Reusing Triangulation pm.polyOptions( reuseTriangles=True ) pm.polyOptions( reuseTriangles=False ) # Borders pm.polyOptions( displayBorder=True ) # Border size pm.polyOptions( sb=3 ) # Increase border size pm.polyOptions( r=True, sb=2 ) pm.polyOptions( displayBorder=False, sb=3 ) # Map borders pm.polyOptions( displayMapBorder=True ) pm.polyOptions( displayMapBorder=False ) # Normals # Normal type pm.polyOptions( displayNormal=True ) pm.polyOptions( pt=True )# on vertices pm.polyOptions( pf=True )# on vertices and facets pm.polyOptions( f=True )# on facets # Normal size pm.polyOptions( sn=2 ) # Increase normal size pm.polyOptions( r=True, sn=1.5 ) pm.polyOptions( displayNormal=False ) # Edges pm.polyOptions( softEdge=True ) pm.polyOptions( hardEdge=True ) pm.polyOptions( allEdges=True ) # Geometry pm.polyOptions( displayGeometry=False ) pm.polyOptions( displayGeometry=True ) # Backculling pm.polyOptions( wireBackCulling=True ) pm.polyOptions( hardBack=True ) pm.polyOptions( fullBack=True ) pm.polyOptions( displayVertex=True, backCullVertex=True ) pm.polyOptions( backCullVertex=False ) pm.polyOptions( displayVertex=False ) pm.polyOptions( backCulling=True ) # Color Shaded Display pm.polyOptions( colorShadedDisplay=True ) pm.polyOptions( colorMaterialChannel='DIFFUSE' )