I'm developing a custom mpxnode that has 3 attributes (length, width, fillet) and one output. I want fillet attribute 'maxValue' to be the half of min(length, width) but can't get it to work.
For example:
maxValue
of fillet attribute should be '1.5'
I tried this codes in compute method of MPxNode:
double limit = std::min(length, width) / 2;
MFnNumericAttribute filletAttr(Fillet);
filletAttr.setMax(limit);
MGlobal::executeCommandOnIdle("AEbuildControls;");
but the problem is it changes maxValue
of fillet attribute in all instances of this MPxNode.
Can anyone help?
Unfortunately, there's no way to set the maximum value of an attribute "per instance". The maximum value of the attribute's widget could be updated when the node is replaced. Ex: