Highlighted

AEGP_GetActiveLayer & AEGP_GetLayerNumEffects

Explorer ,
Aug 15, 2020

Copy link to clipboard

Copied

This is a continuation of my previous post, but I thought I would simplify the issue as its a different one. I have some code in GlobalSetup that runs when an effect is added to a layer. So, the layer and the effect would be the active ones. This simple code should give me num_effects=1 and a valid layerH. layerH is valid but I get num_effectsL always as 0. What am I doing wrong ?

 

 

ERR(suites.LayerSuite5()->AEGP_GetActiveLayer(&layerH));
// Return num_effectsL = 0
ERR(suites.EffectSuite2()->AEGP_GetLayerNumEffects(layerH, &num_effectsL));

 

  Conversely, getting the active item and the no of layers in the comp gets the right no of layers. So this following code works.

 

// This works
ERR(suites.ItemSuite8()->AEGP_GetActiveItem(&active_itemH));
if (active_itemH)
  ERR(suites.ItemSuite8()->AEGP_GetItemType(active_itemH, &item_type));
ERR(suites.CompSuite4()->AEGP_GetCompFromItem(active_itemH, &compH));
ERR(suites.LayerSuite5()->AEGP_GetCompNumLayers(compH, &num_layersL));

 

TOPICS
SDK

Views

48

Likes

Translate

Translate

Report

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

AEGP_GetActiveLayer & AEGP_GetLayerNumEffects

Explorer ,
Aug 15, 2020

Copy link to clipboard

Copied

This is a continuation of my previous post, but I thought I would simplify the issue as its a different one. I have some code in GlobalSetup that runs when an effect is added to a layer. So, the layer and the effect would be the active ones. This simple code should give me num_effects=1 and a valid layerH. layerH is valid but I get num_effectsL always as 0. What am I doing wrong ?

 

 

ERR(suites.LayerSuite5()->AEGP_GetActiveLayer(&layerH));
// Return num_effectsL = 0
ERR(suites.EffectSuite2()->AEGP_GetLayerNumEffects(layerH, &num_effectsL));

 

  Conversely, getting the active item and the no of layers in the comp gets the right no of layers. So this following code works.

 

// This works
ERR(suites.ItemSuite8()->AEGP_GetActiveItem(&active_itemH));
if (active_itemH)
  ERR(suites.ItemSuite8()->AEGP_GetItemType(active_itemH, &item_type));
ERR(suites.CompSuite4()->AEGP_GetCompFromItem(active_itemH, &compH));
ERR(suites.LayerSuite5()->AEGP_GetCompNumLayers(compH, &num_layersL));

 

TOPICS
SDK

Views

49

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 15, 2020 0
zcream LATEST
Explorer ,
Aug 17, 2020

Copy link to clipboard

Copied

On further debugging, I open a project with an effect on Layer 1. I add an effect to Layer 0, and that runs this code.

On Layer 0, it finds 0 effects, and on Layer 1 it finds the correct number - 1 effect.

I opened a fresh project, added a solid and my effect on the solid. The code does not detect any effect. So, running GlobalSetup() with this code will not detect any newly added effects.

ERR(suites.EffectSuite2()->AEGP_GetLayerNumEffects(layerH, &num_effectsL));

 Any ideas why?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 17, 2020 0