Forum Replies Created

Page 4 of 32
  • Xavier Gomez

    December 14, 2016 at 4:52 pm in reply to: Is there a way to get the current effects name?

    Just thinking, you might actually want something else.
    This will also work for a property that is an immediate child of the effect:

    thisProperty.propertyGroup(1).name;

    In general thisProperty is the current property, and thisProperty.propertyGroup(n) is its nth parent.
    (n=0 not allowed)

  • Xavier Gomez

    December 14, 2016 at 4:47 pm in reply to: Is there a way to get the current effects name?

    If you pickwhip the effect itself (not a property inside it), you’ll get something like
    thisComp.layer(“Layer name”).effect(“Effect name”)
    Then add .name to it to get:

    thisComp.layer(“Layer”).effect(“Effect name”).name;

    (that’s a string, the name of the effect).

    Xavier

  • This works:

    layer.transform.xPosition.expression =expr;

    or

    layer.transform.property(“ADBE Position_0”).expression =expr;

    (same with x/y/z and 0/1/2).

    Xavier

  • Xavier Gomez

    December 9, 2016 at 7:45 pm in reply to: Text Multiline Wiggle Expression

    Using an animator with a wiggly selector would probably be the easiest way.
    In the text layer:
    Choose Animate>Position, it creates a Range Selector and a Position property.
    Remove the Range Selector because it won’t be used, only keep the Position property.
    Set the Position value to something different from [0,0]. This will represent the “wiggle amount”.
    Then do Add>Selector>Wiggly Selector and play with its parameters.

    No expression needed.

    Xavier

  • Hum, seems that i missread the question.
    The above wiggles by the same amount to scale[0] and scale[1], but does not preserve the ratio.
    This should be better:

    w = wiggle(1,5);
    if (value[0]===0){[0, w[1]];}
    else{[w[0], w[0]*value[1]/value[0]];};

  • Like this?

    w = wiggle(1,5);
    [w[0], value[1] + (w[0]-value[0])];

    Xavier

  • You can transition smoothly between the two by using a linear or ease function:

    timeToStart = 3;
    transitionDur = 1;
    freq = 1.5;
    maxAmount = 30;

    amount = easeIn(time, timeToStart, timeToStart+transitionDur, 0, maxAmount);
    [wiggle(freq, amount)[0], value[1]];

    Note: you could also use, with the eact same result:

    timeToStart = 3;
    transitionDur = 1;
    freq = 1.5;
    maxAmount = 30;
    x1 = value[0];
    x2 = wiggle(freq, maxAmount)[0];
    [easeIn(time, timeToStart, timeToStart+transitionDur, x1, x2), value[1]];

    Xavier

  • Xavier Gomez

    November 23, 2016 at 9:50 am in reply to: Script to show/hide some layers

    Yes it’s possible, scripts are designed exactly for this kind of things.
    You need to loop throw all project items, identify those that are compositions, then for each comp loop again over all layers, and do your stuff with each layer.
    You can try this (on a test project…):

    var LANG_KEYS = "_EN,_DE,_FR,_IT";
    //
    function handleLayer(layer, lang_identifier){
    var str = layer.name.slice(-3);
    if (LANG_KEYS.indexOf(str)<=0){
    // layer is localized: switch on or off
    layer.enabled = (str===lang_identifier);
    }
    else{
    // layer not localized: do nothing
    };
    };
    function handleProject(lang_identifier){
    var M = app.project.numItems, m, comp;
    var N, n, layer;

    for (m=1; m<=M; m++){
    comp = app.project.item(m);
    if (comp.typeName!=="Composition") continue;
    N = comp.numLayers;
    for (n=1; n<=N; n++){
    layer = comp.layer(n);
    handleLayer(layer, lang_identifier);
    };
    };
    };
    // UI
    var win = new Window("palette", "script name");
    win.alignChildren = ['fill', 'top'];
    win.spacing = 5;
    var keyMENU = win.add("dropdownlist", undefined, LANG_KEYS.split(","));
    var runBTN = win.add("button", undefined, "go");
    keyMENU.selection = 0;
    runBTN.onClick = function(){handleProject(keyMENU.selection.text);};
    win.show()
    ;

    Xavier

  • Xavier Gomez

    November 20, 2016 at 9:02 am in reply to: ScriptUI – NewPath() question?

    The path properties are not exposed to scripting apparently.
    You need to use the moveTo() and lineTo() methods:

    var g = grp.graphics;
    var strokePen = g.newPen( g.PenType.SOLID_COLOR, [1, 1, 1, 1],2);
    g.newPath();
    g.moveTo(0,0);
    g.lineTo(10,10);
    g.lineTo(0,10);
    // to close: g.closepath();
    g.strokePath(strokePen, g.currentPath);

    Paths defined this way will only be drawn while the group is drawn. This requires to define grp.onDraw somewhere will all the instructions to draw the group, like above, that is :
    grp.onDraw = function(){ /*some code involving this.graphics*/};
    and in CC it turns out that onDraw is a little bit buggy: sometimes custom graphics defined through onDraw disappear while the user opens a dialog, and are not redrawn afterwards. See also this thread: https://forums.adobe.com/thread/1911167 (harder bug in CC2015 and later). Overall, it seems that it is no longer a good idea to use custom onDraw with ScriptUI.

    Xavier

  • Xavier Gomez

    November 17, 2016 at 12:20 am in reply to: Creating a Dropdown Menu Expression Control Plugin.

    It’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

Page 4 of 32

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