Link the second keyframe to a Slider Control

Scripting for After Effects

Link the second keyframe to a Slider Control

Postby Dorin on 06/22/2014, 12:10 pm

Hello,

How do I link the second keyframe of an animation to a slider? Only the second keyframe. The effect is Trim Paths to a shape layer.

Thank You
I'm Sorry for my English...
Dorin
 
Posts: 68
Joined: 03/29/2009, 9:34 am

Re: Link the second keyframe to a Slider Control

Postby Mylenium on 06/22/2014, 10:49 pm

Keys are addressed via their index, but unlike arrays beginning with 1. So something like

thisLayer.transform.position.key(2)

would return the value of the second keyframe.

Mylenium
[Pour Mylène, ange sur terre]
----------------------------------------
www.myleniumblog.com
Mylenium
 
Posts: 3263
Joined: 02/1/2009, 11:45 am
Location: Germany
System Specs: Have, I do!

Re: Link the second keyframe to a Slider Control

Postby Dorin on 06/23/2014, 12:13 am

Thank you Mylenium :)

How will look an expression that will link the second keyframe of Trim Path animation to a Slider Control?
I'm Sorry for my English...
Dorin
 
Posts: 68
Joined: 03/29/2009, 9:34 am

Re: Link the second keyframe to a Slider Control

Postby kyletmartinez on 06/23/2014, 12:24 pm

Alt + Click on the stopwatch for the End property of your Trim Path modifier. Pickwhip to a Slider Control (the pickwhip icon is a spiral).
kyletmartinez
 
Posts: 581
Joined: 10/30/2013, 6:53 am
Location: Phoenix
Twitter: kyletmartinez

Re: Link the second keyframe to a Slider Control

Postby Dorin on 06/23/2014, 11:58 pm

The classic linking is not working. I want to retain the original animation and to link only the last keyframe to slider. Is an expression to isolate only the last keyframe, but I do not know it.

I made a video explanation. Please help
https://mega.co.nz/#!705BSYIA!FxGPjNPWEbTlxqL1m-ocyBPpwiB8iljAtHP7KmdWa8Q
I'm Sorry for my English...
Dorin
 
Posts: 68
Joined: 03/29/2009, 9:34 am

Re: Link the second keyframe to a Slider Control

Postby Dorin on 06/26/2014, 12:39 am

Bump >-||
I'm Sorry for my English...
Dorin
 
Posts: 68
Joined: 03/29/2009, 9:34 am

Re: Link the second keyframe to a Slider Control

Postby hans123 on 07/3/2014, 3:12 am

Hello Dorin,

one way is to use the Tool "Expression Timeline" from Mamoworld:

http://mamoworld.com/tools/expression-timeline

With "Expression Timeline" you can "mix" expressions in the timeline. For your example
see my Picture.
The first expression is only the value of the Start-Frame (in my example Frame 0), so
set before you use "Expression Timeline" Path Trim END to 0.
The second Expression is the slider control for Path Trim END, beginning at Frame 50.
For blending between the two expressions use "Fade of Duration".

I hope this can help you

Hans
Attachments
expressTimeline.jpg
hans123
 
Posts: 1101
Joined: 12/28/2012, 1:37 am
Location: Paris / France

Re: Link the second keyframe to a Slider Control

Postby Dorin on 03/12/2015, 6:05 am

Here is a solution for Opacity https://forums.creativecow.net/thread/227/28926

Is there a easy way to adress the second keyframe of an animation and link it to a slider ? Please Help
I'm Sorry for my English...
Dorin
 
Posts: 68
Joined: 03/29/2009, 9:34 am

Re: Link the second keyframe to a Slider Control

Postby graymachine on 03/21/2015, 8:23 pm

It seems to me this solution that you found should work.

Code: Select all
if (numKeys > 1){
  t1 = key(1).time;
  t2 = key(2).time;
  v1 = 0;
  v2 = effect("Slider Control")("Slider");
  linear(time,t1,t2,v1,v2);
}else
  value


You can't really "link" keyframes to a slider. You can link the parameter value itself. Beyond that, you are simply changing the parameter value at a certain time. But, with animation, you cannot just change the value at the time of the keyframe, you would need to interpolate from keyframe 1 to keyframe 2 to that new value. That's what Dan's expression does (the one above).
Harry Frank
Motion design tutorials, elements and more.
http://www.graymachine.com
graymachine
VC Moderator
VC Moderator
 
Posts: 981
Joined: 08/4/2008, 6:38 pm
Twitter: graymachine


Return to After Effects Expressions