C++ API Reference
MFalloffContext Class Reference

falloff context use in a falloff function to get/set information for weight computation. More...

#include <MFnFalloffData.h>

Public Member Functions

MFloatArray getValues (const MBufferIdentifier &bufferId) const
 Get the weight for the given bufferId. More...
 
void setValue (const MFloatArray &array, const MBufferIdentifier &bufferId)
 copy the value into the buffer addressed by bufferId More...
 
bool isTopologyDirty () const
 Tells if the geometry topology targeted by this falloff has changed sinced last time it evaluated. More...
 
bool isSync (int syncId, const MBufferIdentifier &bufferId) const
 isSync is used to quickly bail out of a fallout function, if it is in sync and additional requirement (no topology change) are met then we can return bufferId as Cached. More...
 
void sync (int syncId, const MBufferIdentifier &bufferId)
 Synchronize the target buffer with a user supplied id. More...
 
MObject getGeometry (bool originalGeometry=false)
 returns the working indexMapper. More...
 
MIndexMapper getIndexMapper () const
 returns the working indexMapper. More...
 
 ~MFalloffContext ()
 MFalloffContext destructor.
 

Detailed Description

falloff context use in a falloff function to get/set information for weight computation.

An MFalloffContext is provided to a MFalloffFunction::operator() that user override to create its own weight falloff.

Examples:
exampleFalloff/smoothFalloffNode.cpp.

Member Function Documentation

MFloatArray getValues ( const MBufferIdentifier bufferId) const

Get the weight for the given bufferId.

Parameters
[in]bufferIdtells wich buffer to return.
Returns
weight data designed by the bufferId
Examples:
exampleFalloff/smoothFalloffNode.cpp.
void setValue ( const MFloatArray array,
const MBufferIdentifier bufferId 
)

copy the value into the buffer addressed by bufferId

Parameters
[in]arrayrepresent the array of weight to be copied into the buffer
[in]bufferIdtells wich buffer to copy the data on.
Examples:
exampleFalloff/smoothFalloffNode.cpp.
bool isTopologyDirty ( ) const

Tells if the geometry topology targeted by this falloff has changed sinced last time it evaluated.

Returns
true if topology has changed.
Examples:
exampleFalloff/smoothFalloffNode.cpp.
bool isSync ( int  syncId,
const MBufferIdentifier bufferId 
) const

isSync is used to quickly bail out of a fallout function, if it is in sync and additional requirement (no topology change) are met then we can return bufferId as Cached.

Returns
true is bufferId syncId is the samke as supplied syncId
Examples:
exampleFalloff/smoothFalloffNode.cpp.
void sync ( int  syncId,
const MBufferIdentifier bufferId 
)

Synchronize the target buffer with a user supplied id.

This enable user to check if buffer match the syncId stored on an attribute on the compute object that holdthe falloff data function. This allow to avoid useless computation when the falloff ask to recompute an already computed weight.

Parameters
[in]syncIdis provided by the implementor of the falloff function and it track the dirtyness of the buffer based on its input dirtyness. Basically every time a computation of the falloff is trigger this id should change since the weight buffer would potentially change.
[in]bufferIdwhich buffer to synchronized.
Examples:
exampleFalloff/smoothFalloffNode.cpp.
MObject getGeometry ( bool  originalGeometry = false)

returns the working indexMapper.

Falloff can be reused for different deformer. The context tells us the information that we need concerning the geometry that we are working on at the moment of the call.

Returns
Indexmapper for the geometry that this falloff operates on.
Examples:
exampleFalloff/smoothFalloffNode.cpp.
MIndexMapper getIndexMapper ( ) const

returns the working indexMapper.

Falloff can be reused for different deformer. The context tells us the information that we need concerning the geometry that we are working on at the moment of the call.

Returns
Indexmapper for the geometry that this falloff operates on.
Examples:
exampleFalloff/smoothFalloffNode.cpp.

The documentation for this class was generated from the following files: