• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

getting the markers of a composition from within the composition

Community Beginner ,
Aug 26, 2020 Aug 26, 2020

Copy link to clipboard

Copied

So I want to create an animation inside of a composition and control that animation via markers on the composition itself. 

 

I know how to set up the animation itself and control it with markers inside of the same composition. My problem is that I cannot seem to figure out how to get the markers of the composition itself. 

 

For example, using the command 

thisComp.marker.numKeys

on the sourcetext of a text layer, I get 0, so it measures something. But when I adding markers to this composition does not seem to change anything (i.e. the number stays at 0) 

 

So is there a way to grab the markers (or keyframes) of a composition from within the composition?

 

Many thanks in advance 🙂 

 

TOPICS
Expressions

Views

181

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Aug 26, 2020 Aug 26, 2020

Copy link to clipboard

Copied

Make sure, you add the markers to the comp, and not to a layer (markers should appear on top of render bar).

 

If you add the markers outside in a parent comp, where your working comp lays as a layer, you need to call the comp explicite:

 

comp("Master").layer("CompWithMarkers").marker.numKeys;

 

Unfortunatly there is no concept like "parentComp" in expressions, therefore you cannot know read out how your comp is called or what layer index is has on "the outside". So you cannot make this with variables, or just by brute-force cycling thru everything.

 

*Martin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 26, 2020 Aug 26, 2020

Copy link to clipboard

Copied

Thank you so much, that was super helpful. 

 

Also, I found a workaround to make it more flexible: 

var comp_name = thisComp.name;
comp("Master").layer(comp_name).marker.numKeys;

 

in this way layers can access the markers on the parent composition and once numKeys are replaced with nearestKey it can be used to control animations. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 26, 2020 Aug 26, 2020

Copy link to clipboard

Copied

LATEST

Great solution. Just be aware that this will break when the precomps are renamed.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines