class MFnComponent

Jump to documentation

: public MFnBase Base class for component function sets. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnComponent < MFnBase

public members:

MFnComponent ()
int elementCount ( MStatus * ReturnStatus = NULL )
MFn::Type componentType ( MStatus * ReturnStatus = NULL )
bool isEmpty ( MStatus * ReturnStatus = NULL ) const
bool isEqual ( MObject &, MStatus * ReturnStatus = NULL ) const
bool isComplete ( MStatus * ReturnStatus = NULL ) const
MStatus setComplete ( bool )
MFn::Type type ( MStatus * ReturnStatus = NULL )
BSOLETE & NO SCRIPT SUPPORT

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

Base class for component function sets. (OpenMaya) (OpenMaya.py)
Description

This is the base class for all function sets which deal with component objects.

Components are MObjects which hold index information for shapes. The component object does not contain any information about the shape, it just contains index values and type information.

Components can be marked as complete meaning that the component represents a complete set of indices from 0 to numElements-1;

Components come is 3 varieties based upon the dimensions of the index. The types are single, double, and triple indexed. Examples of these types are mesh vertices (single indexed), nurbs surface CVs (double indexed), and lattice points (triple indexed).

To create, edit, or query a specific type of component, use the derived classes MFnSingleIndexedComponent, MFnDoubleIndexedComponent, and MFnTripleIndexedComponent.

Functions

MFnComponent:: MFnComponent ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnComponent:: MFnComponent ( MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given MObject.

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnComponent:: MFnComponent ( const MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MObject.

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnComponent:: ~MFnComponent ()

Description

The class destructor.

MFn::Type MFnComponent:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kComponent

MFnComponent:: MFnComponent ()

Description

Default class constructor

int MFnComponent:: elementCount ( MStatus * ReturnStatus )

Description

Returns the number of elements that this component contains.

Arguments

  • ReturnStatus Status code

Return Value

  • the number of elements

Status Codes

  • MS::kSuccess The operation succeeded
  • MS::kFailure Object error

MFn::Type MFnComponent:: componentType ( MStatus * ReturnStatus )

Description

Returns the MFn type of the component.

Arguments

  • ReturnStatus Status code

Return Value

  • the type

Status Codes

  • MS::kSuccess The operation succeeded
  • MS::kFailure Object error

MFn::Type MFnComponent:: type ( MStatus * ReturnStatus )

Description

This method is OBSOLETE and has NO SCRIPT SUPPORT. Please use the componentType() method instead.

bool MFnComponent:: isEmpty ( MStatus * ReturnStatus ) const

Description

Determines if this component is empty, i.e. there are no index elements.

Arguments

  • ReturnStatus Status code

Return Value

  • true if empty, false otherwise

Status Codes

  • MS::kSuccess The operation succeeded
  • MS::kFailure Object error

bool MFnComponent:: isEqual ( MObject & component, MStatus * ReturnStatus ) const

Description

Compares this component with the given component.

Arguments

  • component component to compare
  • ReturnStatus Status code

Return Value

  • true if the components are equal, false otherwise

Status Codes

  • MS::kSuccess The operation succeeded
  • MS::kFailure Object error

bool MFnComponent:: isComplete ( MStatus * ReturnStatus ) const

Description

Returns the complete state of the component.

Components can be marked as complete meaning that the component represents a complete set of indices from 0 to numElements-1;

Arguments

  • ReturnStatus Status code

Return Value

  • true if this component is complete, false otherwise

Status Codes

  • MS::kSuccess The operation succeeded
  • MS::kFailure Object error

MStatus MFnComponent:: setComplete ( bool complete )

Description

Sets the complete state of the component.

Components can be marked as complete meaning that the component represents a complete set of indices from 0 to numElements-1;

Important: if the component is set as complete, setCompleteData must also be called with the appropriate parameter (the total number of elements in the object). Note that setCompleteData(...) also sets the component as complete, thus 'setComplete(true)' may never need to appear in your code.

setCompleteData(...) is defined in derived classes.

Arguments

  • complete true sets the component as complete

Return Value

  • MS::kSuccess The operation succeeded
  • MS::kFailure Object error

Direct child classes:

- MFnTripleIndexedComponent
- MFnSingleIndexedComponent
- MFnDoubleIndexedComponent

Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright