6 Replies Latest reply on Nov 6, 2017 11:21 AM by Bruce Bullis

    Component API in Premiere Pro CC2017?

    sberic Level 3

      I noticed that the CC2017 update to Premiere Pro brought in a new Component API, which provides access to Clip Keyframes. Awesome.


      The problem is that the API isn't documented. The nearest thing to documentation is Bruce Bullis' "Play With Keyframes" PProPanel sample. However, as used in that sample, the specifics about the API are super vague.


      With most other Premiere APIs, the ExtendScript Toolkit's Object Model Viewer provides you with useful information like expected types or whether a value is readonly. The Component API is mysteriously missing from the Object Model Viewer, however. The only indication that it exists at all is that the TrackItem class contains a readonly components property of type ComponentCollection. I dove into this a little bit with some test scripts and was able to determine a bit more information about the APIs but I've not figured out everything. At this point I'd simply like to get input from those-in-the-know, rather than push for diminishing returns.


      I've codified what I've found (and combined it with some info gleaned from the PProPanel project) into the TypeScript typings listed below. I'm pretty certain I've got ComponentCollection, Component, and ComponentParamCollection figured out. The ComponentParam class, however, contains a lot of incomplete information. By default I marked everything with no function parameters and a void return type.


      declare class ComponentCollection
          readonly numItems: number;
      declare class Component
          readonly displayName: string;
          readonly matchName: string;
          readonly properties: ComponentParamCollection;
      declare class ComponentParamCollection
          readonly numItems: number;
      declare class ComponentParam
          readonly displayName: string;
          addKey(): void;
          areKeyframesSupported(): boolean;
          findNearestKey(): void;
          findNextKey(): void;
          findPreviousKey(): void;
          getKeys(): Array<Time>;
          getValue(): number;
          getValueAtKey(): void;
          isEmpty(): boolean;
          isTimeVarying(): boolean;
          keyExistsAtTime(): boolean;
          removeKey(): void;
          removeKeyRange(startTimeSeconds:number, endTimeSeconds: number, shouldUpdateUI: boolean): void;
          setInterpolationTypeAtKey(): void;
          setTimeVarying(varying: boolean): void;
          setValue(): void;
          setValueAtKey(): void;


      Could someone in the know help fill in the blanks here?