Highlighted

JS script stopped to work after upgrade to Premiere PRO 2020

Community Beginner ,
Jul 27, 2020

Copy link to clipboard

Copied

Hi!

We have some custom scripts that speed up our pipeline. One of them do not work in Premiere 2020. It works perfect in previous versions of Premiere. What may be the reason? The window of script appears, it starts to work, but the main part - export of files do not occur. Here is the part of code:

function export_by_upper_track()
{
var proj = app.project;
message='export_by_upper_track';
app.setSDKEventMessage(message, 'info');
ver=app.version.substring(0,2);
//message="%USERPROFILE%"+"\\Documents\\Adobe\\Adobe Media Encoder\\"+ver+".0\\Presets"

epr_path=$.getenv('USERPROFILE')+"\\Documents\\Adobe\\Adobe Media Encoder\\"+ver+".0\\Presets\\prof.epr"
app.setSDKEventMessage(epr_path, 'info');


if (!app.project.rootItem) return "rootItem is not available";
{
var activeSequence = app.project.activeSequence;
if (activeSequence) {
var foundTarget = false;
var vTrack = activeSequence.videoTracks[activeSequence.videoTracks.numTracks-1];
}
clips=vTrack.clips.numItems
message='clips'+clips;
app.setSDKEventMessage(message, 'info');
outPreset = new File(epr_path);
var format_ext=activeSequence.getExportFileExtension(outPreset.fsName);

message='ext='+format_ext;
app.setSDKEventMessage(message, 'info');

var outputPath = Folder.selectDialog("Choose the output directory");

// The code works OK up to this line - then nothing happened, the value of var clip is correct


for (var i = 0; i < clips; i++) {
start=vTrack.clips[i].start;
end=vTrack.clips[i].end;
message=start;
app.setSDKEventMessage(message, 'info');
message=end;
app.setSDKEventMessage(message, 'info');
activeSequence.setInPoint(start);
activeSequence.setOutPoint(end);
name=outputPath.fsName+"\\"+vTrack.clips[i].name+"."+format_ext;
message=name;
app.setSDKEventMessage(message, 'info');
activeSequence.exportAsMediaDirect(name, epr_path, app.encoder.ENCODE_IN_TO_OUT)
}

}
}

Yes, it works:

app.enableQE(); ///
qe.setDebugDatabaseEntry("ScriptLayerPPro.EnableNewWorld", "false"); //

Great!

 

Topics

Error or problem, SDK

Views

48

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

JS script stopped to work after upgrade to Premiere PRO 2020

Community Beginner ,
Jul 27, 2020

Copy link to clipboard

Copied

Hi!

We have some custom scripts that speed up our pipeline. One of them do not work in Premiere 2020. It works perfect in previous versions of Premiere. What may be the reason? The window of script appears, it starts to work, but the main part - export of files do not occur. Here is the part of code:

function export_by_upper_track()
{
var proj = app.project;
message='export_by_upper_track';
app.setSDKEventMessage(message, 'info');
ver=app.version.substring(0,2);
//message="%USERPROFILE%"+"\\Documents\\Adobe\\Adobe Media Encoder\\"+ver+".0\\Presets"

epr_path=$.getenv('USERPROFILE')+"\\Documents\\Adobe\\Adobe Media Encoder\\"+ver+".0\\Presets\\prof.epr"
app.setSDKEventMessage(epr_path, 'info');


if (!app.project.rootItem) return "rootItem is not available";
{
var activeSequence = app.project.activeSequence;
if (activeSequence) {
var foundTarget = false;
var vTrack = activeSequence.videoTracks[activeSequence.videoTracks.numTracks-1];
}
clips=vTrack.clips.numItems
message='clips'+clips;
app.setSDKEventMessage(message, 'info');
outPreset = new File(epr_path);
var format_ext=activeSequence.getExportFileExtension(outPreset.fsName);

message='ext='+format_ext;
app.setSDKEventMessage(message, 'info');

var outputPath = Folder.selectDialog("Choose the output directory");

// The code works OK up to this line - then nothing happened, the value of var clip is correct


for (var i = 0; i < clips; i++) {
start=vTrack.clips[i].start;
end=vTrack.clips[i].end;
message=start;
app.setSDKEventMessage(message, 'info');
message=end;
app.setSDKEventMessage(message, 'info');
activeSequence.setInPoint(start);
activeSequence.setOutPoint(end);
name=outputPath.fsName+"\\"+vTrack.clips[i].name+"."+format_ext;
message=name;
app.setSDKEventMessage(message, 'info');
activeSequence.exportAsMediaDirect(name, epr_path, app.encoder.ENCODE_IN_TO_OUT)
}

}
}

Yes, it works:

app.enableQE(); ///
qe.setDebugDatabaseEntry("ScriptLayerPPro.EnableNewWorld", "false"); //

Great!

 

Topics

Error or problem, SDK

Views

49

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Employee ,
Jul 27, 2020

Copy link to clipboard

Copied

If you try the same function calls with New World OFF, do they work correctly? 

If so, I think you've run into DVAPR-4225070: "Cannot adjust in point / out point of a trackItem, with New World ON".

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Jul 27, 2020

Copy link to clipboard

Copied

I'll try tomorrow! THank you!

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Community Beginner ,
Jul 28, 2020

Copy link to clipboard

Copied

Yes, it works:

app.enableQE(); ///
qe.setDebugDatabaseEntry("ScriptLayerPPro.EnableNewWorld", "false"); //

Great!

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...