Package mrv :: Package maya :: Package nt :: Module geometry :: Class Mesh
[hide private]
[frames] | no frames]

Class Mesh

source code

             object --+                                        
                      |                                        
              base.Node --+                                    
                          |                                    
         object --+       |                                    
                  |       |                                    
interface.Interface --+   |                                    
                      |   |                                    
interface.iDuplicatable --+                                    
                          |                                    
            base.DependNode --+                                
                              |                                
             base.ContainerBase --+                            
                                  |                            
                        base.Entity --+                        
                                      |                        
                     object --+       |                        
                              |       |                        
            interface.Interface --+   |                        
                                  |   |                        
                 interface.iDagItem --+                        
                                      |                        
                           base.DagNode --+                    
                                          |                    
                                 base.Shape --+                
                                              |                
                                  GeometryShape --+            
                                                  |            
                                    DeformableShape --+        
                                                      |        
                                           ControlPoint --+    
                                                          |    
                                               SurfaceShape --+
                                                              |
                                                             Mesh

Implemnetation of mesh related methods to make its handling more convenient

Component Access:

>>> m.cvtx[:]                   # a complete set of components
>>> m.cvtx[1:4]                 # initialized with 3 indices
>>> m.cvtx[1]                   # initialized with a single index
>>> m.cvtx[1,2,3]               # initialized with multiple indices
>>> m.cf[(1,2,3)]               # initialized with list or tuple
>>> m.ce[iter(1,2,3)]           # initialized from iterator
>>> m.ce[api.MIntArray()]       # initialized from MIntArray
Instance Methods [hide private]

Inherited from GeometryShape: copyLightLinks

Inherited from base.DagNode: __getitem__, dagPath, name

Inherited from base.DependNode: setLocked

Inherited from base.Node: __hash_2009__, __new__

Inherited from interface.iDuplicatable: copyTo, copyToOther

Inherited from interface.Interface: supports

Inherited from object: __delattr__, __format__, __getattribute__, __init__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

    Iterator Shortcuts
 
_make_component_getter(cls, component) source code
    Utilities
 
copyTweaksTo(self, other)
Copy our tweaks onto another mesh
source code
 
isValidMesh(self)
Returns: True if we are nonempty and valid - emptry meshes do not work with the mfnmesh although it should ! Have to catch that case ourselves
source code
 
copyAssignmentsTo(self, other, **kwargs)
Copy set assignments including component assignments to other
source code
 
resetTweaks(self, tweak_type=eComponentType.vertex, keep_tweak_result=False)
Reset the tweaks on the given mesh shape
source code
 
component(self, component_type)
Returns: A component object able to hold the given component type
source code
    Iterators
 
iterComponents(self, component_type, component=api.MObject())
Returns: MItIterator matching your component_type to iteartor over items on this mesh
source code

Inherited from base.DagNode: iterInstances

Inherited from interface.iDagItem: iterParents

    Sets Interface

Inherited from base.Shape: componentAssignments

Inherited from base.Shape (private): _parseSetConnections

    DAG Modification

Inherited from base.DagNode: addChild, addInstancedChild, addParent, removeChild, removeParent, reparent, setParent, unparent

Inherited from base.DagNode (private): _setWorldspaceTransform

    Edit

Inherited from base.DagNode: delete, duplicate

Inherited from base.DependNode: addAttribute, removeAttribute, rename, setNamespace

Inherited from base.DependNode (private): _addRemoveAttr

    DAG Status Information

Inherited from base.DagNode: displayOverrideValue, isTemplate, isVisible

    DAG Query

Inherited from base.DagNode: child, childTransforms, children, childrenByType, hasChild, instance, instanceNumber, parent, parentAtIndex, shapes, transform

    Overridden Methods

Inherited from base.DagNode: __eq__, __ne__

Inherited from base.DependNode: __getattr__, __repr__, __str__

Inherited from base.Node: __hash__

    Sets Handling

Inherited from base.DagNode (private): _getSetPlug

Inherited from base.DependNode: addTo, connectedSets, isMemberOf, removeFrom, sets

    Connections and Attributes

Inherited from base.DependNode: connections, dependencyInfo

    Status

Inherited from base.DagNode: isValid

Inherited from base.DependNode: isAlive

    General Query

Inherited from base.DagNode: apiObject, basename, object

Inherited from base.DependNode: referenceFile

    Interface
 
copyFrom(self, other, *args, **kwargs)
Copy tweaks and sets from other onto self
source code

Inherited from base.Node: apiType, hasFn

Inherited from interface.iDuplicatable: createInstance

    Query Methods

Inherited from interface.iDagItem: childrenDeep, isPartOf, isRoot, isRootOf, parentDeep, root

    Name Generation

Inherited from interface.iDagItem: fullChildName

Class Methods [hide private]
    Interface

Inherited from base.Node: getMFnClasses

    Name Generation

Inherited from interface.iDagItem: addSep

Class Variables [hide private]
  eComponentType = enum(elm("vertex", api.MFn.kMeshVertComponent...

Inherited from base.DagNode: kNextPos

Inherited from base.Node: __metaclass__

Inherited from interface.iDagItem: kOrder_BreadthFirst, kOrder_DepthFirst

    preset type filters

Inherited from base.Shape: fSetsDeformer, fSetsRenderable

Inherited from base.DependNode: fSets, fSetsObject

    Configuration

Inherited from base.DagNode (private): _sep

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

copyTweaksTo(self, other)

source code 
Copy our tweaks onto another mesh

Note: we do not check topology for maximum flexibility

isValidMesh(self)

source code 
Returns:
True if we are nonempty and valid - emptry meshes do not work with the mfnmesh although it should ! Have to catch that case ourselves

copyAssignmentsTo(self, other, **kwargs)

source code 
Copy set assignments including component assignments to other
Parameters:
  • kwargs - passed to set.addMember, additional kwargs are: * setFilter: default is fSetsRenderable
Decorators:
  • @undoable

resetTweaks(self, tweak_type=eComponentType.vertex, keep_tweak_result=False)

source code 
Reset the tweaks on the given mesh shape
Parameters:
  • tweak_type - the component type(s) whose tweaks are to be removed, valid values are 'vertex' and 'uv' members of the eComponentType enumeration. Pass in a scalar value or a list of tweak types
  • keep_tweak_result - if True, the effect of the tweak will be kept. If False, it will be removed. What actually happens depends on the context

    • [referenced] mesh without history:

      copy outMesh to inMesh, resetTweaks

      if referenced, plenty of reference edits are generated, ideally one operates on non-referenced geomtry

    • [referenced] mesh with history:

      put tweakNode into mesh history, copy tweaks onto tweak node

Decorators:
  • @undoable

Note: currently vertex and uv tweaks will be removed if keep is enabled, thus they must both be specified

component(self, component_type)

source code 
Parameters:
Returns:
A component object able to hold the given component type

iterComponents(self, component_type, component=api.MObject())

source code 
Parameters:
  • component_type -
    • vertex -> MItMeshVertex
    • edge -> MItMeshEdge
    • face -> MItMeshPolygon
    • uv -> MItMeshFaceVertex
  • component - if not kNullObject, the iterator returned will be constrained to the given indices as described by the Component. Use component to retrieve a matching component type's instance
Returns:
MItIterator matching your component_type to iteartor over items on this mesh

copyFrom(self, other, *args, **kwargs)

source code 
Copy tweaks and sets from other onto self
Parameters:
  • kwargs -
    • setFilter: if given, default is fSets, you may specify the types of sets to copy

      if None, no set conenctions will be copied

Overrides: interface.iDuplicatable.copyFrom

Class Variable Details [hide private]

eComponentType

Value:
enum(elm("vertex", api.MFn.kMeshVertComponent), elm("edge", api.MFn.kM\
eshEdgeComponent), elm("face", api.MFn.kMeshPolygonComponent), elm("uv\
", api.MFn.kMeshMapComponent))