Highlighted

Essential Graphics panel "Event listener" ? (ExtendScript)

Explorer ,
Jun 30, 2020

Copy link to clipboard

Copied

Is there a way to have an ExtendScript panel listen for changes made in Essential Graphics? Or maybe with an inbetween step using expressions? That would lead to the question "Is it possible to "feed" ExtendScript panels with values generyted by Expressions" ?

 

E.g:

EG Button is pressed -> ES Panel, waiting for this button event, executes code now

or

EG Button is pressed -> Expression calculates something and gives value to -> ES Panel that executes code that was waiting for this value (e.g. to use in a function)

Most Valuable Participant
Correct answer by Mylenium | Most Valuable Participant

Not really. Way too many limitations. Expressions and scripts don't really interact to begin with, so there's nothing to wait for simply there's no specific event handler for expressions. A script many times doesn't even know a property value unless you convert the information to keyframes or reconstruct the underlying formula/ code natively in the script. Even then the typical procedure in the script is to retrieve those values, do the processing and re-apply the new keyframes or expressions, effectively eradicating what was there before. And then of course there's the thing that Premiere itself has limited script support, anyway, and pretty much none of that would work. If at all, it would be stuck in AE. in any case, this is one of those 99% "No" answers. Whatever you have in mind will require a different approach, so it might be better if you actually explained what you are trying to do.

 

Mylenium

Topics

Expressions, How to, Scripting

Views

85

Likes

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

Essential Graphics panel "Event listener" ? (ExtendScript)

Explorer ,
Jun 30, 2020

Copy link to clipboard

Copied

Is there a way to have an ExtendScript panel listen for changes made in Essential Graphics? Or maybe with an inbetween step using expressions? That would lead to the question "Is it possible to "feed" ExtendScript panels with values generyted by Expressions" ?

 

E.g:

EG Button is pressed -> ES Panel, waiting for this button event, executes code now

or

EG Button is pressed -> Expression calculates something and gives value to -> ES Panel that executes code that was waiting for this value (e.g. to use in a function)

Most Valuable Participant
Correct answer by Mylenium | Most Valuable Participant

Not really. Way too many limitations. Expressions and scripts don't really interact to begin with, so there's nothing to wait for simply there's no specific event handler for expressions. A script many times doesn't even know a property value unless you convert the information to keyframes or reconstruct the underlying formula/ code natively in the script. Even then the typical procedure in the script is to retrieve those values, do the processing and re-apply the new keyframes or expressions, effectively eradicating what was there before. And then of course there's the thing that Premiere itself has limited script support, anyway, and pretty much none of that would work. If at all, it would be stuck in AE. in any case, this is one of those 99% "No" answers. Whatever you have in mind will require a different approach, so it might be better if you actually explained what you are trying to do.

 

Mylenium

Topics

Expressions, How to, Scripting

Views

86

Likes

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
Most Valuable Participant ,
Jun 30, 2020

Copy link to clipboard

Copied

Not really. Way too many limitations. Expressions and scripts don't really interact to begin with, so there's nothing to wait for simply there's no specific event handler for expressions. A script many times doesn't even know a property value unless you convert the information to keyframes or reconstruct the underlying formula/ code natively in the script. Even then the typical procedure in the script is to retrieve those values, do the processing and re-apply the new keyframes or expressions, effectively eradicating what was there before. And then of course there's the thing that Premiere itself has limited script support, anyway, and pretty much none of that would work. If at all, it would be stuck in AE. in any case, this is one of those 99% "No" answers. Whatever you have in mind will require a different approach, so it might be better if you actually explained what you are trying to do.

 

Mylenium

Likes

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
Reply
Loading...
Explorer ,
Jun 30, 2020

Copy link to clipboard

Copied

I was afraid so 😉

 

Regarding your question what I'm doing: I create quite large design toolkits for the creative departement of multiple TV Stations and built my first versions with Essential Graphics and Expressions. Now I'm about to move on to custom ExtendScript Panels, as Essential Graphics does not have enough features for my needs any more (starting with dropdowns and radio buttons, but reaching far deeper than that). I'd hoped I could use both systems side by side for a version or two before switching completely to a custom panel by using some sort of exchange between the panels.

 

Corvin0_0-1593585860002.png

 

Practical example: I move groups of layers in mutliple comps based on user inputs to where some graphics have to be at a given time -> e.g. the "second" graphic in this sequence needs to start at 00:00:07:00, so move it there in all comps that use this graphic. But I also have some dependencies for those graphics that are currently tied to checkboxes in the Essential Graphics Panel -> Start time of the "second" graphic is controlled by ExtendScript User Input, but Type (graphic A or B) of the "first" graphic in the same sequences is tied to a checkbox. And the usage of graphic B triggers an offset to the user input (from the ExtendScript panel) while A does not and so on. But I guess I have to realize the checkbox with a onClick Event in the new panel and calculate the offset from there solely in ExtendScript.

 

Hope it's understandable 😉

Likes

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
Reply
Loading...
Adobe Community Professional ,
Jul 01, 2020

Copy link to clipboard

Copied

As Mylenium said, there is not really a way to listen to changes in the Ae project (or any buttons pressed etc). The best workaround would probably be a kind of "refresh" button in your script UI. Then whenever the user changed something in the essential graphics panel, afterwards he needs to click the refresh button and then the script can check if any properties changed and if so do any adjustments necessary.
For CEP panels you can respond to the event that the CEP panel gets the focus. So if you write a CEP panel, instead of after clicking a refresh button all of this could happen automatically once the user clicks on your panel. But again that is not the same as make it happen as soon as something changes in the Essential Graphics panel.

Likes

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
Reply
Loading...
Corvin0 LATEST
Explorer ,
Jul 01, 2020

Copy link to clipboard

Copied

That would result in a lot of refresh clicks and would not be very user-friendly I'm afraid 😉 But thanks anyway guys for confirming my assumption that its simply not meant to be. I think I'll ditch Essential Graphics completely in the long run and work with my ES panel alone, eliminating the need to listen for elements I cant fully control.

Likes

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
Reply
Loading...