ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Keyframed Slider Control value based on Source Text of another layer

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Paul Connors
Keyframed Slider Control value based on Source Text of another layer
on Nov 10, 2016 at 4:37:33 pm

Hi Guys. So I've got a real head-scratcher. I'm about 5 draft comps into testing all sorts of different ways of accomplishing this but have struck out...repeatedly!

Here are a couple screengrabs so you know what I'm talking about.





I have a set of precomps that are in ranked order for a given week. I want to animate the change in position from week to week. I've been able to do this manually but I'm looking to accomplish it automatically using expressions. Currently I have the y-position of the List Item precomp linked to a slider control created for that particular List Item. So "List Item 01" is linked to "List Item 01 - Control"

xPos = transform.position[0];
yPos = thisComp.layer("List Item 01 - Control").effect("Slider Control")("Slider");
[xPos,yPos]

I then have keyframed the slider control values to the specific y-coordinates I want. I want it to animate from Keyframe 1 to Keyframe 2 so I have Keyframe 1 = 320, Keyframe 2 = 660. I then want to hold for a little so I have Keyframe 3 = 660. Then animate again so Keyframe 4 = 520. Those movements represent the change from week to week. Easy enough so far.

Here is the tricky part. I want to generate each individual Slider keyframe value (and thus the y-coordinate for my List Item) from a different Text Layer's Source Text. So, Slider Keyframe 1 = the source text from "Item 1 - Week 1 Position" and then Slider Keyframe 2 & 3 = the source text from "Item 1 - Week 2 Position" and then Slider Keyframe 4 = the source text from "Item 1 - Week 3 Position" etc.

Does that make sense? Is this even the best way to accomplish this dynamic movement of ranked elements? Any guidance would be greatly appreciated.

Thank you!


Return to posts index

Soham Jani
Re: Keyframed Slider Control value based on Source Text of another layer
on Nov 10, 2016 at 5:24:52 pm

Hm, I'm a tad bit confused. Is it possible for you to send us a video describing what you're achieving? Or maybe it's just me...

"It's all around us Neo, temporary constructs of time....."


Return to posts index

Paul Connors
Re: Keyframed Slider Control value based on Source Text of another layer
on Nov 10, 2016 at 5:41:19 pm

Haha. I'm sure it's not just you. I tried to be as clear as possible but to be honest I'm confused myself! Here is a link to what I'm talking about: https://vimeo.com/191042442


Return to posts index


Dave LaRonde
Re: Keyframed Slider Control value based on Source Text of another layer
on Nov 10, 2016 at 6:01:40 pm

Um, you'd better try that link again. The current one goes nowhere.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Paul Connors
Re: Keyframed Slider Control value based on Source Text of another layer
on Nov 10, 2016 at 6:21:30 pm

I'm sorry about that. Let's try this one:


Return to posts index

Walter Soyka
Re: Keyframed Slider Control value based on Source Text of another layer
on Nov 10, 2016 at 6:18:57 pm

[Paul Connors] "Here is the tricky part. I want to generate each individual Slider keyframe value (and thus the y-coordinate for my List Item) from a different Text Layer's Source Text. So, Slider Keyframe 1 = the source text from "Item 1 - Week 1 Position" and then Slider Keyframe 2 & 3 = the source text from "Item 1 - Week 2 Position" and then Slider Keyframe 4 = the source text from "Item 1 - Week 3 Position" etc."

What does the source text value actually look like? In other words, how is it you are entering this data?

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index


Paul Connors
Re: Keyframed Slider Control value based on Source Text of another layer
on Nov 10, 2016 at 6:44:22 pm

Hi Walter. The source text is just a numerical value that will be the y-coordinate I want to use. For my layout the source text will either be 380, 520, 660, 800, or 940.

Item Ranked #1 => source text = 380
Item Ranked #2 => source text = 520
Item Ranked #3 => source text = 660
Item Ranked #4 => source text = 800
Item Ranked #5 => source text = 940

Does that make sense? Thanks.


Return to posts index

Walter Soyka
Re: Keyframed Slider Control value based on Source Text of another layer
on Nov 11, 2016 at 4:23:02 pm

Paul, this is a variation of a problem we've run into before ourselves, so I took a quick stab at a generalized solution:

10784_leaderboard.aep.zip

WARNING: There is zero error checking in the expressions in this project. Making this more robust for production use is left as an exercise to the reader.

Like your setup, there are five numbered precomps for the leaderboard entries. Then I changed things a bit.

There are five numbered "Position" nulls. They set the position of each slot on the leaderboard.

There are four numbered "Arrangement" text layers. Those text layers read things like "1 2 3 4 5" -- that's the order that elements numbered precomps should appear in, top to bottom, for that specific arrangement. Note the spaces that separate the numbers. In your case, you would enter the set of values that describes the arrangement for each week in its own "Arrangement" text layer.

There is one "[null] CONTROL" layer, which has an "Arrangement Number" slider on it. This is a keyframeable property that indicates what arrangement should be on screen. As you animate that number, the set of position expressions on each numbered precomp layer look at the value, figure out which slot they're supposed to be in for the current and next arrangements, and animate themselves between as necessary. Note in this example, you can easily change the timing and even use eased animations between adjacent arrangements.

You can add additional Positions, Arrangements, etc. -- but the expressions require the layers to be named with the same pattern: "Position x", "Arrangement y", etc., where x and y are integers. There's a bit of string manipulation going on to refer to layers specifically by name to make this whole thing work.

Give it a spin and let me know what questions you have.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

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