class MObjectHandle

Jump to documentation

Generic Class for validating MObjects. (OpenMaya) (OpenMaya.py)

public members:

MObjectHandle ()
MObjectHandle ( const MObject & object )
MObjectHandle ( const MObjectHandle &handle )
~MObjectHandle ()
MObject object () const
const MObject & objectRef () const
bool isValid () const
bool isAlive () const
bool operator== (const MObject & object ) const
bool operator== (const MObjectHandle & object ) const
bool operator!= (const MObject & object ) const
bool operator!= (const MObjectHandle & object ) const
MObjectHandle & operator= (const MObject & object )
MObjectHandle & operator= (const MObjectHandle &other )

Documentation

Generic Class for validating MObjects. (OpenMaya) (OpenMaya.py)
Description

MObjectHandle is a wrapper class for the MObject class. An MObjectHandle will provide a user with added information on the validity of an MObject. Each MObjectHandle that is created registers an entry into a table to maintain state tracking of the MObject that the handle was created for. This will help users track when an MObject is invalid and should be re-retrieved.

Functions

MObjectHandle:: MObjectHandle ()
Description

Class Constructor

Creates an empty MObjectHandle

Arguments

  • Nil

Status Codes

  • Nil

MObjectHandle:: MObjectHandle ( const MObject & object )

Description

Class Constructor

Creates an MObjectHandle. Initializes it with an MObject.

Arguments

  • Nil

Status Codes

  • Nil

MObjectHandle:: MObjectHandle ( const MObjectHandle & handle )

Description

Class Copy Constructor

Creates an MObjectHandle. Initializes it with a copy of MObjectHandle.

Arguments

  • Nil

Status Codes

  • Nil

MObjectHandle:: ~MObjectHandle ()

Description

The class destructor.

MObject MObjectHandle:: object () const

Description

Returns the MObject associated with this handle. The returned MObject will be MObject::kNullObj if the object is invalid.

Arguments

  • Nil

Return Value

  • MObject MObject associated with this handle.

Status Codes

  • Nil

const MObject & MObjectHandle:: objectRef () const

Description

Returns the MObject associated with this handle. This provides read-only access to the MObject that MObjectHandle holds onto. This method will always return the object that belongs to MObjectHandle regardless of its validity. API users should use caution when using MObject data when it is not valid, and should never use the data when MObjectHandle indicates that the MObject is NOT alive.

Arguments

  • Nil

Return Value

  • MObject Read-only MObject associated with this handle.

Status Codes

  • Nil

bool MObjectHandle:: isValid () const

Description

Returns the validity of the associated MObject.

Arguments

  • Nil

Return Value

  • true MObject is still pointing to a valid internal object.
  • false MObject is no longer pointing to a valid internal object.

Status Codes

  • Nil

bool MObjectHandle:: isAlive () const

Description

Returns the live state of the associated MObject. An object can still be 'alive' but not 'valid' (eg. a deleted object that resides in the undo queue).

Arguments

  • Nil

Return Value

  • true MObject is still pointing to a live internal object.
  • false MObject is no longer pointing to a live internal object.

Status Codes

  • Nil

bool MObjectHandle:: operator== (const MObject &obj) const
Description

Returns true if the MObjectHandle is a handle for the given MObject.

Arguments

  • object - MObject to test.

Return Value

  • true MObject is handled by the MObjectHandle.
  • false MObject is not handled by the MObjectHandle.

Status Codes

  • Nil

bool MObjectHandle:: operator!= (const MObject &obj) const
Description

Returns true if the MObjectHandle is not a handle for the given MObject.

Arguments

  • object - MObject to test.

Return Value

  • true MObject is not handled by the MObjectHandle.
  • false MObject is handled by the MObjectHandle.

Status Codes

  • Nil

bool MObjectHandle:: operator== (const MObjectHandle &handle) const
Description

Returns true if the MObjectHandle handles the same MObject as this MObjectHandle.

Arguments

  • object - MObjectHandle to test.

Return Value

  • true MObjectHandles are the same.
  • false MObject are not the same.

Status Codes

  • Nil

bool MObjectHandle:: operator!= (const MObjectHandle &handle) const
Description

Returns true if the MObjectHandle does not handle the same MObject as this MObjectHandle.

Arguments

  • object - MObjectHandle to test.

Return Value

  • true MObjectHandles are not the same.
  • false MObject are the same.

Status Codes

  • Nil

MObjectHandle & MObjectHandle:: operator= (const MObjectHandle &other)
Description

Assigns this MObjectHandle to an instance of another MObjectHandle.

Arguments

  • other - MObjectHandle to copy.

Return Value

  • a reference to this MObjectHandle.

Status Codes

  • Nil

MObjectHandle & MObjectHandle:: operator= (const MObject &other)
Description

Assigns this MObjectHandle to an MObject instance.

Arguments

  • other - MObject to copy.

Return Value

  • a reference to this MObjectHandle.

Status Codes

  • Nil

This class has no child classes.


Autodesk® Maya® 8.0 © 1997-2006 Autodesk, Inc. All rights reserved. doc++ Copyright