Copy link to clipboard
Copied
Hi guys,
I am working on an after effects plugin and for now I only have two params for testing purposes. What I am noticing is ae is caching the ouput image for every param change, even just when scrubbing the slider. How can I disable this? Another thing that happens is if I change the param fast it gives wrong ouput (e,g rotating a model will have wrong rotation param applied) and that combined with caching every param change output results in a very glitchy output animation. If I press ctrl and use the slider to change the param than I get correct results but fast param change gives me incorrect result possibly because the param changes so fast that the plugin is unable to render and copy it back to ae buffer within that time? Or maybe I need to render lower res while the param is changing (scrubbing)? but how do I detect that the param is changing?
Trying to solve the param caching problem I have tried both smart render and regular render entrypoint and these flags and I can't get it to work.
PF_OutFlag_PIX_INDEPENDENT |
PF_OutFlag_USE_OUTPUT_EXTENT |
PF_OutFlag_DEEP_COLOR_AWARE |
PF_OutFlag_NON_PARAM_VARY |
PF_OutFlag_FORCE_RERENDER;
Copy link to clipboard
Copied
Hey Shachar could you please reply.
Copy link to clipboard
Copied
in regards to making AE not cache frames, that's actually a user preference. AE caches whatever it can, so if a certain effect's param settings have gone back to a previous state, the render output would already be cached and no render would be needed. AE decides when to purge such frames. why would you not want that?
if you absolutely MUST disable that behavior for your plug-in only, you can sabotage the cache in 2 ways:
make all your params supervised, and on USER_CHANGED_PARAM :
1. set some random value into your sequence data, and during pre-render set it using GuidMixInPtr().
2. change some hidden param's value to a random value.
both methods would create a new unique state on every user interaction that AE doesn't have it's output cached. so previous setting WILL be cached but won't be used. on method 1, they won't be used even if the user uses undo to rerturn to previous states.
as for the glitchy behavior, i have never encountered such behavior.
is sounds to me like your algorithm is not handling re-entrancy and is stepping on it's own toes. can that be the case?
Copy link to clipboard
Copied
Thanks for the reply.
After your reply what I have realized is I need to fix first why is incorrect frame being rendered first when the params change fast like scrubbing. If the correct frames was being rendered then there would no need for me to try to disable caching frames. I am not sure why I am getting incorrect results, maybe by the time my plugin renders and tries to copy data back to ae buffer, render request for another frame is already in the way and I get incorrect render? Do i need to call PF_ABORT before rendering and copying data back to ae buffer?
If I am unable to fix this then I will try your suggested steps to sabotage the caching.
Copy link to clipboard
Copied
you call PF_ABORT to check if AE wants you to stop the current render.
if indeed you aborted the render, you need to report
back PF_Interrupt_CANCEL as an error code, so AE would know the output
buffer is not be used.
On Sat, Jan 26, 2019 at 9:35 PM thirdmenson <forums_noreply@adobe.com>
Copy link to clipboard
Copied
I am doing this: ERR(PF_ABORT(in_data));
Can you provide example code how to report PF_Interrupt_CANCEL if ae wants to stop current render?
Copy link to clipboard
Copied
Here is an example crash I get when I hit space bar to play, it crashes when it's trying to render fast. In this case it show crash when trying to read camera values but it used to crash when playback even before read camera code was in there. Most of the times I get no useful stack trace while crashing in either Bee.dll or msvcr120.dll access violation reading location 0xFFFFFFFFFFFF

Copy link to clipboard
Copied
this is definitely some reentrancy/stack overflow/buffer overrun issue.
invalidating the cache is the least of your worries...
only for the sake of testing, try putting a mutex lock in your entry point
function. if the crashes and bad frames go away, it's a re-entrancy issue.
(but for the love of god, don't keep the mutex after that test...)
On Sat, Jan 26, 2019 at 10:23 PM thirdmenson <forums_noreply@adobe.com>
Copy link to clipboard
Copied
I tried adding a mutex lock at the beginning of the render entry point and unlock it at the end of it and it still crashes on playback.
I must say the graphics library I am using expects to be called from a single thread and I am just calling it in the render entry point which is a single thread.
I do see this explanation in the sdk: PF_Interrupt_CANCEL : " Both effect and AEGP callbacks can return this to effects, if a user action aborts a render. If the effect gets this error from a callback, it should stop processing the frame and return the error to the host. Failure to pass the error back may result in misrendered frames being cached. "
Which fits what is happening in my case. This ERR(PF_ABORT(in_data)); won't report correct error back? How do I detect his abort and return PF_Interrupt_CANCEL? Can you provide an example code.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more