C++ API Reference
MNodeCacheDisablingInfoHelper Class Reference

Provides helpers for MNodeCacheDisablingInfo. More...

#include <MNodeCacheDisablingInfoHelper.h>

Public Types

enum  ConnectionTestFlag {
  kTestDirtyPlug, kTestHierarchy, kTestPlug, kLastConnectionTest,
  kTestDefaultValue = kTestDirtyPlug
}
 Defines the connection test that can be done on animated attributes. More...
 

Static Public Member Functions

static void setUnsafeNode (MNodeCacheDisablingInfo &disablingInfo, const MEvaluationNode &node, const MString *nodeCategory=NULL)
 Helper to set the reason and mitigation for an unsafe node. More...
 
static void setUnsafeValue (MNodeCacheDisablingInfo &disablingInfo, const MEvaluationNode &node, const MObject &attribute, const MString &attributeValue, const MString &supportedValue, const MString *nodeCategory=NULL)
 Helper to set the reason and mitigation for an unsafe value on a node's attribute. More...
 
static bool testAnimatedAttribute (MNodeCacheDisablingInfo *disablingInfo, MObjectArray &monitoredAttributes, const MEvaluationNode &node, const MPlug &plug, ConnectionTestFlag connectionTest=kTestDefaultValue, const MString *nodeCategory=NULL, MStatus *ReturnStatus=NULL)
 Helper to set the reason and mitigation on a node with a conditionally supported attribute if it is animated. More...
 
static bool testBooleanAttribute (MNodeCacheDisablingInfo *disablingInfo, MObjectArray &monitoredAttributes, const MEvaluationNode &node, const MObject &attribute, bool supportedValue, ConnectionTestFlag connectionTest=kTestDefaultValue, const MString *nodeCategory=NULL, MStatus *ReturnStatus=NULL)
 Helper to set the reason and mitigation on a node with a conditionally supported boolean attribute. More...
 
static bool testEnumAttribute (MNodeCacheDisablingInfo *disablingInfo, MObjectArray &monitoredAttributes, const MEvaluationNode &node, const MObject &attribute, const short supportedValues[], int supportedValuesCount, ConnectionTestFlag connectionTest=kTestDefaultValue, const MString *nodeCategory=NULL, MStatus *ReturnStatus=NULL)
 Helper to set the reason and mitigation on a node with a conditionally supported enum attribute. More...
 

Detailed Description

Provides helpers for MNodeCacheDisablingInfo.

Member Enumeration Documentation

Defines the connection test that can be done on animated attributes.

Enumerator
kTestDirtyPlug 

Do not perform an additional test; the attribute is considered animated if part of the dirty plug list.

kTestHierarchy 

Test whether the plug or any of its parents has a connection; if they don't the attribute is not considered animated.

kTestPlug 

Test whether the plug has a connection; if it doesn't the attribute is not considered animated.

kLastConnectionTest 

Last value, used for counting.

kTestDefaultValue 

Value used by default for the tests.

Member Function Documentation

void setUnsafeNode ( MNodeCacheDisablingInfo disablingInfo,
const MEvaluationNode node,
const MString nodeCategory = NULL 
)
static

Helper to set the reason and mitigation for an unsafe node.

This method is a helper for derived clases implementing getCacheSetup().

It sets up a proper message and mitigation for an unsupported node.

Parameters
[out]disablingInfoThe disabling info to set.
[in]nodeThe evaluation node associated with the unsupported node.
[in]nodeCategoryA group name to use in the reported messages, or a null pointer or an empty string to only use the node name.
void setUnsafeValue ( MNodeCacheDisablingInfo disablingInfo,
const MEvaluationNode node,
const MObject attribute,
const MString attributeValue,
const MString supportedValue,
const MString nodeCategory = NULL 
)
static

Helper to set the reason and mitigation for an unsafe value on a node's attribute.

This method is a helper for derived clases implementing getCacheSetup().

It sets up a proper message and mitigation for an unsupported value for an attribute on a node.

Parameters
[out]disablingInfoThe disabling info to set.
[in]nodeThe evaluation node associated with the unsupported node.
[in]attributeThe unsafe attribute.
[in]attributeValueA string describing the current value of the attribute.
[in]supportedValueA string describing the supported value of the attribute.
[in]nodeCategoryA group name to use in the reported messages, or a null pointer or an empty string to only use the node name.
bool testAnimatedAttribute ( MNodeCacheDisablingInfo disablingInfo,
MObjectArray monitoredAttributes,
const MEvaluationNode node,
const MPlug plug,
ConnectionTestFlag  connectionTest = kTestDefaultValue,
const MString nodeCategory = NULL,
MStatus ReturnStatus = NULL 
)
static

Helper to set the reason and mitigation on a node with a conditionally supported attribute if it is animated.

This method is a helper for derived classes implementing getCacheSetup().

It is meant for attributes that can have a value that would prevent Cached Playback support. It checks that an attribute is animated, and therefore could take the wrong value. If the attribute is animated, it will populate the disabling info with the proper data. Otherwise, it will be added to the list of attributes to monitor.

An additional test can be performed to determine whether or not an attribute is animated. By default, the only test being performed is whether or not the attribute is part of the dirty plugs list. However, in a situation where the attribute is part of a compound structure, it might be useful to perform additional tests. For instance, if a sibling of the target attribute is animated, the whole compound, including the target attribute, will be considered animated as part of the dirty plugs list. A more thorough test can be performed to determine if the attribute, or any of its parents, is the destination of a connection. Depending on the connection setup, this might be enough to known that the attribute is not animated. The connectionTest parameter controls what extra test can be performed. By default, no extra test is performed and the animated status is determined from the dirty plugs list.

Note that if the attribute is animated, it will not be added to the list of attributes to monitor, since its value is expected to change over time without user manipulation.

Note that this method cannot be used on attributes in a complex hierarchy, such as multi attributes or children of multi attributes.

Parameters
[out]disablingInfoThe disabling info to set, or nullptr to discard reason and mitigation messages.
[out]monitoredAttributesAttributes that influences if caching is supported.
[in]nodeEvaluation node associated with the node being tested.
[in]plugPlug to the attribute to be tested.
[in]connectionTestAn additional test to perform to determine if the attribute is animated.
[in]nodeCategoryA group name to use in the reported messages, or a null pointer or an empty string to only use the node name.
[out]ReturnStatusStatus code.
Returns
True if the attribute is animated, false otherwise.
Status Codes:
  • MS::kSuccess Operation successful
  • MS::kInvalidParameter Attribute is null or part of a complex hierarchy
bool testBooleanAttribute ( MNodeCacheDisablingInfo disablingInfo,
MObjectArray monitoredAttributes,
const MEvaluationNode node,
const MObject attribute,
bool  supportedValue,
ConnectionTestFlag  connectionTest = kTestDefaultValue,
const MString nodeCategory = NULL,
MStatus ReturnStatus = NULL 
)
static

Helper to set the reason and mitigation on a node with a conditionally supported boolean attribute.

This method is a helper for derived classes implementing getCacheSetup().

It checks whether the attribute on a node is not animated and has the right supported value.

Note that this method calls testAnimatedAttribute() so it has the same requirements.

Note that this method works only for boolean attributes, and should not be called with a disabling info object that is already disabled.

Parameters
[out]disablingInfoThe disabling info to set, or nullptr to discard reason and mitigation messages.
[out]monitoredAttributesAttributes that influences if caching is supported.
[in]nodeEvaluation node associated with the node being tested.
[in]attributeAttribute to be tested.
[in]supportedValueValue needed for Cached Playback to be supported.
[in]connectionTestAn additional test to perform to determine if the attribute is animated.
[in]nodeCategoryA group name to use in the reported messages, or a null pointer or an empty string to only use the node name.
[out]ReturnStatusStatus code.
Returns
True if the attribute is animated or not the supported value, false otherwise.
Status Codes:
  • MS::kSuccess Operation successful
  • MS::kInvalidParameter Attribute is null or part of a complex hierarchy
Examples:
simpleSimulationNode/simpleSimulationNode.cpp.
bool testEnumAttribute ( MNodeCacheDisablingInfo disablingInfo,
MObjectArray monitoredAttributes,
const MEvaluationNode node,
const MObject attribute,
const short  supportedValues[],
int  supportedValuesCount,
ConnectionTestFlag  connectionTest = kTestDefaultValue,
const MString nodeCategory = NULL,
MStatus ReturnStatus = NULL 
)
static

Helper to set the reason and mitigation on a node with a conditionally supported enum attribute.

This method is a helper for derived classes implementing getCacheSetup().

NO SCRIPT SUPPORT

It checks whether the attribute on a node is not animated and has the right supported value.

Note that this method calls testAnimatedAttribute() so it has the same requirements.

Note that this method works only for enum attributes, and should not be called with a disabling info object that is already disabled.

Parameters
[out]disablingInfoThe disabling info to set, or nullptr to discard reason and mitigation messages.
[out]monitoredAttributesAttributes that influences if caching is supported.
[in]nodeEvaluation node associated with the node being tested.
[in]attributeAttribute to be tested.
[in]supportedValuesValues needed for Cached Playback to be supported.
[in]supportedValuesCountNumber of values in supportedValues.
[in]connectionTestAn additional test to perform to determine if the attribute is animated.
[in]nodeCategoryA group name to use in the reported messages, or a null pointer or an empty string to only use the node name.
[out]ReturnStatusStatus code.
Returns
True if the attribute is animated or not the supported value, false otherwise.
Status Codes:
  • MS::kSuccess Operation successful
  • MS::kInvalidParameter Attribute is null or part of a complex hierarchy

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