Premiere 26.3 API Updates

Hi all,

With the release of Premiere 26.3 we’re happy to share a new set of updates for Premiere’s UXP APIs. You can see all this on the Premiere 26.3 Changelog and our updated API doc pages.

Breaking Changes

Sequence.setSelection

The Sequence.setSelection method is now synchronous: calling this will immediately return a boolean value instead of a Promise<boolean>.

If you are using this API with async/await, simply remove the use of await:

  const project = await ppro.Project.getActiveProject();
  const sequence = await project.getActiveSequence();
  const selection = await sequence.getSelection();

- const success = await sequence.setSelection(selection);
+ const success = sequence.setSelection(selection);

If you are using this API with Promise.then method chaining, you’ll need a bit more updating to avoid runtime issues, e.g.:

- sequence.setSelection(selection).then((success) => {
-   if (success) { ... }
- });
+ const success = sequence.setSelection(selection);
+ if (success) { ... }

Action creation in locks

Creating Action instances through the various create*Action functions must now be done so while behind a project.lockedAccess(() => { ... }) call. Previously this wasn’t consistently enforced across create*Action calls.

const audioTrack: AudioTrack = ...

project.lockedAccess(() => {
  // Create the action here...
  const action = audioTrack.createSetNameAction("MyAudioTrack");

  project.executeTransasction((compoundAction: CompoundAction) => {
    // ...and use it here
    compoundAction.addAction(action);
  }, "Rename AudioTrack");
});

Creating Actions within a lockedAccess call is important: many Actions contain data that can quickly become stale or inconsistent with other actions that might take place in Premiere (e.g., an editor is making changes that might conflict with a UXP plugin operating at the same time). Using the lockedAccess makes sure these actions are sequenced and properly applied to the Undo history.

The new @adobe/eslint-plugin-premierepro ESLint plugin offers several rules which help catch these cases to help make sure Action creation and usage in your plugin follows best practices. For more information see the documentation pages for:

New APIs

A number of new APIs have been added in this release. More details on each can be seen in each class’s documentation page. If you’d like to see more examples of using all of these new APIs in action, check out the premiere-api sample panel in the UXP Premiere Pro Samples repository.

2 Likes