Skip to main content
Inspiring
August 11, 2013
Question

Selecting Dropdown value in Effect/Accessing Effect Values in general

  • August 11, 2013
  • 1 reply
  • 746 views

Hi, 2 part question:

1. I'm trying to add a Directional Blur effect to a layer which I've been able to do but I haven't figured out how to access the "Type" value.  I want to change it to "Fading Zoom" by default.  Does anyone know how to access an effect value from a dropdownlist and setting it?  Is it based upon a position index? Or some sort of constant/match name system?

2. Is there an easier way to figure out how to access these values?  Basically, how do I figure out how to access effect-specific values when using the return value of layer.effect.addProperty()?  When I use the debugger, its just a generic PropertyGroup object so I don't know what's specific to that Effect.  In a lot of cases it's logical ("Amount" is .amount or "Repeat Edge Pixels" is .repeatEdgePixels) but for some it doesn't breakdown that way (Directional Blur's "Blur Length" is not .blurLength, .blur or .length). 

Thanks in advance for any help in the right direction!

Calvin

This topic has been closed for replies.

1 reply

Inspiring
August 11, 2013

Also, just realized part of my assumption for #2 was an error from a different bug.  So I see now that .blurLength does access the "Blur Length" properly.  So I guess my question evolves into will the camel-case version of the effect value always be the proper way to access it via the object in Javascript?

Also, #1 still stands as a question I need any answer to but I have a feeling my above revelation may fix that too.

Inspiring
August 11, 2013

I'd recommend using this script to help work out how to access the effect properties:

http://www.redefinery.com/ae/view.php?item=rd_GimmePropPath

In general I would suggest using matchNames to access properties as these are language independent. Here's an example of how to alter the type property. Run the script after selecting a single layer in a comp.

var activeItem = app.project.activeItem;

if (activeItem != null && activeItem instanceof CompItem) {

          if (activeItem.selectedLayers.length == 1) {

                    var theLayer = activeItem.selectedLayers[0];

                    var theEffect = theLayer.property("ADBE Effect Parade").addProperty("CC Radial Blur");

                    theEffect.property("CC Radial Blur-0001").setValue(2);

          }

}