🖨️Display Value

Using the sourceText to show Values you wouldn't normally be able to display.

TIME

-Countdown Timer

Slider = effect("Slider Control")("Slider");

ms = Math.floor(slider/1000);
seconds = Math.floor(slider%60);
minutes = Math.floor(slider/60);
minutes = Math.floor(slider%60)
hours = Math.floor (slider/3600)


function addZero(n) {
if(n < 10) {
return '0' + n
} else {
return n;
}
}

if (slider > 0) {
addZero(hours) + ':' + addZero(minutes) + ':' + addZero(seconds) + ':' + (ms)
} else {
'00:00'
}

Slider Controls Value and the expression will output digital clock format

-Current Comp Time

timeToTimecode(t = time + thisComp.displayStartTime,
timecodeBase = 30,
isDuration = false);

Display current time of comp.

-Current Time



var date = new Date(Date(0));

var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();

hours + ':' + minutes + ':' + seconds;

Displays the current clock time of the machine it is running on

-Current Frame

timeToFrames(time,25);

Displays Current Frame, change "25" to match your frame rate

-Display Timecode, Frames & FPS

timeCode = timeToTimecode(t = time + thisComp.displayStartTime,timecodeBase = 30, isDuration = false);
frameNum = (time - thisComp.displayStartTime) / thisComp.frameDuration; 
frameRate = 1/thisComp.frameDuration; 
var timeCode = (effect("Hide Time Code")("Checkbox") > 0) ? "" : timeCode + ' | ';
var frameNum = (effect("Hide Frames")("Checkbox") > 0) ? "" : 'Frame: ' + Math.round(frameNum) + ' | '   ;
var frameRate = (effect("Hide FPS")("Checkbox") > 0) ? "" :  ' FPS: ' + frameRate ;
timeCode +  frameNum + frameRate;

Displays

COLOR

-Display RGB Code

//Print RGB Value
theColor = thisComp.layer("Color Style").effect("Color 1")("Color");
r = Math.round(theColor[0]*255)
g = Math.round(theColor[1]*255)
b = Math.round(theColor[2]*255)
"r,"+r +" g,"+g+" b,"+b

Displays RGB Code in Source Text

-Display Hex Code

//Print Hex Value
theColor = thisComp.layer("Color Style").effect("Color 1")("Color");
r = Math.round(theColor[0]*255).toString(16)
g = Math.round(theColor[1]*255).toString(16)
b = Math.round(theColor[2]*255).toString(16)
"#"+r+g+b;

Displays Hex Code in Source Text

Refrence

-Display Nearest Marker Comment

m = thisComp.layer("Marker Layer").marker;
txt = "";
if (m.numKeys > 0){
n = m.nearestKey(time).index;
if (time < m.key(n).time) n--;
if (n > 0) txt = m.key(n).comment;
}
txt

Displays text of nearest Marker

Last updated