Package mrv :: Package maya :: Package nt :: Module base :: Class Shape
[hide private]
[frames] | no frames]

Class Shape

source code

             object --+                    
                      |                    
                   Node --+                
                          |                
         object --+       |                
                  |       |                
interface.Interface --+   |                
                      |   |                
interface.iDuplicatable --+                
                          |                
                 DependNode --+            
                              |            
                  ContainerBase --+        
                                  |        
                             Entity --+    
                                      |    
                     object --+       |    
                              |       |    
            interface.Interface --+   |    
                                  |   |    
                 interface.iDagItem --+    
                                      |    
                                DagNode --+
                                          |
                                         Shape

Interface providing common methods to all geometry shapes as they can be shaded. They usually support per object and per component shader assignments
Notes:
Instance Methods [hide private]

Inherited from DagNode: __getitem__, dagPath, name

Inherited from DependNode: setLocked

Inherited from 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__

    Sets Interface
 
_parseSetConnections(self, allow_compoents)
Manually parses the set connections from self
source code
 
componentAssignments(self, setFilter=fSetsRenderable, use_api=True, asComponent=True)
Returns: list of tuples(ObjectSetNode, Component_or_MObject) defininmg shader assignments on per component basis.
source code
    DAG Modification

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

Inherited from DagNode (private): _setWorldspaceTransform

    Edit

Inherited from DagNode: delete, duplicate

Inherited from DependNode: addAttribute, removeAttribute, rename, setNamespace

Inherited from DependNode (private): _addRemoveAttr

    DAG Status Information

Inherited from DagNode: displayOverrideValue, isTemplate, isVisible

    DAG Query

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

    Iterators

Inherited from DagNode: iterInstances

Inherited from interface.iDagItem: iterParents

    Overridden Methods

Inherited from DagNode: __eq__, __ne__

Inherited from DependNode: __getattr__, __repr__, __str__

Inherited from Node: __hash__

    Sets Handling

Inherited from DagNode (private): _getSetPlug

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

    Connections and Attributes

Inherited from DependNode: connections, dependencyInfo

    Status

Inherited from DagNode: isValid

Inherited from DependNode: isAlive

    General Query

Inherited from DagNode: apiObject, basename, object

Inherited from DependNode: referenceFile

    Interface

Inherited from Node: apiType, hasFn

Inherited from interface.iDuplicatable: copyFrom, 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 Node: getMFnClasses

    Name Generation

Inherited from interface.iDagItem: addSep

Class Variables [hide private]

Inherited from DagNode: kNextPos

Inherited from Node: __metaclass__

Inherited from interface.iDagItem: kOrder_BreadthFirst, kOrder_DepthFirst

    preset type filters
  fSetsRenderable = SetFilter(api.MFn.kShadingEngine, False, 0)
  fSetsDeformer = SetFilter(api.MFn.kSet, True, 1)

Inherited from DependNode: fSets, fSetsObject

    Configuration

Inherited from DagNode (private): _sep

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_parseSetConnections(self, allow_compoents)

source code 
Manually parses the set connections from self
Returns:
tuple(MObjectArray(setapiobj), MObjectArray(compapiobj)) if allow_compoents, otherwise just a list(setapiobj)

componentAssignments(self, setFilter=fSetsRenderable, use_api=True, asComponent=True)

source code 
Parameters:
  • setFilter - see connectedSets
  • use_api - if True, api methods will be used if possible which is usually faster. If False, a custom non-api implementation will be used instead. This can be required if the apiImplementation is not reliable which happens in few cases of 'weird' component assignments
  • asComponent - If True, the components will be wrapped into the matching MRV compontent type to provide a nicer interface. This might slightly slow down the process, but this is usually neglectable.
Returns:

list of tuples(ObjectSetNode, Component_or_MObject) defininmg shader assignments on per component basis.

If a shader is assigned to the whole object, the component would be a null object, otherwise it is an instance of a wrapped IndexedComponent class

Notes:
  • The returned Component will be an MObject(kNullObject) only in case the component is not set. Hence you should check whether it isNull() before actually using it.
  • the sets order will be the order of connections of the respective component list attributes at instObjGroups.objectGroups
  • currently only meshes and subdees support per component assignment, whereas only meshes can have per component shader assignments
  • SubDivision Components cannot be supported as the component type kSubdivCVComponent cannot be wrapped into any component function set - reevaluate that with new maya versions !
  • deformer set component assignments are only returned for instance 0 ! They apply to all output meshes though