-
Time remap expression and slider
Hi, I am making a template with a finished composition that currently is exactly 5 seconds and 10 frames long ( so 10;00;00;00 to 10;00;05;09 to be exact )
project is 29.97 fps
I have this composition in another composition with time remapping enabled, and here is what I am trying to do.
I need this composition to be flexible in duration up to 10:10 ( which is having an out at 10;00;10;09 to be exact )
SO the duration could be anywhere from 5:11 to 10:09 and anything inbetween
But there are 2 conditions and 1 complicated math conversion.
The first condition is that the first 26 frames ( so 10;00;00;00 to 10;00;00;25 ) cannot be remapped, so the expression needs this animation to stay the same regardless of the slider number entered. The second condition is the last 2 seconds ALSO needs to stay the same ( from 10;00;03;12 to 10;00;05;09 ) – so actually its just a bit less than 2 seconds.
The time remap expression will alter the speed from 10;00;00;25 to 10:00:03:11 ) and that is exactly what I want.
The other part of the math I am having a hell of a time with; is that this slider will have a decimal point. So let us say that the user enters 7.17 as the input value into the slider.
I want this to represent 7 seconds and 17 frames which logically would give me a time code of 10;00;07;16 ) because the comp starts at 10;00;00;00;00
On paper I have solved the math on this but I cannot seem to write the code. My knowledge of writing expressions from scratch is simply not good enough.
I figured the math part would be
the fixed number of the slider without the decimals multiplied by 30 + the difference between the whole number and the number without the decimals multiplied by 100that would give me 7 times 30 which is 210
+ (7.17-7) which is .17
multiplied by 100 which is 17 plus the original 210
=227 frames
Then in the expression for the time remap to work correctly this number needs to get converted to timecode.
I hope I have given all relevant information and any help would be much appreciated.
Thanks