Can’t figure out how “valueAtTime + offset” works….
If I put value -1 on my Offset slider, then animation starts at 32-nd frame. if I put -0.5 value, then it starts at 20-th frame….
Very strange, at least for me
(My comp framerate is 25fps).
Can you explain please how it works? 
5p1r17 said
Can’t figure out how “valueAtTime + offset” works…. If I put value -1 on my Offset slider, then animation starts at 32-nd frame. if I put -0.5 value, then it starts at 20-th frame…. Very strange, at least for me(My comp framerate is 25fps). Can you explain please how it works?
![]()
if your first keyframe is on 7th frame then this makes perfect sense 
- Community Moderator
- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Item was Featured
- Author had a File in an Envato Bundle
- Beta Tester
- Has been a member for 4-5 years
- United Kingdom
5p1r17 said
Can’t figure out how “valueAtTime + offset” works…. If I put value -1 on my Offset slider, then animation starts at 32-nd frame. if I put -0.5 value, then it starts at 20-th frame…. Very strange, at least for me(My comp framerate is 25fps). Can you explain please how it works?
![]()
Time is always measured in seconds and in that code fragment that I dashed off, I specified frames and forgot to convert… Oops!
But here’s roughly how it works….
myOffset = effect("Offset in Frames")("Slider").value;
//let's assume the user sets this to 25 for a 1 second offset.
completion = thisComp.layer("Controller").effect("Completion %")("Slider");
// Note: a reference to the Completion % Slider OBJECT..... NOT it's value.
mySampleTime = time + framesToTime(myOffset);
//Look! - I remembered to convert to seconds this time.
myCompletion = completion.valueAtTime(mySampleTime);
// completion is just a shorthand for the slider object.
// With the value of 25 that we put in before, the Completion % slider will be sampled
// not at the current time, but 1 second ahead of the current time...
// that means that for this layer, everything happens 1 second earlier,
// because it's looking 1 second ahead of itself....
Does that explain it?
I should have guessed…. framesToTime…
Thanks Felt, now everything is clear now!
- Sold between 50 000 and 100 000 dollars
- Community Moderator
- Referred between 1000 and 1999 users
- Author had a File in an Envato Bundle
- Most Wanted Bounty Winner
- Item was Featured
- Author was Featured
- Contributed a Tutorial to a Tuts+ Site
My new project has over 1000 lines of code (expressions) almost no effects, works super fast, very user friendly and super useful
Can’t wait to finish and upload! 
Mocarg said
My new project has over 1000 lines of code (expressions) almost no effects, works super fast, very user friendly and super usefulCan’t wait to finish and upload!
![]()
Can’t wait to see that 
- Community Moderator
- Sold between 50 000 and 100 000 dollars
- Author was Featured
- Item was Featured
- Author had a File in an Envato Bundle
- Beta Tester
- Has been a member for 4-5 years
- United Kingdom
Mocarg said
My new project has over 1000 lines of code (expressions) almost no effects, works super fast, very user friendly and super usefulCan’t wait to finish and upload!
![]()
I hope that’s 1000 unique lines Mo, and that you haven’t been cheating by cutting and pasting. 
Mocarg said
My new project has over 1000 lines of code (expressions) almost no effects, works super fast, very user friendly and super usefulCan’t wait to finish and upload!
![]()
Same here. Right now I just hope we are not creating the same thing
/mine is full of pie charts and circle graphs, as a new project for envato’s most wanted/
- Sold between 50 000 and 100 000 dollars
- Community Moderator
- Referred between 1000 and 1999 users
- Author had a File in an Envato Bundle
- Most Wanted Bounty Winner
- Item was Featured
- Author was Featured
- Contributed a Tutorial to a Tuts+ Site
felt_tips said
Mocarg saidI hope that’s 1000 unique lines Mo, and that you haven’t been cheating by cutting and pasting.
My new project has over 1000 lines of code (expressions) almost no effects, works super fast, very user friendly and super usefulCan’t wait to finish and upload!
![]()
![]()
Well i did use Copy/Paste A LOT! But i had to change some thing in every expression. It’s cool 
- Sold between 50 000 and 100 000 dollars
- Community Moderator
- Referred between 1000 and 1999 users
- Author had a File in an Envato Bundle
- Most Wanted Bounty Winner
- Item was Featured
- Author was Featured
- Contributed a Tutorial to a Tuts+ Site
DoubleX said
Mocarg saidSame here. Right now I just hope we are not creating the same thing
My new project has over 1000 lines of code (expressions) almost no effects, works super fast, very user friendly and super usefulCan’t wait to finish and upload!
![]()
/mine is full of pie charts and circle graphs, as a new project for envato’s most wanted/
We are
But why is that a bad thing? I don’t care if i get into Most Wanted or not i just want to make something unique…
