Skip navigation
afxjordan
Currently Being Moderated

Excluding Adjustment Layers from a Layer Param

Aug 10, 2012 7:32 AM

Is there any way I can do this?

 

If not, how can I detect if the selected layer is an adjustment layer?

 
Replies
  • Currently Being Moderated
    Aug 10, 2012 7:50 AM   in reply to afxjordan

    you can't tell a layer param to exclude adjustment layers.

    but you can tell if a layer is an adjustment layer using AEGP_GetLayerFlags with AEGP_LayerFlag_ADJUSTMENT_LAYER.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2012 3:15 PM   in reply to afxjordan

    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!

    :-)

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points