Copy link to clipboard
Copied
Hi there, I've been having an issue all day and night with this expression. I'll post the code below.
Copy link to clipboard
Copied
It looks like you're trying to combine two concepts (scripting and expressions), which are very different things. Expressions can't create anything (markers, for example), they can only modify the the value of the property containing the expression. Scripting can create things (markers, comps, layers, etc), but scripts don't automaticlly fire off based on events in the timeline (you generally have to run them manually). Based on that, I'm not sure what to suggest...
Copy link to clipboard
Copied
I had no idea I was mixing those two up. I'll have to approach the project differently. But thank you for clarifying this. I wouldn't have known otherwise.
Copy link to clipboard
Copied
You can't add markers using an expression.
You need to create a script (JSX file)
Copy link to clipboard
Copied
What the others said. You can't create anything with expressions nor update a marker's data. It's read-only as far as expressions are concerned. Otherwise I'd say you are simply approaching things backwards and need to restructure your project. Why wouldn't you just have your markers in a top level comp and fetch them from within the nested sub-comps and then use some time logic to determine what needs to be triggered? Sure, not as simple as slapping a nearestMarker() on, but perfectly doable.
Mylenium
Copy link to clipboard
Copied
What kind of timelogic are you suggesting then? Since I have been mixing up scripting and expressions I just use markers. Right now I'm using fixed markers in my precomp and manually added markers in my main comp with the same comment as the fixed markers to trigger the animation of the precomp.
Copy link to clipboard
Copied
Based on your description it should be possible to just calculate the time difference between the markers and keyframes and then feed that into a valueAtTime() expression or whatever you are using. Of course hard to tell without knowing more of the specifics. Anyway, it seems the most crucial part is to uncouple the timing of the different markers and allow for a consistent calculation of the time difference, meaning it would probably be useful to have the pre-comp with evenly spaced m arkers and then determine the active segment based on the marker index to calculate the relative timing within the segment, rather than some complicated global time that may have been changed by shifting layers around, time-remapping or other stuff. The only real caveat would then be to not mess up the pre-comps' timing and leave them alone, only changing the timing of markers and keyframes in the parent comp.
Mylenium
Find more inspiration, events, and resources on the new Adobe Community
Explore Now