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

Formula for AE_Effect_Global_OutFlags and AE_Effect_Global_OutFlags2

Contributor ,
May 19, 2021 May 19, 2021

I'd like to keep all the magic numbers in PiPL.r file defined in a header. I have defined all except AE_Effect_Global_OutFlags and AE_Effect_Global_OutFlags2.

@shacharstated in https://community.adobe.com/t5/after-effects/what-is-function-of-pipl-r-file-in-plugin-development/m...

 

put a break point in the global setup function and you'll be able to see the numerical value being applied to the outfalgs and outflags2 vars.

 

Sorry, this not a good workflow. Somewhere inside the AE headers will be the formula to calculate AE_Effect_Global_OutFlags and AE_Effect_Global_OutFlags2. Could AE support staff kindly look that up so that all the magic numbers inside PiPL.r files can be pre-calculated ?

TOPICS
SDK
1.7K
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 , May 19, 2021 May 19, 2021

you could do:

enum {

OUTFLAGS = PF_OutFlag_PIX_INDEPENDENT | PF_OutFlag_SEND_UPDATE_PARAMS_UI | PF_OutFlag_USE_OUTPUT_EXTENT | PF_OutFlag_DEEP_COLOR_AWARE,

OUTFLAGS2 = PF_OutFlag2_PARAM_GROUP_START_COLLAPSED_FLAG | PF_OutFlag2_FLOAT_COLOR_AWARE | PF_OutFlag2_SUPPORTS_SMART_RENDER | PF_OutFlag2_DOESNT_NEED_EMPTY_PIXELS,

};

Translate
Community Expert ,
May 19, 2021 May 19, 2021

i put the global outflags calculation in an enum, and include that header in the resource file (and it's custom build definitions).

that works well on VS, but on XCODE it doesn't. on XCODE i put the value in a #define.

so... half solved.

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
Contributor ,
May 19, 2021 May 19, 2021

 

I would assume that is about 100 enum values. I think there are about 10 different flags and there are a 100 different combos involved.

Would you consider posting the enum or define, and perhaps Adobe will consider documenting this in the SDK docs ?

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 ,
May 19, 2021 May 19, 2021
enum
{
MAJOR_VERSION	=	1,
MINOR_VERSION	=	6,
BUG_VERSION		=	0,
STAGE_VERSION	=	2,
BUILD_VERSION	=	0,
CALCULATED_RESOURCE_VERSION =	MAJOR_VERSION	* 524288	+
											MINOR_VERSION	* 32768		+
											BUG_VERSION		* 2048		+
											STAGE_VERSION	* 512		+
											BUILD_VERSION
};

#define RESOURCE_VERSION	721920

this way, when you hover over "CALCULATED_RESOURCE_VERSION" with the mouse pointer in VS, it  shows you the calculated value. then just copy it over to "RESOURCE_VERSION" and youre good for both platforms.

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
Contributor ,
May 19, 2021 May 19, 2021

Thanks. 🙂 But I think you mixed this with my previous question, which was answered.

This was related to AE_Effect_Global_OutFlags and AE_Effect_Global_OutFlags2

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 ,
May 19, 2021 May 19, 2021

ah yes.

but the same answer applies. just OR together the flags in an enum in the same manner.

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
Contributor ,
May 19, 2021 May 19, 2021

Is the hex value just the OR'ed version of all the flags ?

#define OUTFLAGS PF_OutFlag_PIX_INDEPENDENT | PF_OutFlag_SEND_UPDATE_PARAMS_UI | PF_OutFlag_USE_OUTPUT_EXTENT | PF_OutFlag_DEEP_COLOR_AWARE
#define OUTFLAGS2 PF_OutFlag2_PARAM_GROUP_START_COLLAPSED_FLAG | PF_OutFlag2_FLOAT_COLOR_AWARE | PF_OutFlag2_SUPPORTS_SMART_RENDER | PF_OutFlag2_DOESNT_NEED_EMPTY_PIXELS

So this is all thats needed ? I thought there was a magic number that is OR'ed as well.

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 ,
May 19, 2021 May 19, 2021

nope, no magic number. the OR is all you need. 🙂

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
Contributor ,
May 19, 2021 May 19, 2021

It doesnt work.

 

#define OUTFLAGS PF_OutFlag_PIX_INDEPENDENT | PF_OutFlag_SEND_UPDATE_PARAMS_UI | PF_OutFlag_USE_OUTPUT_EXTENT | PF_OutFlag_DEEP_COLOR_AWARE

#define OUTFLAGS2 PF_OutFlag2_PARAM_GROUP_START_COLLAPSED_FLAG | PF_OutFlag2_FLOAT_COLOR_AWARE | PF_OutFlag2_SUPPORTS_SMART_RENDER | PF_OutFlag2_DOESNT_NEED_EMPTY_PIXELS


		/* [10]  */
		AE_Effect_Global_OutFlags {
			OUTFLAGS
		},
		/* [11]  */
		AE_Effect_Global_OutFlags_2 {
			OUTFLAGS2
		},

 

I get compile error - 1>BlursPiPL.r
1>ParseAEGlobalFlags: CloseBrace Expected, line 7424

 

It works when I use the hex value directly. 0x6000440 and 0x001448

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 ,
May 19, 2021 May 19, 2021

you could do:

enum {

OUTFLAGS = PF_OutFlag_PIX_INDEPENDENT | PF_OutFlag_SEND_UPDATE_PARAMS_UI | PF_OutFlag_USE_OUTPUT_EXTENT | PF_OutFlag_DEEP_COLOR_AWARE,

OUTFLAGS2 = PF_OutFlag2_PARAM_GROUP_START_COLLAPSED_FLAG | PF_OutFlag2_FLOAT_COLOR_AWARE | PF_OutFlag2_SUPPORTS_SMART_RENDER | PF_OutFlag2_DOESNT_NEED_EMPTY_PIXELS,

};

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
Contributor ,
May 19, 2021 May 19, 2021

Thanks. I guess the pre-processor requires either a number or enum. If it does not work on OSX, as you mentioned - I could just try the define.

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 ,
May 19, 2021 May 19, 2021

but now when you hover over the enum entry you see the value without compiling and hitting a breakpoint, so you can easily copy the value to a parallel #define. i'm sure there are some possible pre-processor shenanigans you can do to pull it off, but when it's all located in one small and convenient code block it really becomes a non issue imho.

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
Contributor ,
May 19, 2021 May 19, 2021

I spoke too early - the enum causes runtime error.

 

enum {
OUTFLAGS = PF_OutFlag_PIX_INDEPENDENT | PF_OutFlag_SEND_UPDATE_PARAMS_UI | PF_OutFlag_USE_OUTPUT_EXTENT | PF_OutFlag_DEEP_COLOR_AWARE,
OUTFLAGS2 = PF_OutFlag2_PARAM_GROUP_START_COLLAPSED_FLAG | PF_OutFlag2_FLOAT_COLOR_AWARE | PF_OutFlag2_SUPPORTS_SMART_RENDER | PF_OutFlag2_DOESNT_NEED_EMPTY_PIXELS
};

 

mismatch.JPG

 

mismatch2.JPG

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
Contributor ,
May 19, 2021 May 19, 2021
LATEST

This is the problem - The preprocessor runs before the compiler knows about your enum. The preprocessor only knows about macros .

 

And PF_OutFlagXX are defined as an enum.

Hence all these OR'ed #define's are evaluated as 0. I am still evaluating and will post the solution if available.

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