Quantcast
Channel: Adobe Community : Popular Discussions - After Effects SDK
Viewing all articles
Browse latest Browse all 73444

Hiding layers, seems possible, but getting errors

$
0
0

Me again, asking weird questions...

 

I would like to hide some utility layers in a comp, generated by my plugin.  There are a couple threads related to this topic:

Hiding layers using shyguy and javascript:

http://forums.adobe.com/message/5775496#5775496

 

Hiding layers using AEGP_SetDynamicStreamFlag

http://forums.adobe.com/message/2809938#2809938

 

I chose to use the SetDynamicStreamFlag method.

I hacked up a version of the SDK's example AEGP 'Commando' and added the following logic to the CommandHook function:

------------

ERR(suites.ItemSuite6()->AEGP_GetActiveItem(&active_itemH));

ERR(suites.CompSuite4()->AEGP_GetCompFromItem(active_itemH, &compH));

ERR(suites.LayerSuite5()->AEGP_GetCompNumLayers(compH, &num_layersL));

 

 

for (iL = 0; !err && iL < num_layersL; iL++) {

    ERR(suites.LayerSuite5()->AEGP_GetCompNumLayers(compH, &temp_numLayersL));

    ERR(suites.LayerSuite5()->AEGP_GetCompLayerByIndex(compH, iL, &layerH));

    ERR(suites.DynamicStreamSuite4()->AEGP_GetNewStreamRefForLayer(NULL, layerH, &streamH));

    //the following cmd causes AE to raise an error.

    ERR(suites.DynamicStreamSuite4()->AEGP_SetDynamicStreamFlag(streamH, AEGP_DynStreamFlag_HIDDEN, FALSE, TRUE));

    ERR2(suites.StreamSuite4()->AEGP_DisposeStream(streamH));

    streamH = NULL;

}

------

 

It is *working* in CS6, but it is also throwing an error when I perform the AEGP_SetDynamicStreamFlag.  The error is:

After Effects error: internal verification failure, sorry! {asked for invalid component of property path}

 

The layers however do become hidden, although I have to run the plugin multiple times to get it to hide all the layers in the comp.  I think the raised error is breaking the loop I implemented in the above code.

BTW, This seems to work for a variety of layers, footage layers, cameras, and solids are all hiding.  The only downside is this error that happens everytime.

 

MindManju said he was able to make this work in the related thread, but didn't mention getting an error.  I'm assuming I'm just doing something wrong here.

I would of replied to the thread, but its pretty old and I wasn't sure what the proper forum etiquette is when dealing with old threads.

Any help is appreciated!

 

thx

-Andy

 

ps: yes I am still pretty green to the SDK and C/C++.  I'm sure I probably am doing something wrong in that example code


Viewing all articles
Browse latest Browse all 73444

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>