Skip navigation
Currently Being Moderated

Anchor Point on Layer Parameter?

Dec 28, 2011 3:47 PM

This seems so basic, what am I overlooking?


In my Effect plug-in, you can access layer parameters. I'd like to position them relative to their anchor point (rather than the center, or the top left, or other guess).


I only see accessors from the AEGP_StreamSuite4, but I've never been clear if these were usable from an effect. If so, how do you convert a PF_Layer to a AEGP_LayerH?


Anyway. Can my Effect plug-in get a layer's anchor point?



  • Currently Being Moderated
    Dec 28, 2011 5:48 PM   in reply to david van brink

    You can get the AEGP_LayerH of the layer to which effect is applied using AEGP_GetEffectLayer in PFInterfaceSuite. After that, use the StreamSuite to get the Anchor Point.


    Hope that helps.

    Mark as:
  • Currently Being Moderated
    Dec 29, 2011 12:49 AM   in reply to david van brink

    Not sure I understand well, but if you want to access anchor Point from a layer selected in the Layer Params, here is the way.


    Get the effect layer, as described above. Then get the parent comp using AEGP_GetLayerParentComp in Layer Suite. Then get the AEGP_LayerH of that layer param using AEGP_GetCompLayerByIndex. That'll give you access to all the streams.

    Mark as:
  • Currently Being Moderated
    Dec 29, 2011 12:07 PM   in reply to david van brink

    Oh, I understand now. To do that, you have to get the AEGP_StreamVal2 of that parameter using StreamSuite. It is a union which contains the AEGP_LayerIDVal, for a layer parameter. Then use the AEGP_GetLayerFromLayerID in the LayerSuite to get the AEGP_LayerH.


    Not sure if it will be bad, since AE smartly updates many things on the AEGP side even during rendering. A few things like Layer Names, AEGP_MaskRefs don't get updated so frequently, but Layer Parameter Streams are usually well up-to-date. I haven't tried this out yet, so I really can't tell.

    Mark as:
  • Currently Being Moderated
    Dec 30, 2011 2:34 AM   in reply to david van brink

    here's a dirty way of making AE re-render your effect when some other layer's anchor point changes:

    create an invisible param (there's a ui flag for that when creating the pram),

    and then put an expression on it linking it to the value of the anchor (or whatever you like) of the layer in your layerParam.


    that's it.

    your param's value will now change whenever the anchor of the other layer changes, and that will trigger a re-render of you effect.

    Mark as:
  • Currently Being Moderated
    Dec 30, 2011 9:17 AM   in reply to david van brink

    elementary my dear watson.


    //on the hidden param:

    myEffect= thisProperty.propertyGroup(1);

    //myEffect("name of layerParam").index;//this is the index of the layer if you need it.

    myEffect("name of layerParam").anchorPoint;//or just go for the data and get it over with


    that it.


    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