Building upon footPrintNode_Geometry_Override for a plugin - Parallel Evaluation/setDependentsDirty/Compound Attribute issues and errors. Any better examples available?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
As background, I'm writing a plugin that instances assets along a curve in a highly specific way, but I am struggling with the footPrintNode_Geometry_Override example and its very specific behaviors - particularly compound attributes. Right now, I have just been focusing on getting the attributes working as expected.
For my curve deformer, I will be having a series of MfNPointOnCurve manipulators that will have their attributes tied into a compound attribute called 'inputTwistControl' in my code.
Building upon the footPrintNode_Geometry_Override example, for one of my attributes, I have 'inputTwistControl' as a compound attribute with two children 'twist' and 'parameter'. In my compute method, I process these and output them as two MDoubleArrays - outputTwistParameter and outputTwistAngle.
However the code does not evaluate the compound attribute changing at all unless I use the setDependentsDirty method where in a very hackish manner to search for a substring that matches the compound attribute
e.g.
if (plug.partialName().substring(0,9) == "inputTwist")
It won't evaluate at all without this - and the bad news is that with this it seems to trigger compute an inordinate amount of times with this because of each compound child, when I really want it to only trigger once in compute when the compound attribute is change.
My grievance is that footPrintNode_Geometry_Override seems to be the only recent example that is available for VP2.0, parallel and the evaluation manager, and when it has things like 'Technique 1: Hack the EM to force evaluate and cache attributes. in the source ' its not exactly inspiring confidence in the available examples 🙂
I've attached the code in the hope that I can learn what I'm doing wrong.