C++ API Reference
|
Function Set Base Class. More...
#include <MFnBase.h>
Public Member Functions | |
virtual | ~MFnBase () |
Class Destructor. More... | |
virtual MFn::Type | type () const |
Determines the type of the Function Set within the API RTTI system. More... | |
bool | hasObj (MFn::Type) const |
Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More... | |
bool | hasObj (const MObject &) const |
Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More... | |
MObject | object (MStatus *ReturnStatus=nullptr) const |
Returns the MObject that is attached to the Function Set. More... | |
virtual MStatus | setObject (MObject &object) |
Attaches the Function Set to the specified Maya Object. More... | |
virtual MStatus | setObject (const MObject &object) |
NO SCRIPT SUPPORT. More... | |
Static Public Member Functions | |
static const char * | className () |
Returns the name of this class. More... | |
static const char * | typeString (MFn::Type) |
Returns the type string for a given type. More... | |
static bool | isValid (MFn::Type) |
Returns true if type is in the range of valid types. More... | |
Function Set Base Class.
Defines the interface for the API RTTI and Maya Object attachment methods common to all Function Set Classes.
Implements the Function Set compatibility test methods for all Function Sets.
The API provides access to Maya Objects as generic MObjects. Under the C++ class scheme MObjects simply have type MObject with no base or derived hierarchy. However, MObjects may be many different types of model or scene objects, from Attributes to Transforms, within Maya. This allows many different types of objects to be moved across or accessed through the API without undue concern on the part of plug-in developers for the type of object being manipulated.
Since it is impractical to provide every applicable method on MObjects, the methods applicable to Maya Objects are encapsulated in Function Sets. Function Sets can be attached to compatible MObjects to provide an external interface to methods appropriate to that MObject. All Function Sets provide a method setObject() which attaches them to the specified Maya Object. Additionally, most Function Sets provide a version of their constructor which attaches the new Function Set to a specified MObject.
The link between an MObject and the role it performs as a Maya scene or model object, as well as the compatibility between MObjects and Function Sets is managed by the API Run-Time Type Identification (RTTI) system. The two key concepts of this system are the Maya Object type and the Function Set type (both are MFn::Type). All MObjects have one and only one Maya Object type. All Function Sets have one and only one Function Set type. MObjects may, however, be compatible with many types of Function Sets. This compatibility follows the class hierarchy of the Function Sets. Thus an MObject with Maya Object type MFn::kNurbsSurface would be compatible with MFnNurbsSurface, MFnDagNode, MFnDependencyNode, MFnNamedObject and MFnBase.
Any MObject can be queried with the MObject::hasFn() method to determine if it is comaptible with a given Function Set.
The purpose of the Base Function Set (MFnBase) is to provide methods for determining whether or not a Function Set is compatible with a given Maya Object (MObject) type (MFn::Type) or a specific MObject. See: MFnBase::hasObj(MFn::Type) and MFnBase::hasObj(const MObject &)
As well, this Function Set provides virtual methods for determining the type of a Function Set under the API RTTI system.
|
virtual |
Class Destructor.
No additional action.
|
virtual |
Determines the type of the Function Set within the API RTTI system.
Reimplemented in MFnAnimCurve, MFnSubd, MFnMesh, MFnTransform, MFnNurbsSurface, MFnFalloffData, MFnPlugin, MFnNurbsCurve, MFnAssembly, MFnClip, MFnCharacter, MFnBlendShapeDeformer, MFnParticleSystem, MFnDagNode, MFnIkJoint, MFnPluginData, MFnAttribute, MFnLatticeDeformer, MFnNurbsSurfaceData, MFnComponent, MFnWeightGeometryFilter, MFnDynSweptGeometryData, MFnNurbsCurveData, MFnSet, MFnSubdData, MFnDependencyNode, MFnCompoundAttribute, MFnData, MFnMeshData, MFnMotionPath, MFnNumericAttribute, MFnLattice, MFnRotateManip, MFnScaleManip, MFnUnitAttribute, MFnNumericData, MFnSkinCluster, MFnArrayAttrsData, MFnDoubleArrayData, MFnFloatArrayData, MFnKeyframeDeltaTangent, MFnCameraSet, MFnGenericAttribute, MFnSphereData, MFnFluid, MFnFreePointTriadManip, MFnGeometryData, MFnGeometryFilter, MFnImageSource, MFnKeyframeDelta, MFnKeyframeDeltaBlockAddRemove, MFnNIdData, MFnPartition, MFnReference, MFnSpotLight, MFnWireDeformer, MFnComponentListData, MFnFloatVectorArrayData, MFnIntArrayData, MFnKeyframeDeltaInfType, MFnLayeredShader, MFnMatrixArrayData, MFnMatrixData, MFnPhongEShader, MFnPointArrayData, MFnStringArrayData, MFnStringData, MFnToggleManip, MFnTypedAttribute, MFnUInt64ArrayData, MFnUintArrayData, MFnVectorArrayData, MFnAnisotropyShader, MFnCamera, MFnContainerNode, MFnExpression, MFnHikEffector, MFnLambertShader, MFnReflectShader, MFnDirectionManip, MFnDistanceManip, MFnIkEffector, MFnIkSolver, MFnLatticeData, MFnManip3D, MFnMessageAttribute, MFnRenderPass, MFnStateManip, MFnToolContext, MFnCircleSweepManip, MFnCurveSegmentManip, MFnDragField, MFnLight, MFnNewtonField, MFnNonAmbientLight, MFnNonExtendedLight, MFnPointOnCurveManip, MFnPointOnSurfaceManip, MFnRadialField, MFnRenderLayer, MFnVortexField, MFnAmbientLight, MFnAreaLight, MFnDirectionalLight, MFnDiscManip, MFnDoubleIndexedComponent, MFnGravityField, MFnKeyframeDeltaMove, MFnLightDataAttribute, MFnPfxGeometry, MFnPointLight, MFnSingleIndexedComponent, MFnTripleIndexedComponent, MFnTurbulenceField, MFnUint64SingleIndexedComponent, MFnUniformField, MFnVolumeAxisField, MFnVolumeLight, MFnAirField, MFnBlinnShader, MFnField, MFnIkHandle, MFnPhongShader, MFnStandardSurfaceShader, MFnEnumAttribute, MFnInstancer, MFnKeyframeDeltaAddRemove, MFnKeyframeDeltaScale, MFnMatrixAttribute, MFnKeyframeDeltaBreakdown, MFnKeyframeDeltaWeighted, and MFnNObjectData.
bool hasObj | ( | MFn::Type | mtype | ) | const |
Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system.
[in] | mtype | Maya Object type |
bool hasObj | ( | const MObject & | object | ) | const |
Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system.
[in] | object | Maya Object to be tested for compatibility |
Returns the MObject that is attached to the Function Set.
[in] | ReturnStatus | Status Code (see below) |
Attaches the Function Set to the specified Maya Object.
[in] | object | Maya Object which is the target for attachment |
Reimplemented in MFnDagNode.
NO SCRIPT SUPPORT.
Attaches the Function Set to the specified read-only Maya Object.
[in] | object | Maya Object which is the target for attachment |
Reimplemented in MFnDagNode.
|
static |
Returns the name of this class.
|
static |
Returns the type string for a given type.
[in] | mtype | Maya Object type |
|
static |
Returns true if type is in the range of valid types.
[in] | mtype | Maya Object type |