Premier scripting

New Here ,
Dec 09, 2020

Copy link to clipboard

Copied

Hello, I have a question about scripting in Premiere.

I want to separate parts of an existing sequence into other sequences. So I want to keep the initial sequence and I want to create more sequences that contain the parts of the main sequence. In these subsequences I want to add a MoGraph at the end and export the sequence.

The parts are marked by hand and the remaining steps should be automated.

I'm ready to create subsequences from the marker sections, but I can't manage to add anything else to these subsequences. So how do I get the MoGraph into the right sequences. Thas my code right now...

 

app.enableQE();

var numMarkers = app.project.activeSequence.markers.numMarkers;
var markers = app.project.activeSequence.markers;
var markAry = [];
var currentMarker;
var access_bin = app.project.rootItem.createBin("00_Clips")
var sequence = app.project.activeSequence;

 

//create Sequencen
for(a=0;a<numMarkers;a++){
var tempAry = [];
if(a==0){
currentMarker = markers.getFirstMarker();
tempAry.push(currentMarker.name);
tempAry.push(currentMarker.start.seconds);
tempAry.push(currentMarker.end.seconds);
tempAry.push(currentMarker.type);
tempAry.push(currentMarker.comments);
markAry.push(tempAry);
}
if(a>0){
currentMarker = markers.getNextMarker(currentMarker);
tempAry.push(currentMarker.name);
tempAry.push(currentMarker.start.seconds);
tempAry.push(currentMarker.end.seconds);
tempAry.push(currentMarker.type);
tempAry.push(currentMarker.comments);
markAry.push(tempAry);
}

sequence.setInPoint (markAry[a][1])
sequence.setOutPoint(markAry[a][2])

var ignoreMapping = false
sequence.createSubsequence(ignoreMapping);
var targetSeq;
var numItems = app.project.rootItem.children.numItems;
var bin_name = "00_Clips";

 

//Add mographs

var numItems = app.project.rootItem.children.numItems;
for (var i=0;i<numItems;i++){
var targetSeq = app.project.rootItem.children[1].children[i];
var vidTrack = 2;
var audTrack = 2;
var localPath = "C:/Users/XXX/Creative Cloud Files/tra.mogrt"
alert(targetSeq.getProjectMetadata)
var oldIn = seq.getWorkAreaInPointAsTime();
var oldOut = seq.getWorkAreaOutPointAsTime();
var duration = seqOut.seconds - seqIn.seconds;
alert(duration)
seq.importMGT(localPath,duration-0.25, vidTrack, audTrack)

 

 

And how do i change a sequence to an active sequence?

And can i rename a Subsequence?

I'm new to this field and I still have a lot of questions ... It's a little confusing. Could someone help me? I would be grateful for any help. 🙂

 

> how do i change a sequence to an active sequence?

app.project.activeSequence is read/write; you can assign to it. 

 

app.project.activeSequence = myCoolNewSubSequence;

 

And can i rename a Subsequence?

Yes; sequence names are also read/write. 

TOPICS
SDK

Views

62

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

Premier scripting

New Here ,
Dec 09, 2020

Copy link to clipboard

Copied

Hello, I have a question about scripting in Premiere.

I want to separate parts of an existing sequence into other sequences. So I want to keep the initial sequence and I want to create more sequences that contain the parts of the main sequence. In these subsequences I want to add a MoGraph at the end and export the sequence.

The parts are marked by hand and the remaining steps should be automated.

I'm ready to create subsequences from the marker sections, but I can't manage to add anything else to these subsequences. So how do I get the MoGraph into the right sequences. Thas my code right now...

 

app.enableQE();

var numMarkers = app.project.activeSequence.markers.numMarkers;
var markers = app.project.activeSequence.markers;
var markAry = [];
var currentMarker;
var access_bin = app.project.rootItem.createBin("00_Clips")
var sequence = app.project.activeSequence;

 

//create Sequencen
for(a=0;a<numMarkers;a++){
var tempAry = [];
if(a==0){
currentMarker = markers.getFirstMarker();
tempAry.push(currentMarker.name);
tempAry.push(currentMarker.start.seconds);
tempAry.push(currentMarker.end.seconds);
tempAry.push(currentMarker.type);
tempAry.push(currentMarker.comments);
markAry.push(tempAry);
}
if(a>0){
currentMarker = markers.getNextMarker(currentMarker);
tempAry.push(currentMarker.name);
tempAry.push(currentMarker.start.seconds);
tempAry.push(currentMarker.end.seconds);
tempAry.push(currentMarker.type);
tempAry.push(currentMarker.comments);
markAry.push(tempAry);
}

sequence.setInPoint (markAry[a][1])
sequence.setOutPoint(markAry[a][2])

var ignoreMapping = false
sequence.createSubsequence(ignoreMapping);
var targetSeq;
var numItems = app.project.rootItem.children.numItems;
var bin_name = "00_Clips";

 

//Add mographs

var numItems = app.project.rootItem.children.numItems;
for (var i=0;i<numItems;i++){
var targetSeq = app.project.rootItem.children[1].children[i];
var vidTrack = 2;
var audTrack = 2;
var localPath = "C:/Users/XXX/Creative Cloud Files/tra.mogrt"
alert(targetSeq.getProjectMetadata)
var oldIn = seq.getWorkAreaInPointAsTime();
var oldOut = seq.getWorkAreaOutPointAsTime();
var duration = seqOut.seconds - seqIn.seconds;
alert(duration)
seq.importMGT(localPath,duration-0.25, vidTrack, audTrack)

 

 

And how do i change a sequence to an active sequence?

And can i rename a Subsequence?

I'm new to this field and I still have a lot of questions ... It's a little confusing. Could someone help me? I would be grateful for any help. 🙂

 

> how do i change a sequence to an active sequence?

app.project.activeSequence is read/write; you can assign to it. 

 

app.project.activeSequence = myCoolNewSubSequence;

 

And can i rename a Subsequence?

Yes; sequence names are also read/write. 

TOPICS
SDK

Views

63

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
Dec 09, 2020 0
Adobe Employee ,
Dec 09, 2020

Copy link to clipboard

Copied

> how do i change a sequence to an active sequence?

app.project.activeSequence is read/write; you can assign to it. 

 

app.project.activeSequence = myCoolNewSubSequence;

 

And can i rename a Subsequence?

Yes; sequence names are also read/write. 

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...
Dec 09, 2020 0
New Here ,
Dec 10, 2020

Copy link to clipboard

Copied

Thank you very much! I did it, it works 🙂

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...
Dec 10, 2020 0