Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Cache Invalidation Caused by Unrelated Layer Parameters

New Here ,
Jun 05, 2025 Jun 05, 2025

I'm developing an ARB (After Effects custom parameter) that manages multiple layers.

 

Within the ARB, I store `AEGP_LayerID`s and use `AEGP_GetLayerFromLayerID` to retrieve `LayerH` handles. Then, I obtain frame data using the render suite. However, when the layer associated with a given ID changes (for example, a shape layer's path is modified), the cache is not invalidated the previously cached result is still used. This happens even though the visual content of the layer has clearly changed.

 

Since these layers are not referenced through effect parameters, After Effects doesn't automatically detect the dependency.

Is there a reliable way to detect changes in such unreferenced layers in order to manually invalidate the cache? Or is there a better or more robust alternative approach to ensure the cached results remain accurate?

TOPICS
SDK
136
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 06, 2025 Jun 06, 2025

In pre_render, can you store the data obtained from those layerH's inside the mix_guid_ptr? Then if any of it changes you will get another smart_render call. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 07, 2025 Jun 07, 2025

AEGP_WorldH textureLayerWorldH = NULL;
ERR(suites.RenderSuite5()->AEGP_GetReceiptWorld(layerFrameReceiptH, &textureLayerWorldH));
if (textureLayerWorldH) {
PF_EffectWorld textures;
ERR(suites.WorldSuite3()->AEGP_FillOutPFEffectWorld(textureLayerWorldH, &textures));
}

I use PF_EffectWorld from layerH during the SmartRender phase. As far as I understand, this is only possible during SmartRender, and it's not possible to obtain PF_EffectWorld during the PreRender phase. Am I mistaken?

In this case, it is impossible to mix_guid_ptr the data you do not get, so the method seems impossible.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 08, 2025 Jun 08, 2025

I was thinking mixing the layer2world matrix of the layerH, but it's not foolproof because the transform may not change but the pixels might. I think the only sure way would then be to have each tracked layer as layer params. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 08, 2025 Jun 08, 2025
LATEST

Thanks for thinking this through with me. I’ve reached a similar conclusion myself and am currently working with a temporary solution that resets the cache every frame, even though it's inefficient. I hope someone comes up with a more groundbreaking idea

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines