Aex SDK layer parameter and effectworld problem

New Here ,
Jul 07, 2022 Jul 07, 2022

Copy link to clipboard

Copied

I'm developing an aex plugin that can grap a still frame and replace all the images with this frame for reference purpose. My idea is that when I press a UI button, the src data will copy to a param layer through effectworld suite and then fetch this data in the render function.

so, I write this in my UserChangedParam function:

 

 

 

AEGP_SuiteHandler suites(in_data->pica_basicP);
if (which_hitP->param_index == SKELETON_SNAPSHOT) {

// example of modifying parameter
// params[SKELETON_GAIN]->u.fs_d.value = 50.0;
// params[SKELETON_GAIN]->uu.change_flags = PF_ChangeFlag_CHANGED_VALUE;

if (PF_Quality_HI == in_data->quality) {
ERR(suites.WorldTransformSuite1()->copy_hq(in_data->effect_ref,
&params[SKELETON_INPUT]->u.ld,
&params[SKELETON_LAYER]->u.ld,
NULL,
NULL;
}
else {
ERR(suites.WorldTransformSuite1()->copy(in_data->effect_ref,
&params[SKELETON_INPUT]->u.ld,
&params[SKELETON_LAYER]->u.ld,
NULL,
NULL));
}

//ERR(PF_ABORT(in_data));
}

 

 

 

 I guess it's not a proper way to do this and I got error of bad paremters in AE, or is it possible to create a effectworld object somewhere to store this frame and use it in render for all frame, any idea? Thanks.

TOPICS
SDK

Views

58

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
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jul 07, 2022 Jul 07, 2022

you can do both.

in the first approach, where you createa temp world, you can store it in sequence_data and use it as the output for your effect. but again, only as the output of your effect, not replacing all usage or original layer (if that was your intent).

on the second approach, you can access any buffer's pixel data directly and use it however you like. effect_worldP->data is the base address of the world's buffer. you can then save it to file using any method you'd like. tinypng is a popu

...

Likes

Translate

Translate
Adobe Community Professional ,
Jul 07, 2022 Jul 07, 2022

Copy link to clipboard

Copied

there's a basic misconception here... you really shouldn't copy data onto a layer's source buffer.

whilte technically possible, there are a few problems with it:
1. it's not guaranteed to stick. AE may refresh that buffer without your plugin knowing about it.

2. that buffer might have been already used a cached by other parts of the process, so overwriting that buffer won't affect places where it has already been used.

 

so... wrong way about this issue.

i would suggest that pressing the button would automate a pre-composition of that layer, and replacement of all used instances of that layer.

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
community guidelines
New Here ,
Jul 07, 2022 Jul 07, 2022

Copy link to clipboard

Copied

Thanks for the valuable advice! Pre-composition seems not work for our artist requirement. I need to figure out. Could I, for example, create a temp effecworld and load src data into it when pressing button, then render all farmes by using this temp and somehow press another button to dispose this temp object? Or a simplest way that make a snapshot and save into file and automate import above a certain layer? Really appreaciate for your replay!

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
community guidelines
Adobe Community Professional ,
Jul 07, 2022 Jul 07, 2022

Copy link to clipboard

Copied

LATEST

you can do both.

in the first approach, where you createa temp world, you can store it in sequence_data and use it as the output for your effect. but again, only as the output of your effect, not replacing all usage or original layer (if that was your intent).

on the second approach, you can access any buffer's pixel data directly and use it however you like. effect_worldP->data is the base address of the world's buffer. you can then save it to file using any method you'd like. tinypng is a popular library for that. afterwards, there's no problem importing and replacing the usage of any layer.

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
community guidelines