Skip to main content
Inspiring
February 4, 2025
Open for Voting

Make Time Stretch visible

  • February 4, 2025
  • 1 reply
  • 204 views

Who among us has not pulled their hairs out trying to determine why a shot is not playing back at regular speed, only to realize that the layer has been time-stretched? 

 

That's because you only see the time stretch properties within the Time Stretch dialogue box.

 

I would like a layer somehow labeled when it has been Time Stretched anything beyond 100%. Could be as simple as a marker (screenshot attached), or something akin to Premiere's "FX" badge that gets applied to any clip with an effect applied.

 

Thank you!

1 reply

Inspiring
February 4, 2025

Here you go, Make sure to test it enough before trusting the results
The first one works on all project comps, and the second works on project panel selected comps only.

 

 

function getStretch(layer) {
    var s = layer.stretch;
    if (s !== 100) {
        s = s.toFixed (1);
        // Create a new marker
        var marker = new MarkerValue("Stretch "+ s);
        // Add the marker at Layer in point
        layer.property("Marker").setValueAtTime(layer.inPoint, marker);
    }
}
app.beginUndoGroup("Label Time Stretched Layers");
for (var i = 1; i <= app.project.numItems; i++){
    if (app.project.item(i) instanceof CompItem){
        for (var j = 1; j <= app.project.item(i).numLayers; j++){
            var layer =  app.project.item(i).layer(j);
            getStretch(layer);
        }
    }
}
app.endUndoGroup();
function getStretch(layer) {
    var s = layer.stretch;
    if (s !== 100) {
        s = s.toFixed (1);
        // Create a new marker
        var marker = new MarkerValue("Stretch "+ s);
        // Add the marker at Layer in point
        layer.property("Marker").setValueAtTime(layer.inPoint, marker);
    }
}
//
app.beginUndoGroup("Label Time Stretched Layers");

var selectedItems = app.project.selection;
for (var i = 0; i < selectedItems.length; i++) {
    var comp = selectedItems[i];
    if (comp instanceof CompItem) {
        for (var j = 1; j <= comp.numLayers; j++){
            var layer =  comp.layer(j);
            getStretch(layer);
            }
        }
    }
app.endUndoGroup();