Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Update params on first application of effect

Participant ,
Feb 11, 2018 Feb 11, 2018

Tldr; how can I update my parameters when the plugin is first applied to a layer?

Hi. I allocate some global data inside global setup, but because the params haven’t been initiated I can’t do it here. So I do it during update_params_UI.  This is the code I use, but it doesn’t update the parameter for some reason:

params[EM_TOPLEFT]->u.td.x_value = FLOAT2FIX(globP->x0);

params[EM_TOPLEFT]->uu.change_flags = PF_ChangeFlag_CHANGED_VALUE;

I call that exact same code on a supervised button during PF_Cmd_USER_CHANGED_PARAM and it works so I’m not sure why it’s not working when called from update params UI. I don’t want the users to have to press the button manually each time the effect is applied to a new layer. Thanks!

TOPICS
SDK
878
Translate
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

Community Expert , Feb 11, 2018 Feb 11, 2018

yeah, param value changes during UPDATE_PARAMS_UI are ignored by AE. you

can however do the same changes using SetStreamValue and it would stick.

not that doing so is the best practice, but hey, you gotta do what you

gotta do...

On Mon, Feb 12, 2018 at 12:54 AM, JamesWhiffin555 <forums_noreply@adobe.com>

Translate
Community Expert ,
Feb 11, 2018 Feb 11, 2018

yeah, param value changes during UPDATE_PARAMS_UI are ignored by AE. you

can however do the same changes using SetStreamValue and it would stick.

not that doing so is the best practice, but hey, you gotta do what you

gotta do...

On Mon, Feb 12, 2018 at 12:54 AM, JamesWhiffin555 <forums_noreply@adobe.com>

Translate
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
Participant ,
Feb 11, 2018 Feb 11, 2018

Thanks Shachar, it works! I think this happens after the render call, is it possible to call a re-render somehow?

To call PF_Cmd_SMART_PRE_RENDER I need (PF_PreRenderExtra*)extra), but I don't have that in UPDATE_PARAMS_UI

Translate
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
Community Expert ,
Feb 11, 2018 Feb 11, 2018

if you change any param that isn't PUI_ONLY, then a re-render should

happen. does it not?

On Mon, Feb 12, 2018 at 1:56 AM, JamesWhiffin555 <forums_noreply@adobe.com>

Translate
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
Participant ,
Feb 11, 2018 Feb 11, 2018

Thanks, you're right it does. In the render function I draw a shape based on the param slider, however it doesn't seen to honour the change I made to the slider in update_params_UI. I'm accessing it this way:

coords.xLowest  = FIX_2_FLOAT(paramsP[EM_TOPLEFT]->u.td.x_value);

I'll try accessing the value using getStreamVal and see if it's the updated one.

Translate
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
Community Expert ,
Feb 11, 2018 Feb 11, 2018

i'm going to suggest a different approach. i don't know if it suites you

needs, but here goes:

either set a default value to the slider that has no other meaning than "no

value set yet", or set a flag in the sequence data telling this effect has

not yet been "initiated".

during the render call, check for these conditions. if true, let the

decision making happen inside the render call without changing the param.

if the condition check is false, go with what's set in the param.

On Mon, Feb 12, 2018 at 2:19 AM, JamesWhiffin555 <forums_noreply@adobe.com>

Translate
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
Participant ,
Feb 11, 2018 Feb 11, 2018

Thanks Shachar that does sound like a better idea! And yeah, I was mistakenly using global data instead of sequence data as I'm not very experienced with those.

Translate
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
Contributor ,
Nov 05, 2021 Nov 05, 2021
LATEST

This is funny, I was trying to change x and y point params on application of effect. Similar problem.

Translate
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