theodox / mGui

Python module for cleaner maya GUI layout syntax
MIT License
123 stars 23 forks source link

OpenMaya.MSceneMessage support #70

Closed bob-white closed 7 years ago

bob-white commented 7 years ago

This is a pretty simple wrapper in the spirit of the mGui.scriptJobs module, that wraps the various messages provided by OpenMaya.MSceneMessage.

Basically I needed finer grained access to the opened / saved events than scriptJobs provided.

These provide a runOnce and parent flag to more closely mimic the API found in mGui.scriptJobs. These events do have one difference from standard mGui.events.Event and that is that they pass a weakref.Proxy of the event to any handlers instead of a strong reference. I needed to break the circular reference here so that the __del__ method could be better relied on to help with cleanup.

theodox commented 7 years ago

hey bob, what's the status of this one? Do I remember you saying you'd dropped it on the slack a while back? Or am I imagining that?

bob-white commented 7 years ago

Haven't dropped it yet. I like it better than the old method I was using which relied on some semi-singleton event wrappers. But I'm worried I haven't caught all the edge cases for deterministic cleanup.

bob-white commented 7 years ago

Yeah, I'm going to drop this one for now. To many instances of the callback hanging around when it shouldn't have during testing.