Skip to main content
Known Participant
April 20, 2010
Answered

How to get the multiple layers data

  • April 20, 2010
  • 1 reply
  • 963 views

Hi,

I have imported two jpg files in a single composition. Please follow this procedure ...

1. created a composition, say its name testCompo

2. Imported a file1.jpg into the project from File --> Import --> file

3. Imported a file2.jpg into the project from File --> Import --> file

4. Drag the both files, file1.jpg and file2.jpg, into the testCompo

Now, I have two layers (one is file1.jpg and onother is file2.jpg) in my testCompo. How can I get the pixel information or pixel data of the

both images (i.e, I mean layers).

I knew that params[0]->u.ld is the first layer data in

EntryPointFunc (
    PF_Cmd            cmd,
    PF_InData        *in_data,
    PF_OutData        *out_data,
    PF_ParamDef        *params[],
    PF_LayerDef        *output,
    void            *extra)

then what about the other layer data? So, finally how can we get the multiple images/layers data in AE?

thanks in advance!!

This topic has been closed for replies.
Correct answer shachar carmi

that's the thing.

you have to have a layer param (lets say it's param number 3).

the user uses that param to select any layer from the comp.

now you checkout param 3.

what you get is a paramDef structure, which contains the pixels of the layer param 3 is pointing to.

you'll find that data at:

paramDef->u.ld.data (or something close to that. i don't have it in front of me)

this way an effect on jpg1 can get the pixels from jpg2 and jpg3. any layer in the comp.

1 reply

Community Expert
April 20, 2010

if you're writing an EFFECT, you should use a layer param along with PF_CHECKOUT_PARAM.

if you're writing an AEGP, it's a bit more complex.

you should use AEGP_RenderAndCheckoutFrame, for which you'll have to find the project item you refer to.

Known Participant
April 21, 2010

I am developing Effect type plug-in.

you should use a layer param along with PF_CHECKOUT_PARAM.

Before check out a layer param, I should know the index of the layer param. Right?

I knew that zero the based index of PF_ParamDef *params[] is first layer, i.e., file1.jpg data.

But what about the file2.jpg? what is the index of this file2.jpg?

shachar carmiCommunity ExpertCorrect answer
Community Expert
April 21, 2010

that's the thing.

you have to have a layer param (lets say it's param number 3).

the user uses that param to select any layer from the comp.

now you checkout param 3.

what you get is a paramDef structure, which contains the pixels of the layer param 3 is pointing to.

you'll find that data at:

paramDef->u.ld.data (or something close to that. i don't have it in front of me)

this way an effect on jpg1 can get the pixels from jpg2 and jpg3. any layer in the comp.