The path remains the same. Then add these to the start/end of the trim paths
START:
function arrIncludes(arr, element) {
for (var i = 0; i < arr.length; i++) {
if (element == arr[i]) return true;
}
return false;
}
L = thisComp.width;
l = thisComp.height;
percentL = (50 * L) / (L + l);
percentl = (50 * l) / (L + l);
beginPoint = thisComp.layer("Null 1").effect("Start_Point")("Slider").value % 4;
stopPoint = thisComp.layer("Null 1").effect("End_Point")("Slider") % 4;
shortPoints = thisComp.layer("Null 1").effect("Reverse_Direction")("Checkbox") == 1 ? [1, 3] : [0, 2];
firstLInstances = Math.ceil(stopPoint / 2);
if (arrIncludes(shortPoints, beginPoint)) {
theEnd = percentl * firstLInstances + percentL * (stopPoint - firstLInstances);
} else {
theEnd = percentL * firstLInstances + percentl * (stopPoint - firstLInstances);
}
theEnd = theEnd == 0 ? 100 : theEnd;
if (thisComp.layer("Null 1").effect("Enable/Disable Loading")("Checkbox") == 0) {
val = linear(time, 0, thisComp.duration - thisComp.frameDuration, 0, theEnd);
} else {
val = 0;
}
val;
END:
function arrIncludes(arr, element) {
for (var i = 0; i < arr.length; i++) {
if (element == arr[i]) return true;
}
return false;
}
L = thisComp.width;
l = thisComp.height;
percentL = (50 * L) / (L + l);
percentl = (50 * l) / (L + l);
beginPoint = thisComp.layer("Null 1").effect("Start_Point")("Slider").value % 4;
stopPoint = thisComp.layer("Null 1").effect("End_Point")("Slider") % 4;
shortPoints = thisComp.layer("Null 1").effect("Reverse_Direction")("Checkbox") == 1 ? [1, 3] : [0, 2];
firstLInstances = Math.ceil(stopPoint / 2);
if (arrIncludes(shortPoints, beginPoint)) {
theEnd = percentl * firstLInstances + percentL * (stopPoint - firstLInstances);
} else {
theEnd = percentL * firstLInstances + percentl * (stopPoint - firstLInstances);
}
theEnd = theEnd == 0 ? 100 : theEnd;
if (thisComp.layer("Null 1").effect("Enable/Disable Loading")("Checkbox") == 1){
val = linear(time, 0, thisComp.duration - thisComp.frameDuration, 0, theEnd);
}else{
val = theEnd
}
val