Message 1 of 3
dirtyPlugExists always true?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm writing some custom nodes using the API and I can't figure out how to detect if an attribute has actually changed:
my node have input (integer) attributes in_a, in_b and outputs out_c.
both inputs are needed for calculation of c, but I want to perform additional calculation when b changed.
basically I have this
MStatus mynode::preEvaluation(const MDGContext& context, const MEvaluationNode& evaluationNode) { ... if( (evaluationNode.dirtyPlugExists(in_a, &status) && status) || (evaluationNode.dirtyPlugExists(in_b, &status) && status)) { needRefresh = true; } if(evaluationNode.dirtyPlugExists(in_b, &status) && status) { mustperformadditionalstuff = true; } return MStatus::kSuccess; }
basically it works fine, except that when I have some keyframes on b, this function
evaluationNode.dirtyPlugExists(in_b, &status)
always returns true, on every single frame.
It's not expected since on most frames the value doesn't change. but now my boolean is always set to true;
Am I missing something about the way we can track if an input plug is dirty?
thanks