Copy link to clipboard
Copied
hi,everyone!
I'm now facing a problem about checkout different layer data. I have read the example project "checkout",and I can get frames of a video in different time using PF_CHECKOUT_PARAM. In this example, I also see a function PF_CheckoutLayerChannel which can get the data PF_ChannelChunk chunk, but I know little of PF_ChannelChunk from the After_Effects_SDK_Guide, so as the datatype PF_ChannelRef and PF_ChannelDesc. What I want to do is input two different videos in AE and get the correspondding frames of them seperately, How can I do it ?
Any suggestions are welcome!
Thank you!
Hi again,
I think you can try to change the default value in your case PF_ADD_LAYER("Source", 2, SOURCE);
I've never tried, so you'll have to... But it should work, if and only if you have at least 2 layers in your comp. And there is no way that I know to check how many layers you have when you apply the effect...
But definitely, prefer PF_ADD_LAYER to PF_ADD_SLIDER. A layer parameter is automatically updated by AE when you change layer's index, add a layer, etc... Also, it only shows "selectable l
...
Copy link to clipboard
Copied
Well,maybe this question is too wide.So could anyone please tell me whether I'm on the right way? using PF_CheckoutLayerChannel to get get the corresponding frames of two input videos seperately?
Any suggestions will be highly appreciate!
Thank you!
Copy link to clipboard
Copied
hi,everyone,The problem can be described like this, I have two videos in my timeline window, but when I use PF_CHECKOUT_PARAM, I can only get the data of first video which is shown in the composition window, How can I checkout the second layer,I was stuck several days,could anybody help me? any suggestion will be highly appreciate!!!
Copy link to clipboard
Copied
Hi,
I might be wrong, but I think you need to use a Layer parameter, then checkout this parameter.
Or did I misunderstood the problem?
Cheers,
François
Copy link to clipboard
Copied
Hi,François
Thanks for your reply!
Yes, I do use a Layer parameter, but in the user guide, it devoted that maybe I can only checkout the current layer, that means that I can only checkout the layer which index is "1" in the timeline window? How to find a way to checkout the layer under the current layer? or can I choose a layer to be current layer?
Cheers,
Heng
Copy link to clipboard
Copied
Hi Heng,
let me explain in details. You probably don't need that much info, but it'll help finding the error:
1_In ParamsSetup, you have something like this:
AEFX_CLR_STRUCT(def);
PF_ADD_LAYER("Source", 0, SOURCE);
It means that when your effect is applied to a layer, you can choose any layer (including yours) in the composition with this parameter.
2_In your render function you have:
| PF_ParamDef | check; | |
| AEFX_CLR_STRUCT(check); |
| ERR(PF_CHECKOUT_PARAM( in_data, | ||||||||
| SOURCE, | ||||||||
| in_data->current_time, | ||||||||
| in_data->time_step, | ||||||||
| in_data->time_scale, | ||||||||
| &check)); |
now, you can access the layer's pixels using check.u.ld
When you're done with your pixels, don't forget to checkin:
| ERR2(PF_CHECKIN_PARAM( | in_data, | |||||||
&check)); |
Hope it helps,
François
Copy link to clipboard
Copied
Hi,François
It's so kind of you to answer my question! well, it dose work!
And I still have another question.that can we change the default state of the layer added by PF_ADD_LAYER
since we use PF_ADD_LAYER("Source", 0, SOURCE); to add a layer which id is SOURCE,and we set its default content as PF_LayerDefault_NONE, another default state is PF_LayerDefault_MYSELF, can we set the default to a specific layer? which means after we first apply the effect, in effect control window, it will not show like this
but will show like this

the "left1.avi" is a specific layer added by customer.
forgive my poor English, Thank you again!
Copy link to clipboard
Copied
And I think if I can get the value of this slide bar, that also works. There is a little introduction of PF_ADD_LAYER in user guide ,How can I find more information, I always feel so guilty to waste so much time of you to answer my question.

Copy link to clipboard
Copied
Hi again,
I think you can try to change the default value in your case PF_ADD_LAYER("Source", 2, SOURCE);
I've never tried, so you'll have to... But it should work, if and only if you have at least 2 layers in your comp. And there is no way that I know to check how many layers you have when you apply the effect...
But definitely, prefer PF_ADD_LAYER to PF_ADD_SLIDER. A layer parameter is automatically updated by AE when you change layer's index, add a layer, etc... Also, it only shows "selectable layers", it means for example you won't get cameras or lights as they don't have pixels associated.
Hope it helps,
François
Copy link to clipboard
Copied
Thanks a lot, francois! your reply help me a lot! It dose work!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now