class MArrayDataBuilder

Jump to documentation

Array builder for arrays in data blocks. (OpenMaya) (OpenMaya.py)

public members:

MArrayDataBuilder ( const MObject & attribute, unsigned int numElements, MStatus * ReturnStatus = NULL )
Obsolete ...
MArrayDataBuilder ( MDataBlock *, const MObject &attribute, unsigned int, MStatus * ReturnStatus = NULL )
MDataHandle addLast ( MStatus * ReturnStatus = NULL)
MDataHandle addElement ( unsigned int index, MStatus * ReturnStatus = NULL )
MArrayDataHandle addLastArray ( MStatus * ReturnStatus = NULL )
MArrayDataHandle addElementArray ( unsigned int index, MStatus * ReturnStatus = NULL )
MStatus removeElement ( unsigned int index )
unsigned int elementCount ( MStatus * ReturnStatus = NULL ) const
MStatus growArray ( unsigned int amount )
MStatus setGrowSize ( unsigned int size )
MArrayDataBuilder ( const MArrayDataBuilder &other )
MArrayDataBuilder & operator= ( const MArrayDataBuilder & other )
~MArrayDataBuilder ()

Documentation

An MArrayDataBuilder is used to build array data for attributes/plugs that support arrays.
Description

An MArrayDataBuilder is used to construct data for attributes/plugs that have an array of data. An array builder is used with an MArrayDataHandle for managing data.

Functions

MArrayDataBuilder:: MArrayDataBuilder ( const MObject & attribute, unsigned int numElements, MStatus * ReturnStatus )

Description

Obsolete.

MArrayDataBuilder:: MArrayDataBuilder ( MDataBlock * block, const MObject & attribute, unsigned int numElements, MStatus * ReturnStatus )

Description

The class constructor receives an attribute object and the number of elements to allocate space for. The MObject must be a multi attribute (i.e. a plug that is a composite of multiple element plugs). This is different, for example, from a single attribute of type kVectorArrayData, which would be passed through a single plug as a single lump of data. Common examples of a multi-plug are the worldMatrix attribute that is on all DAG nodes, or the position attribute on the particleShape node.

This class will also take as input the datablock that the builder belongs to. You must specify this datablock if you want your builder to support per-plug caching.

Arguments

  • datablock the data block that the builder belongs to.
  • attribute attribute for which we wish to build data
  • numElements number of elements to allocate space for
  • ReturnStatus result status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter object argument is invalid
  • MS::kFailure attribute pointer is NULL

MArrayDataBuilder:: ~MArrayDataBuilder ()

Description

Class destructor.

MDataHandle MArrayDataBuilder:: addLast ( MStatus *ReturnStatus)

Description

Adds a new element to the end of the array. The index of the element will be the current highest index + 1.

Arguments

  • ReturnStatus result status code

Return Value

  • the handle for the new element

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure the object is invalid

MDataHandle MArrayDataBuilder:: addElement ( unsigned int index, MStatus * ReturnStatus )

Description

Adds a new element to the array at the given index.

Arguments

  • index the index at which we wish to add the new element
  • ReturnStatus result status code

Return Value

  • the handle for the new element

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure the object is invalid

MArrayDataHandle MArrayDataBuilder:: addLastArray ( MStatus *ReturnStatus)

Description

Adds a new element to the end of the array. The added element is also an array. The index of the element will the current highest index + 1.

Arguments

  • ReturnStatus result status code

Return Value

  • the handle for the new array element

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure the object is invalid

MArrayDataHandle MArrayDataBuilder:: addElementArray ( unsigned int index, MStatus *ReturnStatus )

Description

Adds a new element to the array at the given index. The added element is also an array.

Arguments

  • index the index at which we wish to add the new element
  • ReturnStatus result status code

Return Value

  • the handle for the new array element

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure the object is invalid

MStatus MArrayDataBuilder:: removeElement ( unsigned int index )

Description

Removes the specified element from the array

Arguments

  • index the element of the array to remove

Return value

  • Result status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure the object is invalid or remove the remove failed.

unsigned int MArrayDataBuilder:: elementCount ( MStatus * ReturnStatus) const

Description

Returns the number of elements in the array

Arguments

  • ReturnStatus result status code

Return value

  • the number of elements

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure the object is invalid

MStatus MArrayDataBuilder:: growArray ( unsigned int amount )

Description

Grows the array storage by the given amount.

Arguments

  • amount the amount to grow the array by

Return value

  • Result status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure the object is invalid

MStatus MArrayDataBuilder:: setGrowSize ( unsigned int size )

Description

Sets the grow size of the array. As elements are added to the array, the builder will allocate memory in chunks. This method tells the builder how many elements to allocate each time it grows the array.

Arguments

  • amount the number of elements to allocate when growing the array

Return value

Result status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure the object is invalid

MArrayDataBuilder:: MArrayDataBuilder ( const MArrayDataBuilder & other )

Description

Copy constructor.

Arguments

  • other The source object to copy from.

MArrayDataBuilder & MArrayDataBuilder:: operator= ( const MArrayDataBuilder & other )

Description

Assignment operator.

Arguments

  • other The source object to copy from.

This class has no child classes.


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