How to create off-screen image buffer with SDK and draw to it?

May 20, 2020

Copy link to clipboard

Copied

Hi gang;

 

I've used other SDK's where this is very possible. Is it possible with the After Effects SDK?

 

I'd like to create an image buffer to work with, draw to it, and then copy the data to the After Effects peview buffer. This would be helpful so that I can copy parts of a sequence from various different frames into that one image. I was looking through the SDK examples but didn't really find anything relevant.

 

Any suggestions? Please let me know if I've made myself unclear and I can try to provide more details!

 

Thanks,

-Richard

it's very much possible.

we're talking about 2 concepts here:
1. get inputs from different layers and at different times.

both the effect's own layer and other layers are accessed via a layer param. every effect has a default layer param (index 0) which is used to checkout the input.

to get images from other times, lookup "WIDE_TIME" in the SDK docs.

 

2. using intermediate buffers.

AE hands the effect an output buffer to fill. HOW that buffer is filled is up to you. you don't have to operate directly on it. you can do whatever you want and then copy data into that buffer. an AE buffer has a pointer named "data" which is the base address for the image pixels, and another variable called "rowbytes" which denotes the number of bytes in a row. (it's not necessarily sizeof(PF_Pixel)*width; (it's sometimes referred to as "stride" in other APIs)

in any case, use whatver method you want to draw, either directly into the handed output, or to another buffer and copy the end result to the output.

you can create AE native buffers as intermediates if you like. thery're referred to as "worlds" in the SDK docs.

TOPICS
SDK

Views

280

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to create off-screen image buffer with SDK and draw to it?

May 20, 2020

Copy link to clipboard

Copied

Hi gang;

 

I've used other SDK's where this is very possible. Is it possible with the After Effects SDK?

 

I'd like to create an image buffer to work with, draw to it, and then copy the data to the After Effects peview buffer. This would be helpful so that I can copy parts of a sequence from various different frames into that one image. I was looking through the SDK examples but didn't really find anything relevant.

 

Any suggestions? Please let me know if I've made myself unclear and I can try to provide more details!

 

Thanks,

-Richard

it's very much possible.

we're talking about 2 concepts here:
1. get inputs from different layers and at different times.

both the effect's own layer and other layers are accessed via a layer param. every effect has a default layer param (index 0) which is used to checkout the input.

to get images from other times, lookup "WIDE_TIME" in the SDK docs.

 

2. using intermediate buffers.

AE hands the effect an output buffer to fill. HOW that buffer is filled is up to you. you don't have to operate directly on it. you can do whatever you want and then copy data into that buffer. an AE buffer has a pointer named "data" which is the base address for the image pixels, and another variable called "rowbytes" which denotes the number of bytes in a row. (it's not necessarily sizeof(PF_Pixel)*width; (it's sometimes referred to as "stride" in other APIs)

in any case, use whatver method you want to draw, either directly into the handed output, or to another buffer and copy the end result to the output.

you can create AE native buffers as intermediates if you like. thery're referred to as "worlds" in the SDK docs.

TOPICS
SDK

Views

281

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 20, 2020 0
May 20, 2020

Copy link to clipboard

Copied

it's very much possible.

we're talking about 2 concepts here:
1. get inputs from different layers and at different times.

both the effect's own layer and other layers are accessed via a layer param. every effect has a default layer param (index 0) which is used to checkout the input.

to get images from other times, lookup "WIDE_TIME" in the SDK docs.

 

2. using intermediate buffers.

AE hands the effect an output buffer to fill. HOW that buffer is filled is up to you. you don't have to operate directly on it. you can do whatever you want and then copy data into that buffer. an AE buffer has a pointer named "data" which is the base address for the image pixels, and another variable called "rowbytes" which denotes the number of bytes in a row. (it's not necessarily sizeof(PF_Pixel)*width; (it's sometimes referred to as "stride" in other APIs)

in any case, use whatver method you want to draw, either directly into the handed output, or to another buffer and copy the end result to the output.

you can create AE native buffers as intermediates if you like. thery're referred to as "worlds" in the SDK docs.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 20, 2020 0
May 20, 2020

Copy link to clipboard

Copied

Hi Shachar;

 

Thank you very much for that thoughtful and detailed answer. It makes sense and I'm going to try these two suggestions.

 

Kind regards,

-Richard

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 20, 2020 0