Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions null position to layername problem

  • null position to layername problem

    Posted by Raphael Schaaf on April 28, 2011 at 6:34 pm

    Hi,
    I wanted do add some new features to a script I wrote some weeks ago.
    Every time I run the script it takes the 2d moving of 2 selected nulls and puts it into a new null that moves in 3d space…

    This workes fine, but I now tried to add something that counts how many times I used the script and puts this number at the end of the name of the new null.
    I use the x-position of another null (placeholder) to count, but the expression for the position doesn’t get written and every time I try another way to get the position into a layers name, it’s 0, NaN or some other error.

    I ran on the problem with the expression not geting written when I wrote the first script, but strangely it worked fine the next day, without any changes in the script. Maybe this part will work tomorrow…

    var thisComp = app.project.activeItem;
    var plchldr = thisComp.layers[3];
    var plchldrname = plchldr.name;
    var plchldrpos = plchldr.position;
    var plchldrexpr= plchldrpos.expression;
    var placeholder = new String ('placeholder');
    var aufrufe = 0;

    if (plchldrname == placeholder) {

    var pos = plchldr.position[0];
    var aufrufe2 = pos + 1;
    var plchldrexpr = 'value + [' + aufrufe2 + ',-100];';
    newTrackpoint.name = trackName + aufrufe2;

    }else{

    var newplchldr = thisComp.layers.addNull();
    newplchldr.name = 'placeholder';
    newplchldr.position.setValue ([1,-100]);
    newplchldr.moveAfter (thisComp.layers[3]);
    newTrackpoint.name = trackName + aufrufe;
    }

    Txus Da silva replied 14 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Txus Da silva

    March 5, 2012 at 2:07 pm

    i have posted twice b4 but seems it doesnt like my posts…

    I´m actually performing a similar thing like yours when i stumbled onto this code… Its exactly what i need but im terrible w any scripting…

    im using 2 tracking NULLS.. lets call it NULLFRONT and NULLSIDE

    Im using
    NULLFRONT XY
    and
    NULLSIDE X as Z

    where do u place this script?
    whats the call for the different layers?

    Thanx in advance yours Tx

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