Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Can it cause problems to call Push/PopAppContext too often?

Engaged ,
Jan 24, 2024 Jan 24, 2024

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.

TOPICS
SDK
98
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Engaged ,
Feb 01, 2024 Feb 01, 2024
LATEST

Please correct me if I'm wrong, but since nobody has responded I'll present my best guess on this.

 

It seems to me that one push/pop context per event should be enough, bookending the callback for the message or notifier.

 

I've been working with arrays (or more recently vectors) of AIArtHandles since I started writing AI plugins in the late 1980s (really). It hasn't been a problem until a plugin that recently does a lot of complex drawing when its art is moved or redrawn. I switched to using AISafeArtHandles in most cases, and it's made a big difference. Most of the glitches happen when reordering art, and about 80% of those mishaps are now eliminated due to AISafeArtHandles rather than AIArtHandles.

 

With luck, I'll make another discovery soon to report here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines