Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Setting Layer Postion

  • Setting Layer Postion

    Posted by Stephen Botting on September 21, 2010 at 10:42 pm

    I am working a project with nearly 400 layers, and have been using Expressions to place the layers in time(time remapping) and position.

    But have started playing in extendscript to write a script that can place the layers in time and position before rendering, to save evaluating the expressions every frame.

    I have successfully got my layers to start at the correct time, but when I try to set their position they don’t move and the script reports no errors, any ideas how this is done.

    Thanks,
    Stephen

    var selectedLayers = app.project.activeItem.selectedLayers;

    for (i = 0; i < selectedLayers.count-1; i++) {
    selectedLayers[i].position = [100,100]; //just an example position

    //also tried
    selectedLayers[i]("position") = [100,100];
    selectedLayers[i].position.value = [100,100]; //returns value is readonly
    selectedLayers[i].postion.setValue = [100,100];
    }

    Stephen Botting replied 15 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Chris Wright

    September 21, 2010 at 10:53 pm

    this

    myLayer.property(“Position”).setValue(theVal1);

    or this

    theLayer.position.setValue([1632,1224,0]);

    not this.
    selectedLayers[i].postion.setValue = [100,100];

    https://technicolorsoftware.hostzi.com/

  • Stephen Botting

    September 21, 2010 at 11:34 pm

    Thanks for the reply, I’m assuming from this that I need to include the Z position even when the layer is 2D.

    Worked great once I looked at your code properly.

    Cheers,
    Stephen

    https://www.43south.co.nz

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