Is there any way I can do this?
If not, how can I detect if the selected layer is an adjustment layer?
How can I use the AEGP_GetLayerFlags with a layer from the layer param? I looked in the Artie example plugin and it seems like a very convoluted process. I feel like I need to learn more about the AE SDK. It's going over my head.
Could you run me through how to use this function with a layer parameter? What steps are necessary and why is each step necessary?
ok.
so the end game is to get the layer flags.
to get that, we need a layer handle (AEGP_LayerH).
but the layer param doesn't hold a layerH, it holds a layer ID,
so we need to get the layerH using the layerID.
for that we need the comp handle (compH).
why?
because the layer id resides in a certain comp, so we need to reference it.
to get the compH, we need our own layer.
why?
because an effect can't tell in which comp it's at, but it can tell on which layer it's at, and a layer can tell which comp it's at.
got it?
good.
let's boogie:
//getting the layer our effect is on.
ERR(suites.PFInterfaceSuite1()->AEGP_GetEffectLayer(in_data->effect_re f, &selfLayerH));
//now we can get the comp we're at.
ERR(suites.LayerSuite4()->AEGP_GetLayerParentComp(selfLayerH, &compH));
//now let's look for our target layer
//we start by getting our effect's own effectH
ERR(suites.PFInterfaceSuite1()->AEGP_GetNewEffectForEffect(NULL, in_data->effect_ref, &effectH));
//so now we can find the streamRef for the layer param
ERR(suites.StreamSuite2()->AEGP_GetNewEffectStreamByIndex(NULL, effectH, MY_LAYER_PARAM, &streamH));
//we're getting there...
//we can now get the value of the layer param
ERR(suites.StreamSuite2()->AEGP_GetNewStreamValue(NULL, streamH, AEGP_LTimeMode_LayerTime, &timeT, FALSE, &valueP));
//so close...
//converting the layer ID gotten from the value of the layer param, to a layerH.
ERR(suites.LayerSuite5()->AEGP_GetLayerFromLayerID(compH, valueP.val.layer_id, &targetLayerH));
//and finally, getting the target layer's flags!
ERR(suites.LayerSuite5()->AEGP_GetLayerFlags(targetLayerH, &layer_flags));
HORRAY!
now dispose of everything you worked so hard to get!
:-)
North America
Europe, Middle East and Africa
Asia Pacific