Skip to main content
Richard Rosenman
Inspiring
August 11, 2025
Question

How to get a layer's offset from frame 0 (SDK)?

  • August 11, 2025
  • 2 replies
  • 217 views

Hi gang;

 

I have a plugin that does it's thing via checking out another layer.

 

If I grab the effect layer in the timeline (the colored bar) and shift it left or right, to have my effect start earlier or later, it doesn't. It just starts the effect midway through. This is because the effect relies on the composition's current frame.

 

As such, I think I need to find a function that returns the offset that the layer has been shifted in the timeline. So if I were to shift the layer 5  frames earlier in the timeline, I need a function that returns that. I saw in the SDK there is AEGP_GetLayerOffset:

 

Get the offset from the start of the composition to
layer time 0, in composition time.
AEGP_GetLayerOffset(
AEGP_LayerH layerH,
A_Time *offsetPT);

 

Is this what I would want? I tried to find some examples of how to use this but didn't find any. Any suggestions?

 

I'm not sure I was able to convey what I'm after but hopefully so.

 

Thanks,

-Rich

2 replies

Community Expert
August 13, 2025

AEGP_GetLayerInPoint and AEGP_GetLayerOffset will do the job.

Participant
August 11, 2025

I think what you need to do is 1rst calculate your layer starting time and range, and then work around this data.

To do that you have the inPoint and the outPoint layer propreties (thisComp.layer("layer").inPoint). With that you can have the starting and ending time of your layer in the current composition time.

https://ae-scripting.docsforadobe.dev/layer/layer/?h=inpoint#layerinpoint

Did I understood your problem?

Richard Rosenman
Inspiring
August 11, 2025

Hi Gaspacho;

 

Thanks for your reply. I am working with the SDK though, not scripting, so I am looking for help in that department.

 

Regards,

-Richard