mottosso / cmdx

Fast and persistent subset of maya.cmds
https://mottosso.com/cmdx
BSD 2-Clause "Simplified" License
193 stars 36 forks source link

Fix #47 #48

Closed mottosso closed 3 years ago

mottosso commented 3 years ago

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?