How to disable/enable attribute in the Attribute Editor

Hello,

I’m writing a node and based on some attribute values, I want other attributes to be enabled or disabled, this behaviour can be seen on the aimConstraint node; by default worldUpType is set to 3 (Vector) and the worldUpObject attribute is disabled (no options are displayed when we right-click on it) and when worldUpType is set to, for example, 1 (Object Up) the worldUpVector attribute is disabled and the worldUpObject attribute is enabled

I’ve looked the the documentation for MFnAttribute but I can’t find a method which would give me that behaviour, does someone know the name of the class and method which defines it?

Thanks,
-Harry

I’m guessing that the attribute editor template for the aim node is what handles that, and not the node itself. There’s no reason to disable an input at the node level. You just don’t read from that input, and it won’t get evaluated.

Thanks, the dimControl flag of the editorTemplate command is what’s responsible for enabling/disabling the attribute, I’ll see if I can implement it in my node

Thanks again,
-Harry