Copy link to clipboard
Copied
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 ?
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,
};
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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 ?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
ah yes.
but the same answer applies. just OR together the flags in an enum in the same manner.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
nope, no magic number. the OR is all you need. 🙂
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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,
};
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
};
Copy link to clipboard
Copied
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.