Python API 2.0 Reference
OpenMaya.MDataHandle Class Reference
+ Inheritance diagram for OpenMaya.MDataHandle:

Public Member Functions

def __init__ ()
 
def acceptedTypeIds ()
 
def asAddr ()
 
def asAngle ()
 
def asBool ()
 
def asChar ()
 
def asDistance ()
 
def asDouble ()
 
def asDouble2 ()
 
def asDouble3 ()
 
def asDouble4 ()
 
def asFloat ()
 
def asFloat2 ()
 
def asFloat3 ()
 
def asFloatMatrix ()
 
def asFloatVector ()
 
def asGenericBool ()
 
def asGenericChar ()
 
def asGenericDouble ()
 
def asGenericFloat ()
 
def asGenericInt ()
 
def asGenericShort ()
 
def asInt ()
 
def asInt2 ()
 
def asInt3 ()
 
def asMatrix ()
 
def asMesh ()
 
def asMeshTransformed ()
 
def asNurbsCurve ()
 
def asNurbsCurveTransformed ()
 
def asNurbsSurface ()
 
def asNurbsSurfaceTransformed ()
 
def asPluginData ()
 
def asShort ()
 
def asShort2 ()
 
def asShort3 ()
 
def asString ()
 
def asSubdSurface ()
 
def asSubdSurfaceTransformed ()
 
def asTime ()
 
def asUChar ()
 
def asVector ()
 
def child ()
 
def copy ()
 
def copyWritable ()
 
def data ()
 
def datablock ()
 
def geometryTransformMatrix ()
 
def isGeneric ()
 
def isNumeric ()
 
def numericType ()
 
def set2Double ()
 
def set2Float ()
 
def set2Int ()
 
def set2Short ()
 
def set3Double ()
 
def set3Float ()
 
def set3Int ()
 
def set3Short ()
 
def set4Double ()
 
def setBool ()
 
def setChar ()
 
def setClean ()
 
def setDouble ()
 
def setFloat ()
 
def setGenericBool ()
 
def setGenericChar ()
 
def setGenericDouble ()
 
def setGenericFloat ()
 
def setGenericInt ()
 
def setGenericShort ()
 
def setInt ()
 
def setMAngle ()
 
def setMDistance ()
 
def setMFloatMatrix ()
 
def setMFloatVector ()
 
def setMMatrix ()
 
def setMObject ()
 
def setMPxData ()
 
def setMTime ()
 
def setMVector ()
 
def setShort ()
 
def setString ()
 
def type ()
 
def typeId ()
 

Static Public Member Functions

def __new__ ()
 

Detailed Description

Data handle for information contained in a data block.

Constructor & Destructor Documentation

def OpenMaya.MDataHandle.__init__ ( )
Initialize self.  See help(type(self)) for accurate signature.

Member Function Documentation

def OpenMaya.MDataHandle.__new__ ( )
static
Create and return a new object.  See help(type) for accurate signature.
def OpenMaya.MDataHandle.acceptedTypeIds ( )
acceptedTypeIds() -> array of MTypeIds

This method returns an array of MTypeIds.
def OpenMaya.MDataHandle.asAddr ( )
asAddr() -> long

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asAngle ( )
asAngle() -> MAngle

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asBool ( )
asBool() -> bool

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asChar ( )
asChar() -> int

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asDistance ( )
asDistance() -> MDistance

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asDouble ( )
asDouble() -> float

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asDouble2 ( )
asDouble2() -> [float, float]

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asDouble3 ( )
asDouble3() -> [float, float, float]

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asDouble4 ( )
asDouble4() -> [float, float, float, float]

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asFloat ( )
asFloat() -> float

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asFloat2 ( )
asFloat2() -> [float, float]

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asFloat3 ( )
asFloat3() -> [float, float, float]

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asFloatMatrix ( )
asFloatMatrix() -> MFloatMatrix

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asFloatVector ( )
asFloatVector() -> MFloatVector

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asGenericBool ( )
asGenericBool() -> bool

Returns the generic data represented by this handle in the data block.
def OpenMaya.MDataHandle.asGenericChar ( )
asGenericChar() -> int

Returns the generic data represented by this handle in the data block.
def OpenMaya.MDataHandle.asGenericDouble ( )
asGenericDouble() -> float

Returns the generic data represented by this handle in the data block.
def OpenMaya.MDataHandle.asGenericFloat ( )
asGenericFloat() -> float

Returns the generic data represented by this handle in the data block.
def OpenMaya.MDataHandle.asGenericInt ( )
asGenericInt() -> int

Returns the generic data represented by this handle in the data block.
def OpenMaya.MDataHandle.asGenericShort ( )
asGenericShort() -> int

Returns the generic data represented by this handle in the data block.
def OpenMaya.MDataHandle.asInt ( )
asInt() -> int

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asInt2 ( )
asInt2() -> [int, int]

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asInt3 ( )
asInt3() -> [int, int, int]

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asMatrix ( )
asMatrix() -> MMatrix

Returns the data represented by this handle in the data block.This method is only valid for attributes created using the MFnMatrixAttribute function set.
def OpenMaya.MDataHandle.asMesh ( )
asMesh() -> MObject

Returns the data represented by this handle in the data block.  The object returned by this call may be used directly with the mesh function set and iterators.  Even though this method does not return a reference to an MObject, modifications to the MObject instance will update the contents of the handle in the data block.  The method MDataHandle.setClean() should be called after the data block has been modified.

The surface returned by this method will be in local space even if the connection is supplying world space geometry.  This occurs mostly for efficiency reasons.  In the case of a world space geometry connection, the MObject returned by this method will also contain the world space transformation matrix. This means that world space operations may be performed on this object using the mesh function set and iterators.

It is possible to get the matrix that defines the local to world transformation for this geometry using the MDataHandle.geometryTransformMatrix() method.
def OpenMaya.MDataHandle.asMeshTransformed ( )
asMeshTransformed() -> MObject

Returns the data represented by this handle in the data block.  The object returned by this call may be used directly with the mesh function set (MFnMesh) or any of the mesh iterators.

If the incoming mesh comes with world space transformation data, then it will be applied to the data that is returned.  In other words, the mesh that is returned will be the mesh as it exists in world space.

The mesh that is returned from this method should not be modified.  This method is only provided to make it easier to take world space geometry as input.
def OpenMaya.MDataHandle.asNurbsCurve ( )
asNurbsCurve() -> MObject

Returns the data represented by this handle in the data block.  The object returned by this call may be used directly with the nurbs curve function set and iterator.  Even though this method does not return a reference to an MObject, modifications to the MObject instance will update the contents of the handle in the data block.  The method MDataHandle.setClean() should be called after the data block has been modified.

The curve returned by this method will be in local space even if the connection is supplying world space geometry.  This occurs mostly for efficiency reasons.  In the case of a world space geometry connection, the MObject returned by this method will also contain the world space transformation matrix. This means that world space operations may be performed on this object using the nurbs curve function set and iterator.

It is possible to get the matrix that defines the local to world transformation for this geometry using the MDataHandle.geometryTransformMatrix() method.
def OpenMaya.MDataHandle.asNurbsCurveTransformed ( )
asNurbsCurveTransformed() -> MObject

Returns the data represented by this handle in the data block.  The object returned by this call may be used directly with the nurbs curve function set (MFnNurbsCurve) or the nurbs curve CV iterator (MItCurveCV).

If the incoming curve comes with world space transformation data, then it will be applied to the data that is returned.  In other words, the curve that is returned will be the curve as it exists in world space.

The curve that is returned from this method should not be modified.  This method is only provided to make it easier to take world space geometry as input.
def OpenMaya.MDataHandle.asNurbsSurface ( )
asNurbsSurface() -> MObject

Returns the data represented by this handle in the data block.  The object returned by this call may be used directly with the nurbs surface function set and iterator.  Even though this method does not return a reference to an MObject, modifications to the MObject instance will update the contents of the handle in the data block.  The method MDataHandle.setClean() should be called after the data block has been modified.

The surface returned by this method will be in local space even if the connection is supplying world space geometry.  This occurs mostly for efficiency reasons.  In the case of a world space geometry connection, the MObject returned by this method will also contain the world space transformation matrix.  This means that world space operations may be performed on this object using the nurbs surface function set and iterator.

It is possible to get the matrix that defines the local to world transformation for this geometry using the MDataHandle.geometryTransformMatrix() method.
def OpenMaya.MDataHandle.asNurbsSurfaceTransformed ( )
asNurbsSurfaceTransformed() -> MObject

Returns the data represented by this handle in the data block.  The object returned by this call may be used directly with the nurbs surface function set (MFnNurbsSurface) or the nurbs surface CV iterator (MItSurfaceCV).

If the incoming surface comes with world space transformation data, then it will be applied to the data that is returned.  In other words, the surface that is returned will be the surface as it exists in world space.

The surface that is returned from this method should not be modified.  This method is only provided to make it easier to take world space geometry as input.
def OpenMaya.MDataHandle.asPluginData ( )
asPluginData() -> MPxData

Returns the data represented by this handle in the data block.  The object is returned as plugin data.  This should be used to access data types defined by plugins.
def OpenMaya.MDataHandle.asShort ( )
asShort() -> int

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asShort2 ( )
asShort2() -> [int, int]

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asShort3 ( )
asShort3() -> [int, int, int]

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asString ( )
asString() -> MString

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asSubdSurface ( )
asSubdSurface() -> MObject

Returns the data represented by this handle in the data block.  The object returned by this call may be used directly with the subdivision surface function set and iterator.  Even though this method does not return a reference to an MObject, modifications to the MObject instance will update the contents of the handle in the data block.  The method MDataHandle.setClean() should be called after the data block has been modified.

The subdivision surface returned by this method will be in local space even if the connection is supplying world space geometry.  This occurs mostly for efficiency reasons.  In the case of a world space geometry connection, the MObject returned by this method will also contain the world space   transformation matrix. This means that world space operations may be performed on this object using the subdivision surface function set and iterator.

It is possible to get the matrix that defines the local to world transformation for this geometry using the MDataHandle.geometryTransformMatrix() method.
def OpenMaya.MDataHandle.asSubdSurfaceTransformed ( )
asSubdSurfaceTransformed() -> MObject

Returns the data represented by this handle in the data block.  The object returned by this call may be used directly with the subdivision surface function set (MFnSubdSurface) or the subdivision surface iterators (MItSubdVertex, MItSubdFace, MItSubdEdge).

If the incoming surface comes with world space transformation data, then it will be applied to the data that is returned.  In other words, the surface that is returned will be the surface as it exists in world space.

The surface that is returned from this method should not be modified.  This method is only provided to make it easier to take world space geometry as input.
def OpenMaya.MDataHandle.asTime ( )
asTime() -> MTime

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asUChar ( )
asUChar() -> int

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.asVector ( )
asVector() -> MVector

Returns the data represented by this handle in the data block.
def OpenMaya.MDataHandle.child ( )
child(MPlug) -> MDataHandle
child(MObject) -> MDataHandle

Get a handle to a child of this handle.  This is used if you have a handle to a compound attribute.
def OpenMaya.MDataHandle.copy ( )
copy(src) -> self

Copies the attribute from the src attribute to the attribute referenced by this handle.  This is the only method which can completely copy a compound attribute from one handle to another.  The construct outputHandle.set (inputHandle.data()) will not work for compound or multi attributes.

* src (MDataHandle) - the handle to the attribute to copy.
def OpenMaya.MDataHandle.copyWritable ( )
copyWritable(src) -> self

Copies the attribute from the <i>src</i> attribute to the attribute referenced by this handle.  When the copy is made it ensures that the data in this handle is writable. That is, if the src handle has a writable copy of the data then it will be duplicated, otherwise this handle will claim the writer status for the data.

* src (MDataHandle) - the handle to the attribute to copy.
def OpenMaya.MDataHandle.data ( )
data() -> MObject

Returns the data object from this handle.  The object returned should be used with the appropriate data function set.  This method is not valid for simple numeric types.
def OpenMaya.MDataHandle.datablock ( )
datablock() -> MDataBlock

Returns a reference to the datablock assigned to this data handle.
def OpenMaya.MDataHandle.geometryTransformMatrix ( )
geometryTransformMatrix() -> MMatrix

This method returns a reference to the local-to-world transformation matrix that can accompany a geometry data object.  Only use this method on handles to geometry data (curves, surfaces, and meshes).

If no local-to-world transformation information has been provided then this will be an identity matrix.
def OpenMaya.MDataHandle.isGeneric ( )
isGeneric() -> [bool, isNumeric, isNull]

Returns True if this handle is for generic data.  There are 2 forms of generic data.  The first is for simple data and is used if the isNumeric parameter returns True.  In this case, the asGeneric*() and setGeneric*() methods of this class are used to query and set values.
The second form of generic data is for more complex attribute types.  As a result the type of the object must be checked and an appropriate attribute function set initialized with the object.Returns isNumeric True if this handle is for simple generic numeric data.
Returns isNull True if this handle is not set.
def OpenMaya.MDataHandle.isNumeric ( )
isNumeric() -> bool

Returns True if this handle is for simple numeric data. That means that the numeric data is directly accessible through the non-generic as*() and set*() methods of this handle. For example, depending on handle initialization, the asBool() may be called but the asGenericBool() should not be called.
def OpenMaya.MDataHandle.numericType ( )
numericType() -> int

Returns the type of data represented by this handle.  This method is only valid for data handles of simple numeric types.
def OpenMaya.MDataHandle.set2Double ( )
set2Double(float, float) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.set2Float ( )
set2Float(float, float) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.set2Int ( )
set2Int(int, int) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.set2Short ( )
set2Short(int, int) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.set3Double ( )
set3Double(float, float, float) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.set3Float ( )
set3Float(float, float, float) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.set3Int ( )
set3Int(int, int, int) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.set3Short ( )
set3Short(int, int, int) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.set4Double ( )
set4Double(float, float, float, float) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setBool ( )
setBool(bool) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setChar ( )
setChar(int) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setClean ( )
setClean() -> self

Marks the data that is represented by this handle as being clean.  This should be done after recalculating the data from the inputs.
def OpenMaya.MDataHandle.setDouble ( )
setDouble(float) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setFloat ( )
setFloat(float) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setGenericBool ( )
setGenericBool(bool, force) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setGenericChar ( )
setGenericChar(int, force) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setGenericDouble ( )
setGenericDouble(float, force) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setGenericFloat ( )
setGenericFloat(float, force) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setGenericInt ( )
setGenericInt(int, force) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setGenericShort ( )
setGenericShort(int, force) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setInt ( )
setInt(int) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setMAngle ( )
setMAngle(MAngle) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setMDistance ( )
setMDistance(MDistance) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setMFloatMatrix ( )
setMFloatMatrix(MFloatMatrix) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setMFloatVector ( )
setMFloatVector(MFloatVector) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setMMatrix ( )
setMMatrix(MMatrix) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setMObject ( )
setMObject(MObject) -> self

Set the data that this handle represents in the data block.  This method assumes that the MObject is a dependency graph data object.  These objects can be created using the appropriate MFn..Data function set.
Note that this method cannot be used to copy compound or multi attributes from one handle to another via the construct outputHandle.set (inputHandle.data()).
To copy these user defined attributes, the method MDataHandle.copy() must be used.
def OpenMaya.MDataHandle.setMPxData ( )
setMPxData(MPxData) -> self

Set the data that this handle represents in the data block.  This method takes a pointer to a user defined data object.  The data block will become the new owner of the data object that you pass in.  Do not delete it.
def OpenMaya.MDataHandle.setMTime ( )
setMTime(MTime) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setMVector ( )
setMVector(MVector) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setShort ( )
setShort(int) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.setString ( )
setString(string) -> self

Set the data that this handle represents in the data block.
def OpenMaya.MDataHandle.type ( )
type() -> int

Returns the type of data represented by this handle.
def OpenMaya.MDataHandle.typeId ( )
typeId() -> MTypeId

Returns the type of data represented by this handle as a type id.  A type id is a four character code that is used to identify the data type.
If no data exists for this handle, the type id will be 0x0.