Copy link to clipboard
Copied
Hey, I was hoping someone could help me understand PiPL versions. I have had some problems with a warning flag when I apply my plugin in after effects, getting a warning flag that says:
"effect has version mismatch. Code version is 2.0 and PiPL version is 2.0 (108600) (25 :: 16)"
This is a pretty unhelpful message as 2.0 == 2.0.
I've found I can make the error go away if I dutifully replicate the header and pipl versioning found on the adobe sdk examples, but this is kind of annoying and I'd like to understand it better.
To load without error, my PiPL resource looks like this:
AE_PiPL_Version { 2, 0 },
AE_Effect_Version { 1048577 } /* 2.0 */
and my plugin header looks like this:
#define MAJOR_VERSION 2
#define MINOR_VERSION 0
#define BUG_VERSION 0
#define STAGE_VERSION PF_Stage_DEVELOP
#define BUILD_VERSION 1
I'm guessing the "code version" the warning refers to is a concatenation of major and minor versions, and it seems the "PiPL version" the warning is reporting comes from AE_Effect_Version (1048577) and NOT AE_PiPL_Version (2,0).
If I change ANY of the values in the plugin header (not just major/minor versions), I get the warning. So I suspect the AE_Effect_Version number is some kind of a hash of all the version info (major, minor, bug, stage, build versions), and that the warning is a bit misleading.
Can anyone explain more about that number, 1048577? Is it some kind of hex value? Thanks!
When I first started trying to figure out the versions in the PiPL it was kicking my butt, so here are my notes on how to figure out the number for the effect version:
RESOURCE_VERSION =
MAJOR_VERSION * 524288 +
MINOR_VERSION * 32768 +
BUG_VERSION * 2048 +
STAGE_VERSION * 512 +
BUILD_VERSION
So for your setup of
#define MAJOR_VERSION 2
#define MINOR_VERSION 0
#define BUG_VERSION 0
#define STAGE_VERSION
...Copy link to clipboard
Copied
When I first started trying to figure out the versions in the PiPL it was kicking my butt, so here are my notes on how to figure out the number for the effect version:
RESOURCE_VERSION =
MAJOR_VERSION * 524288 +
MINOR_VERSION * 32768 +
BUG_VERSION * 2048 +
STAGE_VERSION * 512 +
BUILD_VERSION
So for your setup of
#define MAJOR_VERSION 2
#define MINOR_VERSION 0
#define BUG_VERSION 0
#define STAGE_VERSION PF_Stage_DEVELOP // this is a 0 from the enum in AE_Effect.h
#define BUILD_VERSION 1
it would be:
RESOURCE_VERSION =
2 * 524288 +
0 * 32768 +
0 * 2048 +
0 * 512 +
1
Which would yierd you: 1048577
So it would end up being:
AE_Effect_Version {
1048577
}
Hopefully that helps
Copy link to clipboard
Copied
Works exactly as you said, thanks!
I might make a little script to generate the AE_Effect_Version automatically, make life easier.
thanks again!
Copy link to clipboard
Copied
I'm actually trying to script this now, and am running into the issue that the Code Version does not match the PiPL version even though the error message shows they are the same.
effect "My Effect" has version mismatch. Code version is 1.2 and PiPL version is 1.2 (9001a) (25 :: 16)
I created a new header file containing the defines used for versioning. I created this separate header file so I can write to it during a pre-build phase using my IDE--either Xcode or Visual Studio 2013. That file looks like this:
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUG_VERSION 0
#define STAGE_VERSION 0
#define BUILD_VERSION 1
#define RESOURCE_VERSION 524289 //Used in PiPL file
Then I include this header in my effect's main header file
...
#include "Version_Info.h"
...
Then I use the defined RESOURCE_VERSION term in my PiPL file like so
AE_Effect_Version {
RESOURCE_VERSION
}
This method works with the defines declared above, but if I change any of the values and alter the RESOURCE_VERSION to the numerical representation according the thenes formula, I get an error. There is code in my effect's PF_Cmd_GLOBAL_SETUP function that sets outdata->my_version like so:
out_data->my_version = PF_VERSION( MAJOR_VERSION,
MINOR_VERSION,
BUG_VERSION,
STAGE_VERSION,
BUILD_VERSION);
Not sure if that has anything to do with the "mismatch", but I'm at a loss for how I can easily update the version of my plugin at build time. Any suggestions?
Thanks,
Arie
Copy link to clipboard
Copied
if you're on windows, you have to erase to .rc file, and only then will the
compiler create a new updated one from the .r file.
On Tue, Jan 7, 2014 at 5:08 PM, Arie Stavchansky
Copy link to clipboard
Copied
Well, for this project I'm on XCode. Does the compiler / linker cache files or something?
Copy link to clipboard
Copied
not that i know of.
try putting the number instead of the macro in the .r file.
either if it solves it or not it will guide us where to look for the
problem.
Copy link to clipboard
Copied
Okay, when I place the number it appears to work. I get no error when opening a file that contains the effect applied to a layer.
So, I upped the MINOR_VERSION value again and switched on the macro (instead of the number) and then got the error showed up again--this time it showed that the Code Version was upped but the PiPL version remained the same as the prior build.
I think there is something going on with the way XCode processes the .r file that is causing the problem. I suspect that XCode may not "reprocess" the .r file (using Rez) until it notices the file has changed in some manner. Not sure how to begin investigating that. . .
There must be some switch somewhere in the build process that allows me to process the .r file regardless.
Copy link to clipboard
Copied
Alright, so I think I discovered the issue. There is some kind of caching going on when it comes to compiling the .r file in XCode. If, from XCode's main menu, I select Product > Clean, and then build the error is not reported when I load up a project in AE. So, I assume that because I am now using a Macro in the PiPL file for the AE_Effect_Version, XCode doesn't regard the file as "changed" even though I changed the values in the separate header file.
So my question is: is it possible to always "clean" before building in XCode?
--Arie
Copy link to clipboard
Copied
i'm personally not a big xcode fan and i try to do my work on visual studio
as much as possible...
i don't know how to make it clean on each build, but i'm pretty sure
youdon't want that. not for the sake of a version bump, which is a rather
rare thing.
i use keyboard shortcuts:
cmd + shift + k = clean
cmd + b = build
cmd + r = build + run
Copy link to clipboard
Copied
I definitely hear that and agree that I should avoid doing it. I think in the shell script for the pre-build phase, I will use the "touch" command against the .r file so by the time the compiler does it's magic, the file will have been updated-so-to-speak. Might be a while until I figure out if that works, but I'll post back here.
Copy link to clipboard
Copied
So using the following script prior to the actual build phase will do the trick to ensure that the .r file gets processed.
So in the editing the "Scheme" of the target in Xcode, I click on the "Build" tab, then open it's twirly, and then click on "Pre-actions" and enter in the script there. Looks like this:
That seems to do the trick, but now I'm running into an issue where I think there may be limitation as to the integers we can use for the BUILD_VERSION. See, while I agree that changing the MAJOR_VERSION and MINOR_VERSION is rare, I do think the end product should ship with an id that refers to a development build. I want to use BUILD_VERSION for that ID, and plan on adding 1 to the integer defined by BUILD_VERSION each time I build the source. It seems to be working fine, except in some cases. For example, if I use 999 for BUILD_VERSION, I get the mismatch error, but if I use 9 for BUILD_VERSION the mismatch error does not appear.
Are there any limitation to the length or format for BUILD_VERSION? I did notice that PF_VERSION is expecting BUILD_VERSION to be an unsigned int 32, but eh. . .
Not sure why some numbers work for the BUILD_VERSION, but others do not. Any ideas?
Copy link to clipboard
Copied
this is the resource version broken down to english:
RESOURCE_VERSION =
MAJOR_VERSION * 524288 +
MINOR_VERSION * 32768 +
BUG_VERSION * 2048 +
STAGE_VERSION * 512 +
BUILD_VERSION
each param can not exceed the defference in value from itself and the one
above it.
so build version can only be between 0 and 511.
Copy link to clipboard
Copied
Thank you Shachar, you are right. Once I cross the 511 threshold the mismatch error comes back, but when I use any number below 511 the mismatch error no longer appears.
Thanks much for your guidance and time!
--Arie
Copy link to clipboard
Copied
no problem.
😄
Copy link to clipboard
Copied
each param can not exceed the defference in value from itself and the one above it.
so build version can only be between 0 and 511.
So, I'm back at this and was curious, by this logic, the following values would not work for the params:
MAJOR_VERSION=4
MINOR_VERSION=5
STAGE_VERSION=6
Effectively making the version 4.5.6? Shouldn't that be allowable? I've been trying to do this but I still get the version mismatch error when I apply the plugin effect.
Copy link to clipboard
Copied
The stage version may only be 3 bits and is not intended for your use. See AE_Effect.h, PF_Stage_* enum.
Copy link to clipboard
Copied
I have the same issue. i updated my graphics driver and my (sapphire and boris continium) plugin started showing version mismatch error in after effects 2018.please can anyone help with a solution?