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

AEIO plugin - OutSpecOptions

Guest
Nov 18, 2010 Nov 18, 2010

Copy link to clipboard

Copied

Hello,

I am in serious need of help.  The SDK doc is sparse with regards to AEIO in general and in particular the output options explanations are simply not clear enough.  I have spent several days trying to nail this, in which I've read the SDK doc repeatedly and scanned this forum and the web, to no avail.

Using AE CS5 10.0.1.19 on Win7 64bit.

The problem:

Following AE startup the previously saved output options for output modules referencing our plugin's settings are not restored.  Specifically, not in any invocation of AEGP_GetOutSpecOptionsHandle() in our plugin does it provide options that were saved previously.  I've traced all calls to it and not one provides the previously saved options.

Helpful details:

1. The plugin uses the following flags:AEIO_MFlag_OUTPUT | AEIO_MFlag_FILE | AEIO_MFlag_VIDEO | AEIO_MFlag_AUDIO | AEIO_MFlag_NO_TIME.

2. The plugin responds to the callback AEIO_UserOptionsDialog() by showing a dialog.  It starts by reading the current outH's output options using AEGP_GetOutSpecOptionsHandle() and showing them in the dialog.  Upon closing the dialog the user changes are stored in outspec options using AEGP_SetOutSpecOptionsHandle().

3. The plugin handles AEIO_InitOutputSpec() by creating new memory using AEGP_NewMemHandle() and assigns it to output options using AEGP_SetOutSpecOptionsHandle().

4. The plugin handles AEIO_DisposeOutputOptions() by simply calling AEGP_FreeMemHandle() on the provided handle.

5. The plugin handles AEIO_GetFlatOutputOptions() by copying the contents of the provided outH's output options to a new handle created by AEGP_NewMemHandle() and assigns the new handle to *optionsPH.

Interesting clues:

The SDK doc refers to the TIFF plugin in the section about AEOP_UserOptionsDialog() so I investigated it, rather intensely.  The TIFF.aex plugin's output options are stored in two places of the Prefs file, under  ["Output File Options Preference Section v23"] and ["PIN Output Options Preference Section"].  To learn more I manually tweaked the settings for the TIFF.aex in the Prefs file under ["Output File Options Preference Section v23"] and the changes are reflected in the GUI following the subsequent AE restart, this is the desired result, Hurray!!  This is not true for ["PIN Output Options Preference Section"].  Interestingly, our plugin's output options are stored under ["PIN Output Options Preference Section"] but NOT ["Output File Options Preference Section v23"].

What am I doing wrong?  Please help I've been stuck on this for 3 days.

Please provide specific details of the required responses to the AEIO output callbacks, including examples and correct call sequences.

MirandaTech

TOPICS
SDK

Views

2.3K

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
Advisor ,
Nov 23, 2010 Nov 23, 2010

Copy link to clipboard

Copied

Hi there,

It turns out the IO sample project in the AE SDK wasn't demonstrating this setting and getting of AEIO_OutSpecH very well.  I've made a few modifications, and can now get the data in AEIO_OutSpecH to persist from the AEIO_InitOutputSpec() call to AEIO_UserOptionsDialog(), which proves that it can work.

In My_InitOutputSpec(), part of the problem in the sample is that PretendToReadFileHeader() is called before AEGP_LockMemHandle().  Instead, AEGP_LockMemHandle should be called first, followed by PretendToReadFileHeader().  This is so the file information will be read into the memory referenced by the handle, and then the handle will be set as the OutSpec.

Next, in My_UserOptionsDialog(), you can replace the body with this:

    A_Err                err            = A_Err_NONE;
    AEGP_SuiteHandler    suites(basic_dataP->pica_basicP);
    AEIO_Handle            optionsH    = NULL;
    IO_FileHeader        *fileP;

    ERR(suites.IOOutSuite4()->AEGP_GetOutSpecOptionsHandle(outH, reinterpret_cast<void**>(&optionsH)));
    if (!err){
        ERR(suites.MemorySuite1()->AEGP_LockMemHandle(optionsH, reinterpret_cast<void**>(&fileP)));

        basic_dataP->msg_func(1, "Add your user options dialog here by\rimplementing the My_UserOptionsDialog function\rand then saving the results to the output spec.");

        ERR(suites.MemorySuite1()->AEGP_UnlockMemHandle(optionsH));
    }

    return err;

This will unpack the AEIO_OutputSpecH into the IO_FileHeader structure, and you can verify in the debugger that the values set in My_InitOutputSpec() do persist to My_UserOptionsDialog().

Hope this helps.

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
Guest
Nov 24, 2010 Nov 24, 2010

Copy link to clipboard

Copied

Thank you for the response, however I had already worked through these problems and am able to make it work so that option data is preserved between invocations of the UserOptionsDialog in one instance of AE.  The trouble is making the options preserve with the output module after closing AE and opening it again.

As stated in my original post:

"The problem:

Following AE startup the previously saved output options for output modules referencing our plugin's settings are not restored.  Specifically, not in any invocation of AEGP_GetOutSpecOptionsHandle() in our plugin does it provide options that were saved previously.  I've traced all calls to it and not one provides the previously saved options."

Please re-read my original post as the critical parts of the problem are all explained there.

If any information is missing I will promptly respond as this has become urgent for us.

Thank you very much. 

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
Engaged ,
Nov 24, 2010 Nov 24, 2010

Copy link to clipboard

Copied

Not a direct answer to why AE is behaving the way it is, but you could save the settings to the prefs file yourself using AE's Persistent Data API.

The API is easy to use, and it saves your settings in a standard location, rather than you having to invent your own prefs file. You can create your own AE prefs section and entries as you see fit.

Bob Currier

Synthetic Aperture

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
Guest
Nov 24, 2010 Nov 24, 2010

Copy link to clipboard

Copied

I ruled that out because I have no way to key the data associated with an output module.

In more detail, in order to make this work I need to have separate settings for each output module using our plugin, thus there needs to be a key with which to associate the option data.  I have yet to find a way to obtain a suitable key using the information provided, ie. the AEIO_BasicData, AEIO_OutSpecH parameters.  The obvious key would be the output module name, but how is that found?  I don't know.  I've looked.

I like the idea, however, it should work correctly per the SDK documentation.  We have proof positive the mechanism works in the TIFF.aex, as I mentioned in my original post.

If necessary I will use your idea if I can get a valid key.

Thank you very much for your input.

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
Advisor ,
Nov 24, 2010 Nov 24, 2010

Copy link to clipboard

Copied

Hi there,

Just wanted to let you know that this is on my todo list, and I will be investigating this further as time allows.

Regards,

Zac

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
Guest
Nov 25, 2010 Nov 25, 2010

Copy link to clipboard

Copied

That leads me to believe that you think it's a bug in After Effects?  I was thinking it isn't because the tiff.aex works as advertised. Maybe all it takes is reviewing the code of tiff.aex to see what it's doing.  I get the feeling I'm very close to getting it to work, likely missing just one or two calls or perhaps a flag somewhere.

With respect and realizing I'm out of line, if possible we would like to have this cleared up by end of next week because we have an important demo for a large customer the week after.

Either way thank you very much.

MirandaTech

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
Advisor ,
Dec 02, 2010 Dec 02, 2010

Copy link to clipboard

Copied

LATEST

Hi there,

I've got the SDK IO plug-in into better shape, so that it demonstrates this saving and restoring of the output settings when quitting and restarting AE.  I've sent the updated files to you privately.  I'm also "cc'ing" the forums here, for any who many want to know the details.

One of the big changes I made was in AEIO_GetFlatOutputOptions().  There, it now retrieves the existing output options handle using GetOutSpecOptionsHandle(), creates a flattened copy, and passes that copy back.  This flattened output options data is what's passed into AEIO_InitOutputSpec().

AEIO_InitOutputSpec() should handle the case of having valid flattened output options data available via GetOutSpecOptionsHandle().  I've added that case in the code.  But it should also be prepared to start from no output options, which would happen if there was none saved in the current project or in the prefs.  You can delete the prefs to test that case by holding down Ctrl-Alt-Shift when launching AE.

Hope this helps,

Zac

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