Question
Expressions: Making layermarkers using keyframes as triggers.
Hi there, I've been having an issue all day and night with this expression. I'll post the code below.
var input = thisComp.layer("layerName").effect("Dropdown")("Menu");
var output = thisComp.layer("layerName2");
var timeStep = 0.04;
for (var t = input.startTime; t <= input.endTime; t += timeStep) {
var dropdownValue = input.valueAtTime(t);
output.addMarker(t, new MarkerValue(dropdownValue.toString()));
}
Let me clarify what I am trying to achieve here.
First of all, I added this expression to the Source Text property of a different text layer. It's supposed to act as a non visible layer just for code.
Let me clarify what I am trying to achieve here.
First of all, I added this expression to the Source Text property of a different text layer. It's supposed to act as a non visible layer just for code.
Right now I have some nested animations in precomps which can be triggered with markers and marker comments. But what I'm trying to achieve is a user friendly approach since I'm making a rig for someone else and manually writing markers isn't userfriendly enough. I have a control layer with several controls including the Dropdown effect. I want to animate this effect so that my output layer gets a new layer marker when there is a keyframe on the effect. The marker should output the value of the keyframe (the value of the dropdown menu).
If this would work, the animation would be triggered whenever the keyframe says so.
However, it doesn't. I've been going over this using tutorials, reading ae scripting guide, chatting with ChatGPT, checking aenhancers.... But it won't work. For some reason, unknown to me, After Effects doesn't register certain functions which are used on all those platforms I researched. Some of those functions are '.keyTime()' or '.keyValue()' or 'new MarkerValue()'. But I'm no expert and I might just do something wrong.
So if there's an expert out there that can help me, that would be awesome.
