Skip to main content
thirdmenson
Participating Frequently
January 19, 2019
Question

How to stop AE caching every param change output?

  • January 19, 2019
  • 1 reply
  • 1064 views

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;

This topic has been closed for replies.

1 reply

thirdmenson
Participating Frequently
January 25, 2019

Hey Shachar could you please reply.

Community Expert
January 25, 2019

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?

thirdmenson
Participating Frequently
January 26, 2019

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.