Skip to main content
daniely27391081
Participant
October 3, 2018
Question

get value of layer controller in aftereffects

  • October 3, 2018
  • 1 reply
  • 2442 views

Hi,

i need to get value of layer controller with script, since aftereffects 2018 layer controller has 2 drop downs, first drop down shows all layers, second drop down shows [effect, mask, effect & mask]. i could get value of first dropdown, but couldnt get value of second dropdown...

is it possible to read second dropdown value?

Best Regards

Daniel

This topic has been closed for replies.

1 reply

zlovatt
Inspiring
October 19, 2018

From everything I've seen, setting or getting the value of that dropdown is not yet script-accessible (as of AE 16.0, Oct 2018).

Participating Frequently
November 3, 2018

Can you provide an example of getting and setting the 1st dropdown's 'value'?  The example I was following doesn't seem to work anymore since they introduced that second dropdown.

I can access it via expressions; I need to do it via a script I'm creating...  I am trying to get a layer's layer control 'value', and then read the position from that layer.  I am also trying to create another null with another layer control, which is set to the other selected layer control value.  So I need to get and set.

Thanks a bunch!

-Dave

zlovatt
Inspiring
November 3, 2018

This is broken out into a bunch of steps so it's easier to see, and note that there aren't checks to ensure that the index that you're setting or getting is valid-- just here to show a few possibilities!

(function () {

  var comp = app.project.activeItem;

  var layer = comp.selectedLayers[0];

  var effects = layer.property("ADBE Effect Parade");

  var layerControl = effects.property("ADBE Layer Control");

  var layerDropdown = layerControl.property("ADBE Layer Control-0001");

  // This value is the index in your current comp of the dropdown's target

  var dropdownLayerIndex = layerDropdown.value;

  // This is how you'd get the layer specified by the dropdown

  var dropdownSelectedLayer = comp.layer(dropdownLayerIndex);

  // To set the value of the dropdown, you can do this--

  // where the value passed in is a number from 0 ("none"), to comp.numLayers

  layerDropdown.setValue(0);

})();