Creating Layers/ Altering pixels from raw data in an AEGP.
Having a hard time coming up with some solutions for this one...
I'd like to be able to pass raw image data into an AEGP, and use that to either alter existing pixels in items, or create new footage/layers with the image/video/whatever data.
I have an ImageData struct like so;
struct ImageData {
std::shared_ptr<std::vector<uint8_t>> data;
int width;
int height;
int channels;
// Default constructor
ImageData() : width(0), height(0), channels(0), data(std::make_shared<std::vector<uint8_t>>()) {}
// Constructor with shared_ptr and dimensions
ImageData(std::shared_ptr<std::vector<uint8_t>> d, int w, int h, int c)
: data(std::move(d)), width(w), height(h), channels(c) {}
// Constructor with initialization
ImageData(int w, int h, int c) : width(w), height(h), channels(c) {
data = std::make_shared<std::vector<uint8_t>>(w * h * c);
}
};
From what I'm seeing I need to use a file path for actually adding new layers and items.
I've considered possibly using a null or solid layer, then replacing that, or possibly even trying to embed an effect plugin to be added to layers and called by the AEGP when necessary?
From some initial tests, it is super slow getting AEGP_WorldH across all frames in a comp, but it is definitely doable. Same with altering the AEGP_WorldH with data passed in.
Perhaps AEGP_IterateGeneric could help?
At this point I'm kind of leaning towards the "embedded plugin" idea, since that could utilize multithreading, and the only communication between it and the AEGP would be done from a single threaded call, thus eliminating potential race conditions and issues with multiple AEGP instances?
TLDR; I'm exposing the SDK to python and I want to give some options for adding and manipulating custom image/video/audio data ( both gathered and passed in) so that people can utilize the massive amount of python libs to create some really cool stuff, and I need some assistance figuring out some alternative approaches to doing so.
Any suggestions would be welcome.
Thank you! 🙂
