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

SDK - A_time and other data types

Engaged ,
Feb 23, 2023 Feb 23, 2023

Hi

 

I'm having some problems understanding the data types in the SDK. Like A_time, A_FpLong etc. I can't see a description of them in the reference. Is there anywhere I can find a list and documentation on them?

 

In my specific case, which is simply some tests, I am trying to convert the result of  AEGP_GetItemCurrentTime to a A_FpLong value holding it's current time in seconds. I do this, but get an error: "no operator "[]" matches these operands".

 

ERR(suites.ItemSuite6()->AEGP_GetItemCurrentTime(itemH, &currT));
A_FpLong currentTime = &currT[0] / &currT[1];

 

 

Any help is much appreciated.

- Jakob

 

Update: So right after posting I found the answer for my second question. I can do this:

ERR(suites.ItemSuite6()->AEGP_GetItemCurrentTime(itemH, &currT));
A_FpLong currentTime = currT.value / currT.scale;

But I'm still not sure how i could have read that out of the reference. This one should be updated, right? https://ae-plugins.docsforadobe.dev/index.html

TOPICS
SDK
922
Translate
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

correct answers 1 Correct answer

Community Expert , Feb 23, 2023 Feb 23, 2023

is see you resolved your specific issue but generally speaking most AE  SDK types are not documented in the pdf, so it's always a good idea to look at the headers. if you right click any AE type and select "go to definition" you'll jump to the header where the type is defined. for example, you'll see Pf_fp_long and defined a s a double.

Translate
Participant ,
Feb 23, 2023 Feb 23, 2023

Here is some code that might help. It's written in Objective C. Enjoy!

 

+ (A_TimetimeFromSeconds😞CFTimeInterval)seconds {

     AEGP_CompH comp = [self activeComposition];

     A_FpLong framerate = [self framerateFromComp:comp];

     A_FpLong timescale = framerate * 100;

     A_Time time = {seconds * timescale, timescale};

     return time;

}

 

+ (A_FpLongframerateFromComp😞AEGP_CompH)comp {

     A_FpLong framerate = 0;

 

     if (comp) {

          AEGP_SuiteHandler suites([self basicSuite]);

          suites.CompSuite10()->AEGP_GetCompFramerate(comp, &framerate);

     }

 

     return framerate;

}

Translate
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
Participant ,
Feb 23, 2023 Feb 23, 2023

Ha! Well it turned some of my parenthesis into sad faces in the previous post, but you get the idea!  🙂

Translate
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 ,
Feb 23, 2023 Feb 23, 2023

Haha! Sometimes I want to put sad faces all over my code as well. LOL. Thanks.

Still interested in some documentation for the data types though.

Translate
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
Community Expert ,
Feb 23, 2023 Feb 23, 2023

is see you resolved your specific issue but generally speaking most AE  SDK types are not documented in the pdf, so it's always a good idea to look at the headers. if you right click any AE type and select "go to definition" you'll jump to the header where the type is defined. for example, you'll see Pf_fp_long and defined a s a double.

Translate
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 ,
Feb 23, 2023 Feb 23, 2023

Of course. Yes, that will do it. Thanks.

Translate
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
Adobe Employee ,
Feb 23, 2023 Feb 23, 2023
LATEST

Hi @Jakob Wagner 2048,

 

Note that A_Time values are rationals and thus do not map exactly into floating point so you may end up with off-by-one frame issues depending on how the floating point time values are used. If you need precision then I suggest doing your time operations directly with rationals.

 

Cheers,

Jason

Translate
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