pymel.core.nodetypes.Subdiv

Inheritance diagram of Subdiv

class Subdiv(*args, **kwargs)

class counterpart of mel function subdiv

Provides useful information about the selected subdiv or components, such as the deepest subdivided level, the children or parents of the currently selected components, etc. In query mode, return type is based on queried flag.

cleanTopology()
collapse(level, makeNewNodeInvisible)

This method creates a copy of a given source subdivision surface collapsed by the given number of levels. After the collapse this function set will operate on the new subdivision surface.

Parameters :
level : int

the number of levels of the hierarchy to collapse

makeNewNodeInvisible : bool

sets the invisible attribute of the new node

Return type:

PyNode

Derived from api method maya.OpenMaya.MFnSubd.collapse

convertToNurbs()

Converts this surface to a set of nurbs surfaces.

Return type:PyNode list

Derived from api method maya.OpenMaya.MFnSubd.convertToNurbs

copy(source, parentOrOwner='MObject::kNullObj')

This method creates a copy of a given source subdivision surface. After the copy this function set will operate on the new subdivision surface.

Parameters :
source : PyNode

the subdivision surface to be copied

parentOrOwner : PyNode

the DAG parent or kSubdivData the new subdivision surface will belong to

Return type:

PyNode

Derived from api method maya.OpenMaya.MFnSubd.copy

creasesClearAll()

Clear all crease information from this surface. No vertices or edges will be creased after this function completes. Derived from api method maya.OpenMaya.MFnSubd.creasesClearAll

Undo is not currently supported for this method

createBaseMesh(reverseNormal, numVertices, numPolygons, vertexArray, polygonCounts, polygonConnects, parentOrOwner='MObject::kNullObj')

Creates a new subdivision surface given an array of vertices and connection information and sets this function set to operate on the new surface.

Parameters :
reverseNormal : bool

Not currently used

numVertices : int

number of vertices

numPolygons : int

number of polygons

vertexArray : Point list

point (vertex) array

polygonCounts : int list

array of vertex counts for each polygon

polygonConnects : int list

array of vertex connections for each polygon

parentOrOwner : PyNode

parent of the polygon that will be created

Return type:

PyNode

Derived from api method maya.OpenMaya.MFnSubd.createBaseMesh

editsPending()

As the new hierarchical vertex offsets are being introduced, you can choose to not apply them to the surface immediatelly. If you do that, the number of edits pending will increase. Any edits are not actually made until you call “updateEdits”. This functions lets you know if you need to call it or not.

Return type:int

Derived from api method maya.OpenMaya.MFnSubd.editsPending

editsUpdateAll()

If there are pending edits, this function will update the surface so that there are no pending edits. Derived from api method maya.OpenMaya.MFnSubd.editsUpdateAll

Undo is not currently supported for this method

getConnectedSetsAndMembers(instanceNumber, renderableSetsOnly)

Returns all the sets connected to the specified instance of this mesh. For each set in the “sets” array there is a corresponding entry in the “comps” array which are all the components in that set. If the entire object is in a set, then the corresponding entry in the comps array will have no elements in it.

Parameters :
instanceNumber : int

The instance number of the mesh to query

renderableSetsOnly : bool

If true then this method will only return renderable sets

Return type:

(PyNode list, PyNode list)

Derived from api method maya.OpenMaya.MFnSubd.getConnectedSetsAndMembers

getCurrentLevel(**kwargs)

When queried, this flag returns an integer representing the level of the currently selected subdiv surface component(s). Returns -1, if there are more than one level of CVs are selected, (even if they are from different objects) Returns -2, if there are no input subdiv CVs to process.

Derived from mel command maya.cmds.subdiv

getCurrentSubdLevel(**kwargs)

When queried, this flag returns an integer representing the level of the currently selected subdiv surface, regardless of whether components are selected or not. Returns -2, if there are no input subdiv CVs to process.

Derived from mel command maya.cmds.subdiv

getDeepestLevel(**kwargs)

When queried, this flag returns an integer representing the deepest level to which the queried subdiv surface has been subdivided.

Derived from mel command maya.cmds.subdiv

getDisplayLoad(**kwargs)

When queried, this flag prints the display load of selected subdiv

Derived from mel command maya.cmds.subdiv

getEdgeStats(**kwargs)

When queried, this flag prints stats on the current subd.

Derived from mel command maya.cmds.subdiv

getEdges(**kwargs)
getFaceStats(**kwargs)

When queried, this flag prints stats on the current subd.

Derived from mel command maya.cmds.subdiv

getMaxPossibleLevel(**kwargs)

When queried, this flag returns an integer representing the maximum possible level to which the queried subdiv surface can been subdivided.

Derived from mel command maya.cmds.subdiv

getProxyMode(**kwargs)

When queried, this flag returns an integer representing whether or not the subdivision surface is in “polygon proxy” mode. “Proxy” mode allows the base mesh of a subdivision surface without construction history to be edited using the polygonal editing tools. Returns 1, if the subdivision surface is in “polygon proxy” mode. Returns 0, if the surface is not currently in “proxy” mode, but could be put into “proxy” mode since it has no construction history. (This state is also known as “standard” mode.) Returns 2, if the surface is not in “proxy” mode and cannot be put into proxy mode, as it has construction history.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.subdiv

getSharpenedEdges(**kwargs)
getSharpenedVerts(**kwargs)
getSmallOffsets(**kwargs)

When queried, this flag prints the number of subdiv vertices in the hierarchy that have a small enough offset so that the vertex is not required

Derived from mel command maya.cmds.subdiv

getTweakedVerts(**kwargs)
levelFullySubdivideTo(level)

Fully subdivide the whole surface to the specified level. This could be very expensive, so be careful, or you will run out of memory. As a rule, each level has 4 times more faces than the previous one.

Parameters :
level : int

The level to which to fully subdivide

Derived from api method maya.OpenMaya.MFnSubd.levelFullySubdivideTo

Undo is not currently supported for this method

levelMaxAllowed()

Returns the maximum level that can be created. You should probably avoid fully subdividing the surface to that level as you will most likelly just run out of memory.

Return type:int

Derived from api method maya.OpenMaya.MFnSubd.levelMaxAllowed

levelMaxCurrent()

Returns the finest level that currently exist. As int as a single face exists at a level, that level is counted. Note that this not mean that all of the faces exist on all levels.

Return type:int

Derived from api method maya.OpenMaya.MFnSubd.levelMaxCurrent

numEdges(level=0)

Returns the number of edges at a level.

Parameters :
level : int

The level where we’re counting the edges

Return type:

int

Derived from api method maya.OpenMaya.MFnSubd.edgeCount

numFaces(level=0)

Returns the number of polygons currently existing at the specified level of the hierarchy.

Parameters :
level : int

Level at which we’re counting

Return type:

int

Derived from api method maya.OpenMaya.MFnSubd.polygonCount

numVertices(level=0)

Returns the finest vertex count at a particular level. These are the vertices that are currently instantiated.

Parameters :
level : int

The level we are interested in

Return type:

int

Derived from api method maya.OpenMaya.MFnSubd.vertexCount

polygonCountMaxWithGivenBaseMesh(level=1)

If you were to fully subdivide at a given level, how many polygons would you have at that level? This function will tell you and possibly save you from running out of memory if you go too deep. Note that this is exactly the same as “polygonCount” for levels 0 and 1.

Parameters :
level : int

The level where you would be counting

Return type:

int

Derived from api method maya.OpenMaya.MFnSubd.polygonCountMaxWithGivenBaseMesh

tesselate(uniform, depth, sample, parentOrOwner='MObject::kNullObj')

Performs tesselation on this surface and create a new mesh in the DAG. The parentOrOwner argument is used to specify the owner of the new surface.

Parameters :
uniform : bool

Use uniform tesselation if this is set.

depth : int

Used in the uniform tesselation: how deep do we go

sample : int

In both tesselation cases, once we decide which level to tesselate at, how many times do we sample.

parentOrOwner : PyNode

the DAG parent or kMeshData the new Mesh will belong to

Return type:

PyNode

Derived from api method maya.OpenMaya.MFnSubd.tesselate

tessellateViaNurbs(parentOrOwner='MObject::kNullObj')

Performs tesselation on this surface and create a new mesh in the DAG. The parentOrOwner argument is used to specify the owner of the new surface.

Parameters :
parentOrOwner : PyNode

the DAG parent or kMeshData the new Mesh will belong to

Return type:

PyNode

Derived from api method maya.OpenMaya.MFnSubd.tessellateViaNurbs

updateAllEditsAndCreases()

If you have been editing offsets without updating the surface, this function will save you. This will dirty up the complete surface and recompute the positions of all the cvs, updating the crease info along the way. Not cheap to call. Derived from api method maya.OpenMaya.MFnSubd.updateAllEditsAndCreases

Undo is not currently supported for this method

updateSubdSurface()

Signal that this subdivision surface has changed and needs to redraw itself. Derived from api method maya.OpenMaya.MFnSubd.updateSubdSurface

Undo is not currently supported for this method

vertexBaseMeshAdd(x, y, z)

Add a vertex to the base mesh and return its “index” name. Note that it will not have a valid 64-bit name until you actually create a polygon that holds it.

Parameters :
x : float

X location of the vertex

y : float

Y location of the vertex

z : float

Z location of the vertex

Return type:

int

Derived from api method maya.OpenMaya.MFnSubd.vertexBaseMeshAdd

vertexBaseMeshAddWithIndex(x, y, z, index)

Very similar to vertexBaseMeshAdd, this gives you an advanced option of specifying the index for the new vertex to be created. You have to be extremelly careful to end up with the indices 0, 1, ... N-1 for N total vertices.

Parameters :
x : float

X location of the vertex

y : float

Y location of the vertex

z : float

Z location of the vertex

index : int

The index the vertex is to take

Derived from api method maya.OpenMaya.MFnSubd.vertexBaseMeshAddWithIndex

Undo is not currently supported for this method

vertexBaseMeshGet(space='preTransform')

Return all base mesh vertices in the array using their indices (not the 64-bit names).

Parameters :
space : Space.Space

Specifies the coordinate system for this operation

values: ‘transform’, ‘preTransform’, ‘object’, ‘world’

Return type:

Point list

Derived from api method maya.OpenMaya.MSpace.vertexBaseMeshGet

vertexBaseMeshSet(space='preTransform')

Set the positions for the base mesh vertices using the 0, 1,... indexing instead of the 64-bit vertex names.

Parameters :
space : Space.Space

Specifies the coordinate system for this operation

values: ‘transform’, ‘preTransform’, ‘object’, ‘world’

Return type:

Point list

Derived from api method maya.OpenMaya.MSpace.vertexBaseMeshSet

vertexEditsClearAllNonBase()

Find all vertices with edits and remove those edits, setting them back to their original position. Derived from api method maya.OpenMaya.MFnSubd.vertexEditsClearAllNonBase

Undo is not currently supported for this method

Previous topic

pymel.core.nodetypes.SubdTweakUV

Next topic

pymel.core.nodetypes.SubdivCollapse

Core

Core Modules

Other Modules

This Page