That is, disable plug reuse until we figure something better out. Stable > Fast.
The problem being that we're caching plugs by name. But when attributes are removed and re-added, the name is the same but attribute is different. So when we read and connect, we're doing that against an out-of-date attribute. Ideally we'd store a hash or id() of the attribute instead. But how can we know whether the plug we have is "valid"? The MObject has a isValid() so we can check and see whether the handle we've got is usable. MPlug has isNull which doesn't tell you whether the plug is valid or not. What else is there?
That is, disable plug reuse until we figure something better out. Stable > Fast.
The problem being that we're caching plugs by name. But when attributes are removed and re-added, the name is the same but attribute is different. So when we read and connect, we're doing that against an out-of-date attribute. Ideally we'd store a hash or
id()
of the attribute instead. But how can we know whether the plug we have is "valid"? The MObject has aisValid()
so we can check and see whether the handle we've got is usable. MPlug hasisNull
which doesn't tell you whether the plug is valid or not. What else is there?