I have a lot of subroutines that create and manipulate art that work reliably when called by a button or menu item, but when this chain of subroutines is called by a system event (updating a PluginGroup's result art), things get complicated. It's my understanding that we then need to call PushAppContext and PopAppContext.
Is it sufficient to call them only in the event callback, or does Push/PopAppContext need to be called in every subroutine in the chain?
If those subroutines are called when invoked by the user, is it a problem if Push/PopAppContext is called when not necessary?
The most common problem I'm having is that when art objects are reordered during a plugin group update, they are sometimes corrupted and have an art type of Unknown. Push/PopAppContext hasn't helped, so I wonder if I'm using it too much or not everywhere it's necessary. Any suggestions would be very much appreciated.