Copy link to clipboard
Copied
Hi
I have just completed my first custom control with arbitrary data. I felt very pleased.
Until my last bit of testing.
If I use the effect with my custom control, then save, then open the saved file by double clicking it, I get the following behaviour.
1) A popup message saying Your disk cache folder is on a drive that does not have enough available space to safely store the full amount specified in your preferences.
2) I click OK and the project loads.
3) When I swap from the project panel to the Effect controls panel AE enters a seemingly infinite loop of displaying dialogs saying After Effects Error : Not able to acquire AEFX Suite (516) (25:: 101).
The frustrating thing is that the same problems do not occur if I use File->Open or if I run AE in my debugger with the project file as a parameter following the AE executable path. This is making it very difficult to debug.
I wondered if there is a multithreading race problem that the debugger is disguising. I've tried to be very careful to check return values and buffer sizes so I'm hoping it's not a buffer overrun or pointer issue.
If anyone has any thoughts I would welcome them. Especially if anyone knows the what kind of interactions happen with plugins during project load.
Phil
Hi Shachar
I have had time now to properly test out variations of how things work. Here is a summary
In AECC2015 everything works perfectly.
In AECC2014, Drawbot Image Suite version 1 (the only version) and the Drawbot Surface Suite version 2 fail to load. Note that in AECC2015 version 2 is the current version, and therefore is the version that will be attempted to be loaded if you used the 2015 SDK with either AEFX_AcquireDrawbotSuites, AEFX_DrawbotSuitesScoper or passed kDRAWBOT_SurfaceSuite_Vers
...Copy link to clipboard
Copied
I have traced the bug to attempting to get the drawbotsuites for rendering my custom control. For some reason this is failing and as it does so it generates dialog boxes which happens in either an infinite loop or repeatedly that it might as well be.
I was using a AEFX_DrawbotSuitesScoper object to check them out, but I've just tried using AEFX_AcquireDrawbotSuites and got the same results. But however I do it, it is the line of code that checks out these suites that is causing my problems.
Is there any reason why this would fail sometimes.
Copy link to clipboard
Copied
is it failing during PF_Event "Draw", or are you using drawbot during some
other event/call?
On Wed, Nov 29, 2017 at 1:55 AM, philrosenberg2013 <forums_noreply@adobe.com
Copy link to clipboard
Copied
Hi Shachar
Yes, it is failing during PF_Event_DRAW, I'm just grabbing the suites at that moment when AE requests me to do the drawing - not before. I'm not saving any draw details to revive it.
The infinite looping is puzzling also - I think (although it is hard to tell for definite because I don't see the bug in the debugger) either AE may be sending me PF_Event_Draw over and over again or AEFX_AcquireDrawbotSuites must be looping to try to get the suites repeatedly. I've tried setting eventExtra->evt_out_flags |= PF_EO_HANDLED_EVENT even when suite acquisition fails, but the loop still occurs.
I almost feel like if I could supress the dialog then AE might just sort itself out after a while once initialisation is finished.
Is there a way to load the suites individually? I have an AEGP_SuiteHandler object and I can see suites.DrawbotSuiteCurrent(), but not the other suites that AEFX_AcquireDrawbotSuites check out.
Copy link to clipboard
Copied
i highly doubt it's about which specific suite is being loaded. this issue
rings a bell though...
on rare occasions, while your plug-in is executing, when a call your
plug-in makes to AE causes a nasty problem within AE, it will terminate
plug-in's execution immediately. it won't throw. your plug-in won't exit
it's call through the main entry point function. and then, AE would just
call your plug-in again.
in the debugger, that looks like AE is making nested or recursive calls to
your plug-in, but it's actually just repeated crashed calls.
to me, it happened when the in_data pointer i was using got mangled between
the entry point and where i used it. either the pointer got changed, or
there actually was a legitimate intermediate call to your entry point (such
as in the case of reading an arb param) which somehow invalidates your
in_data.
that's just my rang bell. you could simply disable chunks of your code
until you hit the actual cause...
Copy link to clipboard
Copied
Hmm
I have just tried defining individual suite variables. The following code does not compile
DRAWBOT_Suites *drawbotSuites =new DRAWBOT_Suites;
AEFX_AcquireDrawbotSuites(m_inData, m_outData, drawbotSuites);
DRAWBOT_SurfaceSuiteCurrent *surfaceSuite = drawbotSuites->supplier_suiteP;
DRAWBOT_SupplierSuiteCurrent * supplierSuite = drawbotSuites->surface_suiteP;
The variable types are taken directly from the definition of the DRAWBOT_suites struct. The compilation error is
1>error C2440: 'initializing' : cannot convert from 'DRAWBOT_SupplierSuite1 *' to 'DRAWBOT_SurfaceSuite2 *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>error C2440: 'initializing' : cannot convert from 'DRAWBOT_SurfaceSuite2 *' to 'DRAWBOT_SupplierSuite1 *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
So I think there is some mismatch somewhere regarding the current version of the suites - no idea how that can happen! But that seems like an avenue for investigation.
Copy link to clipboard
Copied
going on intuition, i don't think that's the issue. otherwise it wouldn't
have worked on non-loaded instances of your plug-in as well.
Copy link to clipboard
Copied
Aha!!!
That was the smoking gun I needed. When I double click an aep file it gets opened with AE CC 2014, whereas I am building with the AE CC 2015 SDK and my debugger is set to run AE CC 2015. I guess that the versions of the Drawbot Suites have updated between these versions? This would explain the problems I am seeing I think. I will test and see.
Is there a significant difference between the versions of these suites? Should I just request version 1? I cannot see mention of version 2 in the AE CC 2015 SDK docs.
Phil
Copy link to clipboard
Copied
errr... i had no idea there was a version 2... is there?
Copy link to clipboard
Copied
From DrawbotSuite.h in the 2015SDK
#define kDRAWBOT_SurfaceSuite "DRAWBOT Surface Suite"
#define kDRAWBOT_SurfaceSuite_Version1 1
#define kDRAWBOT_SurfaceSuite_Version2 2
#define kDRAWBOT_SurfaceSuite_VersionCurrent kDRAWBOT_SurfaceSuite_Version2
#define DRAWBOT_SurfaceSuiteCurrent DRAWBOT_SurfaceSuite2
typedef struct DRAWBOT_SurfaceSuite1 {
//Push the current surface state in stack. It should be popped to retrieve old state.
SPErr (*PushStateStack)( DRAWBOT_SurfaceRef in_surface_ref);
//Pop the last pushed surface state.
SPErr (*PopStateStack)( DRAWBOT_SurfaceRef in_surface_ref);
//Paint a rectangle with a color on the surface.
SPErr (*PaintRect)( DRAWBOT_SurfaceRef in_surface_ref,
const DRAWBOT_ColorRGBA *in_colorP,
const DRAWBOT_RectF32 *in_rectPR);
//Fill a path using a brush and fill type.
SPErr (*FillPath)( DRAWBOT_SurfaceRef in_surface_ref,
DRAWBOT_BrushRef in_brush_ref,
DRAWBOT_PathRef in_path_ref,
DRAWBOT_FillType in_fill_type);
//Other definitions removed for brevity in this post
//Get the transform of the surface state.
SPErr (*GetTransformToScreenScale)(DRAWBOT_SurfaceRef in_surface_ref,
float* out_scale);
} DRAWBOT_SurfaceSuite2;
typedef DRAWBOT_SurfaceSuite2 DRAWBOT_SurfaceSuite1; // At the time, the last function was Flush.
I can't claim to understand the internals of how suites work - they are a bit of a black box to me. And I'm not used to the C-style typedeffing of structs, so I'm not exactly sure what is going on there.
But I guess your response would be to just grab version 1 of the suites. I'll try that and report back
Copy link to clipboard
Copied
By individually checking out version 1 of all the drawbot suites I now no longer see the problem. I will have to work these changes through my rendering code, but I'm hopeful that this is the root of the issue.
I guess if there is no documented version 2 of the Drawbot surface suite and supplier suite then this is either a bug in the 2015 SDK or an undocumented backwards incompatible change. So if anyone else stumbles upon this thread and has similar symptoms, the issue is that as of the 2015 SDK DRAWBOT_SurfaceSuiteCurrent and DRAWBOT_SupplierSuiteCurrent (rightly or wrongly) give version 2, however AE2014 and previous only have version 1.
Copy link to clipboard
Copied
i'm trying to get a better understanding of what's going on there.
without executing through the debugger, what happens when you just open the
project on 2014 and on 2015?
Copy link to clipboard
Copied
Hi Shachar
I have had time now to properly test out variations of how things work. Here is a summary
In AECC2015 everything works perfectly.
In AECC2014, Drawbot Image Suite version 1 (the only version) and the Drawbot Surface Suite version 2 fail to load. Note that in AECC2015 version 2 is the current version, and therefore is the version that will be attempted to be loaded if you used the 2015 SDK with either AEFX_AcquireDrawbotSuites, AEFX_DrawbotSuitesScoper or passed kDRAWBOT_SurfaceSuite_VersionCurrent when loading the suite.
Here is the bit that causes the really big problem though. If using either AEFX_AcquireDrawbotSuites or AEFX_DrawbotSuitesScoper, then when the suite loading fails an error message is put in out_data->return_msg. When the plugin returns control to AE a dialog is displayed showing the message. The user presses OK and focus returns to the main AE window. This appears to trigger a rerender of the custom control, the plugin again attempts to load the suite and generates another dialog box with the same error message and when the user presses OK it triggers another rerender........... INFINITE LOOP!
It is also worth adding that AEFX_AcquireDrawbotSuites and by extension AEFX_DrawbotSuitesScoper provide pointers to 6 suites. However only 4 are actually initialised. DRAWBOT_PenSuite and DRAWBOT_ImageSuite are both left as uninitialized pointers.
Copy link to clipboard
Copied
good work!!
i'm glad you found the reason for the infinite loop. these are always fun...
and thanks for posting back your findings. that's how the common knowledge
base is built.
![]()
Copy link to clipboard
Copied
alternatively, are you trying to save drawbot object in your custom data
and then "revive" them after re-launching AE and loading the project?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more