PremierePro:Migrating from CEP to UXP: Community API Gap & Issue Summary

First and foremost, a huge thank you to the Adobe development team for their hard work on the UXP platform!

As Premiere Pro’s UXP is still in its Beta phase, many developers are encountering challenges and missing APIs while migrating their existing CEP extensions.

This thread serves as a community-driven summary of the specific APIs and functionalities that are currently missing or difficult to implement in UXP compared to CEP. Please share the interfaces you need and describe the hurdles you’re facing. I will periodically collect, organize, and summarize these points to help provide a clear overview for everyone.

By sharing our experiences, we can help contribute to making UXP plugins even more powerful and robust.

Suggested Format for Submissions:

  • Required API/Functionality:
  • Description & Use Case:
  • Current UXP Alternative (if any):
  • Additional Notes / Challenges:

We look forward to your feedback! Let’s help each other build a better UXP ecosystem.

3 Likes

Cannot set entry and exit points for sequences, and AME must be installed to export audio

export async function setInOutPoint(project: Project) {
  if (!project) {
    log(`No project found.`, "red");
    return;
  }
  const inPoint = ppro.TickTime.createWithSeconds(2);
  const outPoint = ppro.TickTime.createWithSeconds(4);
  const clipProjectItem = await getClipProjectItem(project);

  let success = false;
  try {
    project.lockedAccess(() => {
      success = project.executeTransaction((compoundAction) => {
        let action = clipProjectItem.createSetInOutPointsAction(
          inPoint,
          outPoint
        );
        compoundAction.addAction(action);
      }, "createSetInOutPointsAction");
    });
  } catch (err) {
    log(`Error: ${err}`, "red");
    return false;
  }

  return success;
}

This code only works on video clips but does not function properly on Sequences. Moreover, the following methods:

  createSetInPointAction(tickTime: any): Action	//Returns an action which Sets the in point of the Project item
  createSetOverridePixelAspectRatioAction(inNumerator: any, inDenominator: any): Action	//Returns an action which sets Override pixel aspect ratio
  createSetOverrideFrameRateAction(inOverriddenFrameRateValue: any): Action	//Returns an action which sets the override frame rate
  createSetOutPointAction(tickTime: any): Action	//Returns an action which Sets the in point of the Project item
  createSetInOutPointsAction(inPoint: TickTime, outPoint: TickTime): any	//Set the in or out point of the Project item
  createClearInOutPointsAction(): Action	//Create Clear the in or out point of the Project item action

have no effect.

For example, I cannot use this code to set in and out points, and can only render the entire content.

let encoder = await app.EncoderManager.getManager();
if (!encoder.isAMEInstalled) {
  result.code = 203;
  result.msg = 'no_ame_installed';
  return result;
}
const render = await encoder.exportSequence(
  sequence /*@ts-ignore*/,
  app.Constants.ExportType.IMMEDIATELY, // export in Premiere Pro
  data.mp3Path, // file path to export to
  data.eprPath // preset file
);

Moreover, it requires AME to be installed, but I recall that in the CEP environment, AME is not required.

I have imported the SRT subtitle file using project.importFiles. Now how do I add it to the timeline?

export declare type SequenceEditor = {
  createRemoveItemsAction(
    trackItemSelection: object,
    ripple: boolean,
    mediaType: object,
    shiftOverLapping?: boolean
  ): action; //Create remove action for sequence
  createInsertProjectItemAction(
    projectItem: ProjectItem,
    time: TickTime,
    videoTrackIndex: number,
    audioTrackIndex: number,
    limitShift: boolean
  ): Action; //Create insert ProjectItem into Sequence Action
  createOverwriteItemAction(
    projectItem: ProjectItem,
    time: TickTime,
    videoTrackIndex: number,
    audioTrackIndex: number
  ): Action; //Create overwrite Sequence with ProjectItem Action
  createCloneTrackItemAction(
    trackItem: any,
    timeOffset: any,
    videoTrackVerticalOffset: number,
    audioTrackVerticalOffset: number,
    alignToVideo: boolean,
    isInsert: boolean
  ): Action; //Create insert or overwrite to timeline with clone of input trackItem action. Input should be offset value in comparison to original input trackItem's time and track indexes
};

You would insert the .srt’s projectItem into the sequence.

Thank you for your response
This interface can be used in CEP to add SRT subtitles to the timeline,

activeSequence.createCaptionTrack(
projectItem,
0
Sequence.CAPTION_FORMAT_708
);

Are you saying that currently only manual addition is possible in uxp? Is there still an interface that can be implemented?

CEP:

  /**
   * Creates a new sequence from the source sequence's in and out points.
   * @param ignoreMapping If True the current selection, not track targeting, will determine
   * the clips to include in the new sequence.
   *
   * If there is no selection, track targeting determines which clips are included in the new sequence.
   */
  createSubsequence(ignoreMapping: Boolean): Sequence

  /**
   * Exports a new FCP XML file representing this sequence.
   * @param exportPath The full file path (with file name) to create.
   * @param suppressUI Optional; quiets any warnings or errors encountered during export.
   */
  exportAsFinalCutProXML(exportPath: string, suppressUI?: number): boolean

  /**
   * Premiere Pro exports the sequence immediately.
   * @param outputFilePath The output file path (with name).
   * @param presetPath The .epr file to use.
   * @param workAreaType Optional work area specifier.
   */
  exportAsMediaDirect(
    outputFilePath: string,
    presetPath: string,
    workAreaType?: WorkAreaType,
  ): string

  /**
   * Exports the sequence (and its constituent media) as a new PPro project.
   * @param path Output file path, including file name.
   */
  exportAsProject(exportPath: string): void

Can this function be implemented in UXP?

Yes, there is no createCaptionTrack() equivalent, yet; working on it. :slight_smile:

I’m away from my computer, but I believe we’ve added an equivalent for exportAsMediaDirect().

What about ExportAsFinalCutProXML and ExportAsProject? Is there a plan for this?

Yes! The plan = make sure all previously available functionality, remains available. [Calling conventions may need to be changed.]

1 Like