Skip to main content
Legend
October 9, 2023
Answered

Best practice to spawn window with text input UI from effects parameters?

  • October 9, 2023
  • 1 reply
  • 1488 views

Hi There!

 

I'm writing this post to seek out some guidance and "best practices" for implementing a specific type of parameter in my effect.

 

In many third-part effects, I've seen buttons along with the list of configurable paramters that spawn a modal window that allows users to enter in text and then somehow store that text with the layer.  

 

I'm sure there are many ways to accomplish this, but wondered if any of you have knowledge about a relatively simple way of doing this.  

 

Does it require linking to a C++ library or framework that allows for the creation of custom UI elements?  Or, does Adobe's AE SDK have methods for generating this from the C++?

 

Is it better to just have the button perform some kind of ExtendScript that launches a dialog?

 

Thanks for your time!

—Arie

This topic has been closed for replies.
Correct answer shachar carmi

technically, the clickable "thing", the launching of the prompt and the storing of the string are separate things and don't have to be parts of the same param. you can have a button param launch the prompt, and store the string in an arb. that arb can very well be hidden.

i opted for having it all on the arb. i made a custom UI that both shows the current string AND is clickable.

here's an example from one of my plugins:

 

1 reply

Community Expert
October 10, 2023

Hi Arie! how are you? 🙂

there are 2 separate issues here:

1. getting the user input.

2. storing the data in the effect instance.

 

getting the data can be VERY easy. i used javascript for that. using AEGP_ExecuteScript i launched a pormpt. it takes text input from the user, and by checking the returned value you can tell if the user hit "ok" or "cancel".

easy peasy.

if you want to go fnacier, you can use OS level windows. takes some chweing thorugh on both OSes, but no 3rd party library needed.

 

as for storing the data in the effect, you can either use sequence data, or an arb param. i went the arb route, as it allows the user to undo/redo the operation.

 

for final touches, i also added a custom UI to the arb paramthat shows the current text value. if you with to avoid that, a simple button to trigger the window would do the trick.

Legend
October 10, 2023

Shachar, many thanks for your reply, I appreciate it very much — especially with what's going on on your part of the world.  I should be asking you how you are doing!  I will follow up via email, soon.

 

I think I'm going to go with your suggestions regarding the AEGP_ExecuteScript as that is the easiest in terms of cross-OS compatibility.  I'm not prepared to chew through docs for handling custom GUI's for both UIs.  I just need a text string to be stored with the layer, nothing else.

 

If I go with the arbitrary parameter route, does that have a display in the list of parameters?  If it does display, should I just hide its visibility from the user?

 

Also, I guess I'm not clear: does the arbitrary parameter have the button that effectively executes the AEGP_ExecuteScript resource string?  In other words, is everything handled with the arb param?  Both the text string capture, store, and recall (read)?

 

Do you have a screenshot of the custom UI you build to dipsy the current text value?

 

Many thanks for your guidance, as always it's a huge help!

 

—Arie

shachar carmiCommunity ExpertCorrect answer
Community Expert
October 10, 2023

technically, the clickable "thing", the launching of the prompt and the storing of the string are separate things and don't have to be parts of the same param. you can have a button param launch the prompt, and store the string in an arb. that arb can very well be hidden.

i opted for having it all on the arb. i made a custom UI that both shows the current string AND is clickable.

here's an example from one of my plugins: