Activity › Forums › Adobe After Effects Expressions › Creating a Dropdown Menu Expression Control Plugin.
-
Creating a Dropdown Menu Expression Control Plugin.
Posted by Jon Smith on April 10, 2012 at 5:02 pmI frequently find that I could use a definable dropdown menu to control expressions. I would love to create a custom effect that would create dropdown menus in the same way we can create slider controls, checkbox controls, color controls, etc…
Any ideas if this is possible? Is there a decent guide ont there that would help me get started. Many Thanks.
-jon
Billy Sides replied 9 years, 5 months ago 7 Members · 9 Replies -
9 Replies
-
Dan Ebberts
April 10, 2012 at 8:43 pmYou could certainly do that with a simple plugin (as far as plugins can be simple). However, there is a steep learning curve for creating even simple plugins. You would need the AE SDK and a C++ development environment (like Visual Studio). I’ve actually built a few plugins that are nothing more than some UI controls with the most basic code to pass the input image to the output. Not to discourage you, but it’s definitely not trivial and I wouldn’t recommend it to someone that hasn’t done a lot of coding.
Dan
-
Jon Smith
April 10, 2012 at 11:52 pmThanks for the Input Dan. You’re probably right. I was hoping for a simpler solution. It would be a great way to control certain expressions.
Hopefully in a future version Adobe will improve and add some additional tools for the scripters out there.
-
Paul Roper
April 11, 2012 at 5:34 pmIf you just want to get a few options into a drop-down menu, you can kinda do a workaround like this:
Say you want to be able to have a menu populated with the words:
hello world
goodbye
another option
57Create four nulls and rename them hello world, goodbye, another option, 57.
On a layer of your choice, add an Expression Controls > Layer Control. This becomes your pop-up menu, where you can select “hello world, goodbye, another option, 57”.
When you need to access that menu choice in an expression, use:effect(“Layer Control”)(“Layer”).name
For example, if you’ve chosen layer “57”, the expression:
effect(“Layer Control”)(“Layer”).name*2
will give you 114.
Don’t know if this helps your workflow, but it was interesting (for me, anyway!) to see that this theory actually worked.
– Paul
-
Paul Conigliaro
June 18, 2012 at 4:52 pmDan,
I’m curious, what would this entail for an experienced coder? I’ve also been looking for a plugin like this for a while. It would be great to have custom controls similar to User Data in Cinema 4D.
[Disclaimer: Sometimes I am an idiot and misinterpret people’s posts. I’m sorry.]
-
Chase Massingill
July 14, 2014 at 7:21 pmYou can do this using a “custom effect.”
There are various tutorials online and tools for creating these. Its pretty straightforward – the only part that took me a while to get was actually doing a popup style option, since none of the tutorials I found online include this, perhaps because it was added as a feature after the time of their writing.
This tutorial gives a good start, and there is a tool for doing the basic creation of the UI as well.
https://www.batchframe.com/tutorials/12Once you get a grasp on how to create a custom effect, you can modify what you have learned there to create a popup by looking through PresetEffects.xml file mentioned in the tutorial. It has some hints on the syntax and even a few custom effects in there you can look at as examples.
-
Billy Sides
November 16, 2016 at 7:09 pmUsing the batchframe method works great, I just have one small question.
How do I access the actual value of the dropdown instead of the currently selected index?
ie… the dropdown reads: RED,YELLOW,BLUE,GREENBut when pickwiped to a text layers source it returns. 1,2,3,4 instead of the value. I have tried adding .name .value etc… with no luck. Any ideas how to pull out the actual value?
Pseudo Effect Code: 10802_dropdowntest.txt.zip
Just add the code in the text file to your PressetEffects.xml file found here: C:\Program Files\Adobe\Adobe After Effects CS6\Support Files
Then create a comp in AE and add a null and select it. Then in the File menu select Scripts/Open Script Editor and paste in this code and press the green play button:
app.project.activeItem.layer(1).effect.addProperty("ColorSwap")You can close that window without saving, and the Pseudo Effect should be added to your selected layer.
Try it out, and let me know if you can find a solution to pull out the actual value instead of the index value.
Thanks,
-bsides
-
Billy Sides
November 16, 2016 at 11:52 pmI found a clean way to script it for now, but still hoping there is a way to pull the actual value instead of redefining what is in the drop down.
Here’s a one line example.
textColor = ( {1: "RED",2: "YELLOW",3: "GREEN",4: "BLUE"} )[thisComp.layer("ColorCTRL").effect("Cusotm Effect")("Popup").value];-bsides
-
Xavier Gomez
November 17, 2016 at 12:20 amIt’s not possible.
Dropdowns parameters only have a numerical value (an integer) and the text displayed cannot be retrieved by an expression, nor script. That behaviour is not specific to custom effects: the same is true for dropdown parameters in genuine effects.Xavier
-
Billy Sides
November 18, 2016 at 9:20 pmThe Layer Control effect works correctly if you add .name to the end like so:
thisComp.layer("ColorCTRL").effect("Layer Control")("Layer").name
But doing it this way you have to have a layer in your composition, and the layer control can’t be key framed.Unfortunately, when you do the exact same thing with the Popup menu, you get the name of the menu.
thisComp.layer("ColorCTRL").effect("Cusotm Effect")("Popup").name
This returns “Popup” – not sure why anyone would ever want the name of the menu.-bsides
Reply to this Discussion! Login or Sign Up