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

Panel Notification when Sequence Selection Changes?

Enthusiast ,
May 04, 2017 May 04, 2017

Copy link to clipboard

Copied

We would like to add some functionality to our extension panel that allows it to reflect the selection state of the TrackItems in the active sequence. While CSInterface has a CSEvent definition, I found this old discussion which seems to indicate that CSEvents have no effect in Premiere. Is there a different way to register for such events?

Or is the only option a polling one (whether the polling be done on the ExtendScript [APP] side or the JavaScript [HTML] side)?

TOPICS
SDK

Views

1.1K

Translate

Translate

Report

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

correct answers 1 Correct answer

Adobe Employee , May 05, 2017 May 05, 2017

Because of where CEP panels fit into PPro, that sort of messaging wasn't part of the initial plans.

Our API grows in direct response to user and developer requests.

You're not the first to request such messaging; I've added your vote.

I was cleaving to a general "polling == BAD" heuristic; if one panel is doing it, you'll get by. But what if 10 panels were polling?

Votes

Translate

Translate
Adobe Employee ,
May 05, 2017 May 05, 2017

Copy link to clipboard

Copied

There are no such events, for which to register.

When your panel is in charge, you can get/set the selection in the timeline; but the user would have to do something with your panel to get it involved.

Please, never poll; for now, a 'notice current selection' button in your panel remains the recommended approach.

Votes

Translate

Translate

Report

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
Enthusiast ,
May 05, 2017 May 05, 2017

Copy link to clipboard

Copied

Bruce Bullis​, is there a technical reason to not provide such an API or approach? Without that kind of API available, it seems nigh-impossible to create extensions that feel like "first-class citizens" in Adobe Premiere...

With respect to polling, would adding a timeout help or is there something deeper here that you're suggesting we avoid performance-wise?

Votes

Translate

Translate

Report

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 Employee ,
May 05, 2017 May 05, 2017

Copy link to clipboard

Copied

Because of where CEP panels fit into PPro, that sort of messaging wasn't part of the initial plans.

Our API grows in direct response to user and developer requests.

You're not the first to request such messaging; I've added your vote.

I was cleaving to a general "polling == BAD" heuristic; if one panel is doing it, you'll get by. But what if 10 panels were polling?

Votes

Translate

Translate

Report

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
Enthusiast ,
May 05, 2017 May 05, 2017

Copy link to clipboard

Copied

Bruce Bullis wrote

Because of where CEP panels fit into PPro, that sort of messaging wasn't part of the initial plans.

Our API grows in direct response to user and developer requests.

You're not the first to request such messaging; I've added your vote.

That makes sense. Thanks for adding my vote onto the pile! Fingers crossed support for this type of Panel↔Application interaction support will come soon!

Bruce Bullis wrote

I was cleaving to a general "polling == BAD" heuristic; if one panel is doing it, you'll get by. But what if 10 panels were polling?

Gotcha. We may look into polling at a low frequency if we can't figure out a different way to serve the user. As a worst-case fallback, perhaps we could update the panel by responding to the "onfocus" event. Still not necessarily ideal, as the user would need to keep switching focus to get the panel content to reflect changes.

Votes

Translate

Translate

Report

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 Employee ,
May 07, 2017 May 07, 2017

Copy link to clipboard

Copied

That's another argument against polling; rather than trying to gather information upon a focus change, your panel becomes much more predictable, once users learn to rely on your 'Update' button...

Votes

Translate

Translate

Report

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
Enthusiast ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

Bruce Bullis wrote

That's another argument against polling; rather than trying to gather information upon a focus change, your panel becomes much more predictable, once users learn to rely on your 'Update' button...

Wait, what? How is that another argument against polling? Polling would, with some slight delay, perhaps, automatically keep things in sync. Let's say a user has an Extension Panel with some extra meta-information about the Timeline. They find the information useful as they edit. They undock the window and put it in a second monitor (or keep it visible in a panel next to the main Timeline one). Now imagine the workflow they have to endure if they want to make use of that information as they edit:

  1. Adjust in the timeline.
  2. Click the Update button in the panel.
  3. Adjust in the timeline.
  4. Click the Update button in the panel.
  5. Adjust in the timeline.

OnFocus would potentially be better but I think I may have gleaned some of your concern: it is possible to adjust in the timeline using Shortcut Keys while the Extension still has focus! (Please correct me here if I'm wrong.) In this case, the user would have to switch back-and-forth between the timeline and extension panel to trigger the update (also not good). An update button or Keyboard Keys that have "Registered Interest" would be better. This still results, however, an incredibly painful workflow.

Votes

Translate

Translate

Report

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 Employee ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

> Wait, what? How is that another argument against polling?

Because if you let the user tell the panel when they want the panel to do something, you don't waste everybody's CPU cycles getting updates the users doesn't care if your panel gets or not.

I see why you'd want to register interest, instead of relying on the user to make your panel aware of that change.

Update buttons remain the best approach to making panels aware of changes made in PPro.

Votes

Translate

Translate

Report

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
Enthusiast ,
Jan 10, 2018 Jan 10, 2018

Copy link to clipboard

Copied

LATEST

As a quick update to this thread, a hacky workaround to a polling approach would be to use the window.onfocus and window.onblur events to time the updates to the panel UI. Code to use these might look like this (in index.html, for instance):

<script>

    window.onfocus = () => {console.log("FOCUSED!");};

    window.onblur = () => {console.log("BLURRED!");};

</script>

The idea is that in your onblur() handler, you might put up a UI message that says "click this window to see an update". Then when the window regains focus, you immediately query the PPro ExtendScript APIs to get an updated picture of the current project state in your onfocus() handler.

Admittedly, this approach does not give you the desired "real time" experience, but it may be a viable compromise for some who don't need the real-time updates.

Votes

Translate

Translate

Report

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