Python API 2.0 Reference
|
Static Public Member Functions | |
def | __new__ () |
Static Public Member Functions inherited from OpenMaya.MPxNode | |
def | __new__ () |
def | addAttribute () |
def | attributeAffects () |
def | inheritAttributesFrom () |
Static Public Attributes | |
boundingBoxCenterX = <OpenMaya.MObjectobject> | |
boundingBoxCenterY = <OpenMaya.MObjectobject> | |
boundingBoxCenterZ = <OpenMaya.MObjectobject> | |
center = <OpenMaya.MObjectobject> | |
instObjGroups = <OpenMaya.MObjectobject> | |
intermediateObject = <OpenMaya.MObjectobject> | |
inverseMatrix = <OpenMaya.MObjectobject> | |
isTemplated = <OpenMaya.MObjectobject> | |
int | kBoundingBoxChanged = 1 |
int | kMatchInvalidAttribute = 4 |
int | kMatchInvalidAttributeDim = 7 |
int | kMatchInvalidAttributeIndex = 5 |
int | kMatchInvalidAttributeRange = 6 |
int | kMatchInvalidName = 3 |
int | kMatchNone = 1 |
int | kMatchOk = 0 |
int | kMatchTooMany = 2 |
int | kNoPointCaching = 0 |
int | kNormal = 0 |
int | kObjectChanged = 0 |
int | kRestorePoints = 2 |
int | kSavePoints = 1 |
int | kTransformOriginalPoints = 4 |
int | kUTangent = 1 |
int | kUVNTriad = 3 |
int | kUpdatePoints = 3 |
int | kVTangent = 2 |
mControlPoints = <OpenMaya.MObjectobject> | |
mControlValueX = <OpenMaya.MObjectobject> | |
mControlValueY = <OpenMaya.MObjectobject> | |
mControlValueZ = <OpenMaya.MObjectobject> | |
mHasHistoryOnCreate = <OpenMaya.MObjectobject> | |
matrix = <OpenMaya.MObjectobject> | |
nodeBoundingBox = <OpenMaya.MObjectobject> | |
nodeBoundingBoxMax = <OpenMaya.MObjectobject> | |
nodeBoundingBoxMaxX = <OpenMaya.MObjectobject> | |
nodeBoundingBoxMaxZ = <OpenMaya.MObjectobject> | |
nodeBoundingBoxMin = <OpenMaya.MObjectobject> | |
nodeBoundingBoxMinX = <OpenMaya.MObjectobject> | |
nodeBoundingBoxMinY = <OpenMaya.MObjectobject> | |
nodeBoundingBoxMinZ = <OpenMaya.MObjectobject> | |
nodeBoundingBoxSize = <OpenMaya.MObjectobject> | |
nodeBoundingBoxSizeX = <OpenMaya.MObjectobject> | |
nodeBoundingBoxSizeY = <OpenMaya.MObjectobject> | |
nodeBoundingBoxSizeZ = <OpenMaya.MObjectobject> | |
objectColor = <OpenMaya.MObjectobject> | |
objectGroupColor = <OpenMaya.MObjectobject> | |
objectGroupId = <OpenMaya.MObjectobject> | |
objectGroups = <OpenMaya.MObjectobject> | |
objectGrpCompList = <OpenMaya.MObjectobject> | |
parentInverseMatrix = <OpenMaya.MObjectobject> | |
parentMatrix = <OpenMaya.MObjectobject> | |
useObjectColor = <OpenMaya.MObjectobject> | |
visibility = <OpenMaya.MObjectobject> | |
worldInverseMatrix = <OpenMaya.MObjectobject> | |
worldMatrix = <OpenMaya.MObjectobject> | |
Static Public Attributes inherited from OpenMaya.MPxNode | |
int | kAssembly = 22 |
int | kBlendShape = 25 |
int | kCameraSetNode = 16 |
int | kClientDeviceNode = 20 |
int | kConstraintNode = 17 |
int | kDeformerNode = 2 |
int | kDependNode = 0 |
int | kEmitterNode = 6 |
int | kEvaluatedDirectly = 1 |
int | kEvaluatedIndirectly = 0 |
int | kFieldNode = 5 |
int | kFluidEmitterNode = 13 |
int | kGeometryFilter = 24 |
int | kHardwareShader = 9 |
int | kHwShaderNode = 10 |
int | kIkSolverNode = 8 |
int | kImagePlaneNode = 14 |
int | kLast = 26 |
int | kLeaveDirty = 2 |
int | kLocatorNode = 1 |
int | kManipContainer = 3 |
int | kManipulatorNode = 18 |
int | kMotionPathNode = 19 |
int | kObjectSet = 12 |
int | kParticleAttributeMapperNode = 15 |
int | kPostEvaluationTypeLast = 3 |
int | kSkinCluster = 23 |
int | kSpringNode = 7 |
int | kSurfaceShape = 4 |
int | kThreadedDeviceNode = 21 |
int | kTransformNode = 11 |
Properties | |
isRenderable = property(...) | |
Parent class of all user defined shapes. Method resolution order: - MPxSurfaceShape - MPxNode - builtins.object
def OpenMaya.MPxSurfaceShape.__init__ | ( | ) |
Initialize self. See help(type(self)) for accurate signature.
|
static |
Create and return a new object. See help(type) for accurate signature.
def OpenMaya.MPxSurfaceShape.acceptsGeometryIterator | ( | ) |
acceptsGeometryIterator(component, writeable=True, forReadOnly=False) -> bool acceptsGeometryIterator(writeable=True) -> boolboundingBox() -> MBoundingBox Returns True if the shape can supply a component iterator. This methods should be overridden to return True. The default is to return False. * component (MObject) - the component to test * writeable (bool) - is this component type writable by an iterator * forReadOnly (bool) - is this component type readable by an iterator
def OpenMaya.MPxSurfaceShape.activeComponents | ( | ) |
activeComponents() -> MObjectArray Returns a list of active (selected) components for the shape.
def OpenMaya.MPxSurfaceShape.boundingBox | ( | ) |
boundingBox() -> MBoundingBox This method should be overridden to return a bounding box for the shape. If this method is overridden, then MPxSurfaceShape.isBounded() should also be overridden to return True.
def OpenMaya.MPxSurfaceShape.cachedShapeAttr | ( | ) |
cachedShapeAttr() -> MObject Returns the attribute containing the shape's cached geometry, if it has one.
def OpenMaya.MPxSurfaceShape.canMakeLive | ( | ) |
canMakeLive() -> bool This method is used by Maya to determine whether a surface can be made live. It can be overridden to return True if you wish to allow your surface to be made live. If you return True, you will also need to implement both closestPoint() overloads. The default is to return False.
def OpenMaya.MPxSurfaceShape.childChanged | ( | ) |
childChanged(state=kObjectChanged) -> self This method can be used to trigger the shape to recalculate its bounding box. * state (int) - the type of change that has occurred Valid state: kObjectChanged Object geometry changed. Internal caches need to be updated. kBoundingBoxChanged Object geometry is unchanged but its bounding box has changed. This might happen if the object was moved or an offset changed.
def OpenMaya.MPxSurfaceShape.closestPoint | ( | ) |
closestPoint(toThisPoint, theClosestPoint, tolerance=MPoint.kTolerance) -> self closestPoint(raySource, rayDirection, theClosestPoint, theClosestNormal, findClosestOnMiss, tolerance=MPoint.kTolerance) -> bool This methods are respectively used by Maya in functions (such as select) that require closest point information from your surface and for snapping queries when your surface is live. For selection: If you've overridden canMakeLive() to return True, this method is also used by Maya for some snapping queries when your surface is live. * toThisPoint (MPoint) - the point to test against. * theClosestPoint [OUT] (MPoint) - the closest point on your surface. * tolerance (float) - tolerance to use in your calculations. For snapping: If you override this method, you should set theClosestPoint to the closest point on your surface intersected by the ray defined by raySource and rayDirection. You should also populate the theClosestNormal parameter with the surface normal at that intersection point. If no intersection is found and findClosestOnMiss is True, you should still provide a point on your surface closest to the ray defined by raySource and rayDirection. When used for live snapping, this allows the user to click and drag outside the bounds of a live surface and still have it snap to the nearest point on it within the viewport. Note, performing a pure 3D closest point of approach test in this situation may not give the most natural result for live mesh snapping. To provide behavior that matches Maya, you can project your surface onto the plane defined by the ray, then perform your calculations. This will account for view perspective and give accurate live snap points along the silhouette of the surface. If findClosestOnMiss is False, you should not provide a point and normal when the ray misses. Should return True if theClosestPoint and theClosestNormal have been set, False otherwise. canMakeLive() must also be overridden to return True. * raySource (MPoint) - the origin of the ray to test against * rayDirection (MVector) - the direction of the ray to test against * theClosestPoint [OUT] (MPoint) - the closest point on your surface * theClosestNormal [OUT] (MVector) - the normal at the closest point on your surface * findClosestOnMiss (bool) - when True, you should calculate theClosestPoint and theClosestNormal even if the ray misses your surface. * tolerance (float) - tolerance to use in your calculations
def OpenMaya.MPxSurfaceShape.componentToPlugs | ( | ) |
componentToPlugs(component, selectionList) -> self Converts the given component into a selection list of plugs. This method is used to associate a shapes components into the corresponding attributes (plugs) within the shape. For example, it gets called by the translate manipulator to determine which attributes should be driven by the manipulator, and by the setKeyframe command to determine where to connect animCurves for components. This method should be overridden if the shape supports components that can be selected and moved in Maya. * component (MObject) - the component to be converted * list (MSelectionList) - a selection list where the plug should be added
def OpenMaya.MPxSurfaceShape.convertToTweakNodePlug | ( | ) |
convertToTweakNodePlug(plug) -> bool Check if a tweak node is connected to this node. If it is, then reset the supplied plug to contain the controlPoints attribute on the tweak node. Returns True if a tweak node was found, False if the plug was unchanged * plug (MPlug) - plug which will be set to point to the associated tweak node plug if a tweak node is connected
def OpenMaya.MPxSurfaceShape.createFullRenderGroup | ( | ) |
createFullRenderGroup() -> MObject Returns a component containing all of renderable elements in the shape. This method is used to create a component containing every renderable element in the object. This method is supposed to return non-null object only if the dag object contains renderable components. Type of the return component should is the same as the one returned by MPxSurfaceShape::renderGroupComponentType().
def OpenMaya.MPxSurfaceShape.createFullVertexGroup | ( | ) |
createFullVertexGroup() -> MObject Returns a component containing all of the vertices in the shape. This method is used to create a component containing every vertex/CV in the object. This method is supposed to return non-null object only if the dag object contains vertices/CVs (control points), so derived classes that do should override this method.
def OpenMaya.MPxSurfaceShape.deleteComponents | ( | ) |
deleteComponents(componentList, undoInfo) -> bool Returns True if this method was successful, False otherwise. This method should be overridden if the shape is to support deletion of components. A list of components to be deleted will be passed in as well as an array of doubles where information about each deleted component can be stored for undo purposes. A typical use for this array is to store knot values or weights for control points that are deleted. * componentList (MObjectArray) - List of components to be deleted * undoInfo (MDoubleArray) - Values used for undo purposes
def OpenMaya.MPxSurfaceShape.excludeAsPluginShape | ( | ) |
excludeAsPluginShape() -> bool A Maya viewport can be set to not display "Plugin Shapes", which means shapes derived from MPxSurfaceShape. By overriding excludeAsPluginShape() to return False, you can change that behaviour so that this shape is still displayed even when the display of "Plugin Shapes" is disabled. The default implementation returns True. Returns True to have this shape obey the "Plugin Shapes" settings in the viewport's "Show" menu; False to have it ignore that setting.
def OpenMaya.MPxSurfaceShape.geometryData | ( | ) |
geometryData() -> MObject Returns the geometry data of the shape. The geometry data must be derived from the MPxGeometryData class. The data is used by Maya to add, edit and query component grouping (set) information for the shape. This set information is stored and managed by Maya's shape base class, geometryShape.
def OpenMaya.MPxSurfaceShape.geometryIteratorSetup | ( | ) |
geometryIteratorSetup(componentList, components, forReadOnly=False) -> MPxGeometryIterator This method should be overridden by the user to return a geometry iterator compatible with the user's geometry. A geometry iterator is used for iterating over the components of a shape, such as the vertices of a mesh, in a generic manner. The components to be iterated over are passed to this function in on of two ways, as a list of components, or as a single component. Only one of these arguments is used at any particular time. * componentList (MObjectArray) - a list of components to be iterated over * components (MObject) - the components to be iterated over * forReadOnly (bool) - specifies whether the iterator is for read-only
def OpenMaya.MPxSurfaceShape.getComponentSelectionMask | ( | ) |
getComponentSelectionMask() -> MSelectionMask Returns the selection mask of the shape. This routine must be overridden if the shape is to support interactive component selection in Viewport 2.0 and should provide information about the selection mask of the shape component.
def OpenMaya.MPxSurfaceShape.getShapeSelectionMask | ( | ) |
getShapeSelectionMask() -> MSelectionMask Returns the selection mask of the shape. This routine must be overridden if the shape is to support interactive object selection in Viewport 2.0 and should provide information about the selection mask of the shape.
def OpenMaya.MPxSurfaceShape.getWorldMatrix | ( | ) |
getWorldMatrix(block, instanceGeom) -> MMatrix Returns MMatrix which takes a point from local object space to world space. * block (MDataBlock) - a MDataBlock * instanceGeom (int) - the instance this MPxSurfaceShape corresponds to
def OpenMaya.MPxSurfaceShape.hasActiveComponents | ( | ) |
hasActiveComponents() -> bool This method is used to determine whether or not the shape has active (selected) components.
def OpenMaya.MPxSurfaceShape.isBounded | ( | ) |
isBounded() -> bool This method should be overridden to return True if the user supplies a bounding box routine. Supplying a bounding box routine makes refresh and selection more efficient. Returns a boolean value indicating whether a bounding box routine has been supplied
def OpenMaya.MPxSurfaceShape.localShapeInAttr | ( | ) |
localShapeInAttr() -> MObject Returns the attribute containing the shape's input geometry in local space. This method will be called by Maya to determine if the shape has construction history and must be overridden if the shape is to support deformers.
def OpenMaya.MPxSurfaceShape.localShapeOutAttr | ( | ) |
localShapeOutAttr() -> MObject Returns the attribute containing the shape's output geometry in local space. This method must be overridden if the shape is to support deformers.
def OpenMaya.MPxSurfaceShape.match | ( | ) |
match(mask, componentList) -> bool This method is used to check for matches between a selection type (or mask) and a given component. If your shape has components representing attributes then this method is used to match up your components with selection masks. This is used by sets and deformers to make sure that the selected components fall into the "vertex only" category. This is useful when you want to make sure that only a particular component can be deformed. * mask (MSelectionMask) - the selection mask to test against * componentList (MObjectArray) - a list of components to be tested
def OpenMaya.MPxSurfaceShape.matchComponent | ( | ) |
matchComponent(item, spec, list) -> int This method is used to convert the string representation of a component into a component object and to validate that the indices. This method should be overridden if the shape has components. * item (MSelectionList) - DAG selection item for the object being matched * spec (MAttributeSpecArray) - attribute specification object * list (MSelectionList) - list to add components to List of valid component match result: kMatchOk The component was matched without error. kMatchNone No component was matched. kMatchTooMany Not used. kMatchInvalidName One of the names in the attribute specification was not valid. kMatchInvalidAttribute Not used. kMatchInvalidAttributeIndex The attribute specification contained an index for a non-array attribute. kMatchInvalidAttributeRange An attribute index was out of range. kMatchInvalidAttributeDim The attribute specification provided the wrong number of dimensions for an attribute.
def OpenMaya.MPxSurfaceShape.newControlPointComponent | ( | ) |
newControlPointComponent() -> MObject The default action of this method is to return an MFnSingleIndexedComponent (of type MFn::kMeshVertComponent) in order to support rigid skinning binds. This method can be overridden to support other types of components such as MFnDoubleIndexedComponent and MFnTripleIndexedComponent and should return a new component of that type. The types allowed are those listed in the create() method docs for each MFn*IndexedComponent.
def OpenMaya.MPxSurfaceShape.pointAtParm | ( | ) |
pointAtParm(atThisParm, evaluatedPoint) -> bool This method is used by Maya in functions (such as select) that require point at parameter values. This only makes sense for parametric surfaces such as NURBS. Returns True if a point was found, False otherwise * atThisParm (MPoint) - the parameter to check * evaluatedPoint [OUT] (MPoint) - the surface point
def OpenMaya.MPxSurfaceShape.renderGroupComponentType | ( | ) |
renderGroupComponentType() -> int This method is used to return the type of renderable components for this shape. It should return a type among MFn::kMeshPolygonComponent, MFn::kSubdivFaceComponent and MFn::kSurfaceFaceComponent, which is used in the creation of per-face/patch shader assignment. Returns the type of renderable components for this shape. See MFnSet.addMember()
def OpenMaya.MPxSurfaceShape.transformUsing | ( | ) |
transformUsing(matrix, componentList, cachingMode=None, pointCache=None) -> self Transform the given components using the specified transformation matrix. This method should be overridden if the shape supports components that can be transformed using maya's move, scale, and rotate tools. * matrix (MMatrix) - the matrix representing the transformation that is to be applied to the components * componentList (MObjectArray) - a list of components to be transformed. If the list is empty, it indicates that every point in the geometry should be transformed. * cachingMode (int) - whether the points should be cached in the pointCache argument, or restored from the pointCache * pointCache (MPointArray) - used to store for undo and restore points during undo List of valid caching modes: kNoPointCaching No point caching. kSavePoints Points should be saved for undo in the point cache. kRestorePoints Points should be restored from the point cache. kUpdatePoints Transform and update the points in the point cache. kTransformOriginalPoints Transform using use the original pre-transformation values stored in the pointCache.
def OpenMaya.MPxSurfaceShape.tweakUsing | ( | ) |
tweakUsing(matrix, componentList, cachingMode, pointCache, handle) -> self Transform the given components using the specified transformation matrix. This method should be overridden if the shape supports components that can be transformed using maya's move, scale, and rotate tools. This method is called when the shape has history & connected to a tweak node. The most common reason why the shape would be connected to a tweak node is if it is being deformed. When a shape is connected to a tweak node, transformations applied to the points are placed in the tweak node rather than in the shape itself. * matrix (MMatrix) - the matrix representing the transformation that is to be applied to the components * componentList (MObjectArray) - a list of components to be tranformed. If the list is empty, it indicates that every point in the geometry should be transformed. * cachingMode (int) - whether the points should be cached in the pointCache argument, or restored from the pointCache * pointCache (MPointArray) - used to store for undo and restore points during undo * handle (MArrayDataHandle) - array data handle where the tweaks are stored See transformUsing() for a list of valid caching mode
def OpenMaya.MPxSurfaceShape.undeleteComponents | ( | ) |
undeleteComponents(componentList, undoInfo) -> bool This method should be overridden if the shape is to support undeletion of components. A list of components to be deleted will be passed in as well as an array of doubles where information about each deleted component is stored for undo purposes. A typical use for this array is to store knot values or weights for control points that are deleted. Returns True if this method was successful, False otherwise * componentList (MObjectArray) - List of components that were deleted * undoInfo (MDoubleArray) - Values used for undo purposes
def OpenMaya.MPxSurfaceShape.vertexOffsetDirection | ( | ) |
vertexOffsetDirection(component, direction, mode, normalize) -> bool This method should be overridden if the shape supports components that can be moved in the direction of the normal or UV's using the move vertex normal tool. This method should calculate the offset direction for a vertex components. The direction vector array is an array of offsets corresponding to the elements in the component. The mode argument specifies the type of movement that is being performed. The default for this method is to return False, i.e. no support for move normal tool. Returns True if the shape supports the current mode, False if the shape cannot do the requested vertex move * component (MObject) * direction (MVectorArray) * mode (int) - The type of vertex movement * normalize (bool) - specifies whether the offset vectors should be normalized List of valid types: kNormal Move in normal direction. kUTangent Move in u tangent direction. kVTangent Move in v tangent direction. kUVNTriad Calculate u, v, and normal offsets.
def OpenMaya.MPxSurfaceShape.weightedTransformUsing | ( | ) |
weightedTransformUsing(xform, space, componentList, cachingMode, pointCache, freezePlane) -> self Transform the given components with interpolation using the specified transformation matrix. If not overridden, then a default implementation will be used to perform the transformation and interpolation. The default implementation calls setPoint() for each transformed point. * xform (MTransformationMatrix) - the matrix representing the transformation that is to be applied to the components. * space (MMatrix) - the matrix representing the transformation space to perform the interpolated transformation. A value of None indicates it should be ignored. * componentList (MObjectArray) - a list of components to be transformed and their weights. This list will not be empty.* cachingMode (int) - whether the points should be added/updated in the pointCache, restored from the pointCache, or transform using use the original values in the pointCache. * pointCache (MPointArray) - used to store for undo and restore points during undo * freezePlane (MPlane) - used for symmetric transformation of components. A value of None indicates it is not used and there is no symmetric transformation. See transformUsing() for a list of valid caching mode
def OpenMaya.MPxSurfaceShape.weightedTweakUsing | ( | ) |
weightedTweakUsing(xform, space, componentList, cachingMode, pointCache, freezePlane, handle) -> self Transform the given components with interpolation using the specified transformation matrix. This method is called for transforming components using maya's move, scale, and rotate tools when the shape has history and is connected to a tweak node. The most common reason why the shape would be connected to a tweak node is if it is being deformed. When a shape is connected to a tweak node, transformations applied to the points are placed in the tweak node rather than in the shape itself. If not overridden, then a default implementation will be used to perform the transformation and interpolation. The default implementation calls setPoint() for each transformed point. * xform (MTransformationMatrix) - the matrix representing the transformation that is to be applied to the components * space (MMatrix) - the matrix representing the transformation space to perform the interpolated transformation. A value of None indicates it should be ignored. * componentList (MObjectArray) - a list of components to be transformed and their weights. This list will not be empty. * cachingMode (int) - whether the points should be added/updated in the pointCache, restored from the pointCache, or transform using the original values in the pointCache. * pointCache (MPointArray) - used to store for undo and restore points during undo * freezePlane (MPlane) - used for symmetric transformation of components. A value of None indicates it is not used and there is no symmetric transformation. * handle (MArrayDataHandle) - array data handle where the tweaks are stored See transformUsing() for a list of valid caching mode
def OpenMaya.MPxSurfaceShape.worldShapeOutAttr | ( | ) |
worldShapeOutAttr() -> MObject Returns the attribute containing the shape's output geometry in world space. This method must be overridden if the shape is to support deformers.
|
static |
Specifies whether the shape is a renderable shape. Making a shape renderable allows the shape to have shading group assignments.