Copy link to clipboard
Copied
Hi,
I have about ~50 text layers, on each of them I got a text selector named "Anim" with some keyframes specially positioned.
What I need is to read those keyframes of each Anim selector and add a new effect(lets say, glow for instance) to each of the text layers using some(not all) of the Anim keyframes, and set values on each of them(since we're using glow, could be threshold for instance).
I can handle the calculations, what I just need are the syntax for reaching those keyframes and setting values to them.
Thanks in advance.
To get the value of a keyframe you just use the keyValue() method like this:
select.property("End").keyValue(i);
where i is the key index.
Dan
Copy link to clipboard
Copied
So far, I have this:
{
app.beginUndoGroup("OMG");
var actiItem = app.project.activeItem;
if (actiItem == null || !(actiItem instanceof CompItem)) {
alert("No active comp");
}
else {
var layertotal = actiItem.numLayers;
alert(layertotal + " layers being modified");
for (aux = 1; aux <= layertotal; aux++) {
var layeraux = actiItem.layer(aux);
if (layeraux.isNull != true) {
var select = layeraux.property("Text").property("Animators").property("Anim").property("Selectors").property("Anim selector");
for (i = 0; i <= 100; ++i) {
select.property("End").setValueAtTime(i,i);
}
The last part in red isnt supposed to be like that, I just tried to make sure I could set keyframes.
Now I only need a way to read keyframes from a given layer->property, any ideas?
Copy link to clipboard
Copied
To get the value of a keyframe you just use the keyValue() method like this:
select.property("End").keyValue(i);
where i is the key index.
Dan
Copy link to clipboard
Copied
Oh, thank you very much, that's exactly what I needed.
I didn't really try it, but I suppose the total keyframes is given by .numKeys?
And.. that returns me the value, is there a way to get the time which this keyframe is set?
Thanks again.
Copy link to clipboard
Copied
> I didn't really try it, but I suppose the total keyframes is given by .numKeys?
Yes.
>is there a way to get the time which this keyframe is set?
.keyTime(index)
Dan
Copy link to clipboard
Copied
Thanks!