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

Understanding PF_ADD_POINT related macros e.g. INT2FIX

Contributor ,
Sep 24, 2021 Sep 24, 2021

I have no issues settings values when I declare a param in ParamSetup(). The problem is that I get odd behaviour when I try to set the point value in UserChangedParam().

I wish to use x and y in the same manner as the default params to PF_ADD_POINT () (i.e. a percentage of the comp). I do not wish to use the new x,y params to pass absolute x,y co-ordinates.

 

 

params[aeid]->u.td.x_value = (x << 16);

  - same as x, INT2FIX

 

params[aeid]->u.td.x_value = FIX2INT(x);

  Always 0

params[aeid]->u.td.x_value = (PF_Fixed)(x);

 Always 0

params[aeid]->u.td.x_value = asdkP->params[aeid]->u.td.y_value;

 - This works, so clearly I am setting the right flags.

asdkP->params[aeid]->u.td.y_value = INT2FIX (y);

 - Here y transforms to absolute y value.

 

Also, when I print

u.td.x_value

 that Adobe uses, it is nothing like the value passed in. For, reference the PF_ADD_POINT does this - 

def.u.td.x_value = def.u.td.x_dephault = (X_DFLT << 16);

 

TOPICS
SDK
363
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

Engaged , Sep 26, 2021 Sep 26, 2021

I might be wrong but I think the only time you can set % values on the point param is in ParamsSetup. If you change it in UserChangedParam, you'll have to set the coordinates. You could then find the comp dims inside UserChangedParam and then set the coords so they match the % you're after. 

Translate
Engaged ,
Sep 26, 2021 Sep 26, 2021

I might be wrong but I think the only time you can set % values on the point param is in ParamsSetup. If you change it in UserChangedParam, you'll have to set the coordinates. You could then find the comp dims inside UserChangedParam and then set the coords so they match the % you're after. 

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

Can we set fixed point co ordinates during setup? So, if I want 3,3 during setup and these are absolute co ordinates.

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

Yes using the method Shachar said in the other thread. Have a "sentinel" param that is set to 0, and a condition that if it's value is 0 in UpdateParamUI, make a change to the fixed point. Also update the sentinel value to 1 so that the process only happens once. I use this method in one of my plugins to change point values on first application of the effect.  

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