Skip navigation
Currently Being Moderated

Dummy importer

Jun 22, 2013 9:55 AM

Tags: #text #importer_api

Hi folks,

 

I'm trying to write a dummy importer that would essentially only put a file pointer in the project for reference and archival purposes, like FCP XML translations results text file which gets imported into the project.

 

I thought that perhaps setting hasVideo and hasAudio as false would do the job, but I keep getting the "Importer returned generic error" in Premiere and "file cannot be imported - this file is damaged or unsupported".

 

Currently the entry function looks like this:

     switch (selector)
     {
          case imInit:
               result =     SDKInit(stdParms, 
                                        reinterpret_cast(param1));
               break;

          case imGetInfo8:
               result =     SDKGetInfo8(stdParms, 
                                             reinterpret_cast(param1), 
                                             reinterpret_cast(param2));
               break;

          case imGetIndFormat:
               result =     SDKGetIndFormat(stdParms, 
                                                  reinterpret_cast(param1),
                                                  reinterpret_cast(param2));
               break;

          case imGetIndPixelFormat:
               result = imUnsupported;
               break;

          // Importers that support the Premiere Pro 2.0 API must return malSupports8 for this selector
          case imGetSupports8:
               result = malSupports8;
               break;

     }

     return result;
}

 

And only these 3 selectors are supported:

imInit

imGetFormat

imGetIndFormat

 

imInit and imGetIndFormat work fine, because the importer is added to the list, and attempts to open the file. And the imGetFormat looks like this:

 

          prMALError                         result                    = malNoError;

     SDKFileInfo8->hasAudio               = kPrFalse;
     SDKFileInfo8->hasVideo               = kPrFalse;


     return result;

 

Obviously I'm missing something, can anyone help me?

 
Replies
  • Currently Being Moderated
    Jun 23, 2013 8:06 PM   in reply to walczakb

    IIRC you have to have one or both of hasVideo and hasAudio true.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 24, 2013 8:19 PM   in reply to walczakb

    Hi walczakb,

     

    That's an interesting concept to add an importer for these files, but as Rallymax points out, the importer API is for video and/or audio.  Since you can just drag-and-drop a .txt file into the Project panel, it's possible you could make a script that sends .txt files to PPro.  Does that fit what you're trying to do?

     

    See this thread for importing a file using scripting - http://forums.adobe.com/thread/1177191

     

    Zac

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2013 1:54 PM   in reply to walczakb

    I believe Trapcode Form's .obj support is implemented using an AEIO plug-in (from the After Effects SDK).  The AEIO probably exposes the 3D info via aux data, and the effect gets the aux data via PF_ChannelSuite which it uses for rendering.  The Premiere importer API doesn't support aux data, so I'm not sure if you were thinking of another mechanism in mind to pass non-visible frame data from the importer to an effect...?

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 27, 2013 10:23 AM   in reply to walczakb

    Oh I see.  The Synth_Importer is used for stuff like Color Mattes and Universal Counting Leaders, which reference no actual file on disk.  Since you want to reference a file, it'd be better to start from the SDK_File_Importer sample.  Granted, there will be more code to trim out for your purposes, but you'll be working with actual files on disk.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 27, 2013 2:24 PM   in reply to walczakb

    One missing piece is in SDKGetInfo8, it doesn't specify the dimensions of the video. (This is not needed in Synth_Import because that defaults to the dimensions of the current sequence)  GetInfo8 is where the importer tells PPro details about the file it is about to import.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 28, 2013 10:09 AM   in reply to walczakb

    True, you'd need to handle opening the file in imOpenFile8, as well as imQuietFile and imCloseFile.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points