• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Code sample and video on how to SetWorkArea in a Sequence

Adobe Employee ,
Aug 04, 2022 Aug 04, 2022

Copy link to clipboard

Copied

Hi all you SDK’ers,

Today a question came across our desk here at CEP World Headquarters, and I thought that the answer might be worth posting here. 

The original question was along the lines of; "I’m trying to get the current work area, and to set a specific work area." Keep in mind that this is not edit, "In" and "Out" points, but rather what is shown in the Work Area Bar above the timeline (click the hamburger menu beside the Sequence Name) Screen Shot 2022-08-04 at 2.26.11 PM.png

This value is needed by the API to send a render job to Adobe Media Encoder - so we know that the original user is up to something clever, and we are here for that kind of thing.

@Bruce Bullis and I made an example today of changing the work area in a sequence. Here is a screen recording with annotations, https://shared-assets.adobe.com/link/409e388d-b3cc-4392-7721-0288ba5d71a9 â€” and the code snippet we used is below. There is also a section on modifyWorkArea in the PPro Sample Panel on github

We hope some of you find it useful. Thanks for developing for Premiere Pro.

-Dan

 

 

 

var seq = app.project.activeSequence;
if (seq) {
    var currStateString = "undefined";
    var currState = seq.isWorkAreaEnabled();
    if (currState) {
        currStateString = "ON";
    } else {
        currStateString = "OFF";
        seq.setWorkAreaEnabled(true);
    }

    var oldIn 		= seq.getWorkAreaInPointAsTime();
    var oldOut 		= seq.getWorkAreaOutPointAsTime();
    var newIn 		= oldIn;
    var newOut 		= oldOut;
    var duration 	= oldOut.seconds	- oldIn.seconds;
    newIn.seconds 	= oldIn.seconds		+ 2;
    newOut.seconds 	= oldOut.seconds	- 2;

    seq.setWorkAreaInPoint(newIn.seconds);
    seq.setWorkAreaOutPoint(newOut.seconds);

    var doubleCheckIn = seq.getWorkAreaInPointAsTime();
    var doubleCheckOut = seq.getWorkAreaOutPointAsTime();
}

 

 

 

 

 

TOPICS
How to , SDK

Views

281

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
community guidelines
Community Expert ,
Mar 20, 2024 Mar 20, 2024

Copy link to clipboard

Copied

Thanks for sharing, Dan!

I tried and could get the workarea details just fine, but could not set them.

 

A colleague just told me that that there is a bug #DVAPR-4239719

which reports that you can only set the workarea via scripting API after a user has set the workarea manually before.

Can you confirm that this bug is still not fixed?

 

I also noticed that 

app.project.activeSequence.setWorkAreaEnabled(false);

does not make the workarea bar disappear from the active sequence on my machine (Mac OS, Pr 24.2.1). Even if I manually changed the workarea before. However, if I close and then open the timeline, the workarea is hidden as expected. So it is probably just a matter of the UI not updating properly.

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

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
community guidelines
Adobe Employee ,
Mar 20, 2024 Mar 20, 2024

Copy link to clipboard

Copied

[DVAPR-4239719 is not fixed.]

Votes

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
community guidelines
Community Expert ,
Mar 20, 2024 Mar 20, 2024

Copy link to clipboard

Copied

LATEST

Thanks for the confirmation, Bruce!

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

Votes

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
community guidelines