Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions scripting: add a custom default layer in Layer Control?

  • scripting: add a custom default layer in Layer Control?

    Posted by Santi Agustí on May 27, 2016 at 2:22 am

    Hi! I recently purchased the awesome ft-toolbar, so I decided to finally (try to) create a little script for the automation of the cam + nulls creation I aaalways do o every project (and add it as a button to the ft-toolbar)

    When I add a Layer Control on the null (to pick the Layer wich will be the focus target for the DOF control), is there a way to start with a given layer from the beginning, or that is not possible?
    I have this, inside a null:

    var focuslayer = camNull("Effects").addProperty("Layer Control");
    focuslayer.name = 'focus layer'

    so I tried to simply add the focus layer (a previously created null called DOF) like adding a value, but I guess it’s not the correct way

    focuslayer.property("Layer").setValue("DOF");

    do you think it’s doable?

    thanks in advance!

    Santi Agustí replied 9 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Xavier Gomez

    May 27, 2016 at 7:20 am

    The argument to setValue should be the index of the layer (or 0 for ‘None’):

    focuslayer.property("Layer").setValue(doflayer.index);

    Xavier

  • Santi Agustí

    May 27, 2016 at 11:28 am

    Thanks Xavier!
    worked perfectly!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy