[URGENT] Permission denied error while writing to a txt file using fopen() in ProjDumper example
The goal of my AEGP plugin is to print out RGB values of all pixels in a frame to a txt file.
I'm trying to use ProjDumper example's implementation of using fopen() to write to a txt file, however, the plugin when run in debug environment returns 'Error: Permission Denied'
I've tried to give 'read & write' permission to Adobe After Effects 2020/Plugins folder and even the After Effects SDK/Examples/AEGP/ folder. But, I still get the same error.
Here's my code that's trying to write a file.
if (frameH){
ERR(suites.WorldSuite3()->AEGP_FillOutPFEffectWorld(frameH, &pFrame));
out = std::fopen("./test_ae_dump.txt", "w+");
if (out) {
for (int i = 0; i < dimen_h; i++) {
for (int j = 0; j < dimen_w; j++) {
PF_Pixel *myPixel = sampleIntegral32(pFrame, j, i);
std::cout << "x: " << j << " | y: " << i << std::endl;
std::cout << int(myPixel->red) << " | " << int(myPixel->green) << " | " << int(myPixel->blue) << std::endl;
std::fprintf(out, "x: %d | y: %d \nr: %d | g: %d | b: %d", j, i, int(myPixel->red), int(myPixel->green), int(myPixel->blue));
}
}
std::fclose(out);
} else {
std::cout << "FILE could be initiated" << out << std::endl;
std::perror("Error");
}
}
This is the final step in my plugin that I need working as soon as possible. Not sure what is causing this problem. Let me know if you need more information about my setup or anything else.
