ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Can these things be done using scripts?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Noelia Sanchez
Can these things be done using scripts?
on Apr 15, 2018 at 7:41:08 pm

Hello

I try to make my first after effects script. Actually, it should be a toolbox which will help me and the other persons who want to use it speed up the workflow.
I already created the interface, it has a move anchor point section, a create new... section, but now I am stuck ...
I would like to add a couple more things on it but I can't find a way to make them work using scripts...I have very little scripting knowledge.
Can anyone help me please with these things:

1. At button click change the startTime of the selected layer/layers to the playhead time...make the layer start where the playhead is, the same thing that [ shortcut does.

2. At button click move forward 10 frames (the same thing that page up shortcut does)

3. At button click add an effect, for example, the Fill effect to the selected layer/layers.

I would be very thankful to any of you who can help me.

Thank you in advance!


Return to posts index

Dan Ebberts
Re: Can these things be done using scripts?
on Apr 15, 2018 at 10:45:54 pm

// 1
var myComp = app.project.activeItem;
var myLayer = myComp.layer(1);
myLayer.startTime = myComp.time - (myLayer.inPoint - myLayer.startTime);


//2
var myComp = app.project.activeItem;
myComp.time += 10*myComp.frameDuration;


//3
var myComp = app.project.activeItem;
var myLayer = myComp.layer(1);
myLayer.property("Effects").addProperty("Fill");


Dan



Return to posts index

Dan Ebberts
Re: Can these things be done using scripts?
on Apr 15, 2018 at 10:54:48 pm

Oops, I missed the selected layers part. Here's the first one modified for that requirement:


var myComp = app.project.activeItem;
var myLayer;
for (var i = 0; i < myComp.selectedLayers.length; i++){
myLayer = myComp.selectedLayers[i];
myLayer.startTime = myComp.time - (myLayer.inPoint - myLayer.startTime);
}



Dan



Return to posts index


Noelia Sanchez
Re: Can these things be done using scripts?
on Apr 16, 2018 at 9:47:12 am

Thank you very, very, very much!!! You are a genius!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]