FORUMS: list search recent posts

Is there a way to update a ScriptUI panel when a layer is selected?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Reuben Lara
Is there a way to update a ScriptUI panel when a layer is selected?
on Aug 26, 2019 at 1:00:31 am

I'd like for my ScriptUI panel to automatically retrieve information about a layer every time a layer is selected in the timeline panel. Is there a way to do this without having to focus the ScriptUI panel or clicking a ScriptUI button?


Return to posts index

Tomas Bumbulevičius
Re: Is there a way to update a ScriptUI panel when a layer is selected?
on Aug 26, 2019 at 1:22:49 pm

Hey Reuben, what information in particular you are interested to populate? Also, is it only for single-layer selections?

Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer - Dynamic Text Boxes Template with a Live Preview


Return to posts index

Reuben Lara
Re: Is there a way to update a ScriptUI panel when a layer is selected?
on Aug 26, 2019 at 4:30:00 pm

Thanks for responding Tomas! I have a working ScriptUI button that runs a function that acts on one selected comp layer only. (When clicked, it queries weather or not a layer is selected, then queries weather or not it is a comp layer, and then either executes or throws an alert indicating that only one comp layer must be selected.)

Assuming all the conditions are met, it currently opens a new panel window and lists out information about that comp. In my particular script, a listbox is populated with all the timeline comp markers that exist inside that comp. I'm able to select one and then do something with that information.

Right now, the interaction is:
1. Select a comp layer
2. Go to my ScriptUI panel
3. Click a button
4. New panel window pops up with information unique to that comp
5. Select some information
6. Click OK (and the feature is implemented)

I'd like to streamline the process to:
1. Select a comp layer
2. Desired comp information automatically loads into a persistent list-box in my ScriptUI panel
3. A button on the ScriptUI panel executes the option.

Because the workflow requires this interaction so many times, i'd like eliminate the pop up panel and just load information on the fly right to the ScriptUI panel. I realize that this function will run every time a layer is selected, but the function is light and I don't think it will create a huge overhead on the system. I'm just not sure if a ScriptUI panel can have a listener for clicks that are happening in another panel when it itself is not in focus.

If this doesn't make sense I can do a quick screen recording. Thanks so much!


Return to posts index


Tomas Bumbulevičius
Re: Is there a way to update a ScriptUI panel when a layer is selected?
on Aug 27, 2019 at 9:42:25 am

Thanks for a breakdown! I am pretty sure it should be possible, because 'INFO' panel works in exactly the same way, by populating info when selected layer(s). (unless its done under programming level)

Well, anyways, INFO panel populates details by write(). Your eventListener most likely needs to look for changedComp, to be prepared to showcase the data.

I will make some tests, unless others jumps in faster!

Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer - Dynamic Text Boxes Template with a Live Preview


Return to posts index

Reuben Lara
Re: Is there a way to update a ScriptUI panel when a layer is selected?
on Aug 27, 2019 at 2:51:02 pm

Thanks for the tip on using write() and changedComp. I did not know about those functions. I'll start some testing on my end as well. Thanks!


Return to posts index

Tomas Bumbulevičius
Re: Is there a way to update a ScriptUI panel when a layer is selected?
on Aug 30, 2019 at 7:24:49 am

Hey Reuben, sorry for my later turn here. Not sure whether you managed to achieve what you needed, but here is some information I found:
https://forums.adobe.com/thread/1483664

Accordingly, since its most likely not possible in an easy way with plain GUI, if you have not much info to showcase, then just use 'write()' into 'Info' panel directly.

Cheers!

Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer - Dynamic Text Boxes Template with a Live Preview


Return to posts index


Reuben Lara
Re: Is there a way to update a ScriptUI panel when a layer is selected?
on Aug 30, 2019 at 2:55:32 pm

Thanks for getting back to me. Last night I came to the same conclusion but I appreciate the link that confirms it.

What I ended up doing is implementing a "mouseover" and "mouseout" function on the panel itself that automatically updates information on the selected layer, at the very least, when you navigate the mouse over the panel. When you leave the panel or have nothing selected, some conditional messaging helps the user remember that information will refresh when the mouse hovers over the panel again.

Would be nice to have some system wide event listeners but I realize that could open up a can of worms for normal functionality if not used responsibly.

Thanks for taking the time!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]