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

Correct use of PF_ParamFlag_USE_VALUE_FOR_OLD_PROJECTS ?

Participant ,
Apr 01, 2020 Apr 01, 2020

Copy link to clipboard

Copied

Hi. I couldn’t get this to work, here’s my process using the Resizer sample which includes this flag:
 
1. Change version in PIPL and header from 2.0 to 1.0
2. Remove last 2 params (DOWNSAMPLE_DISK_ID, THREED_DISK_ID)
3. Create an AE project and apply resizer to a layer. Confirm it’s version 1.0 in the about box
4. Save project
5. Add the following param:
    def.u.bd.value = FALSE;        // value for legacy projects which did not have this param
 
    PF_ADD_CHECKBOX(    STR(StrID_Checkbox_Param_Name),
                        STR(StrID_Checkbox_Description),
                        TRUE, // value for new applications, and when reset
                        PF_ParamFlag_USE_VALUE_FOR_OLD_PROJECTS,
                        DOWNSAMPLE_DISK_ID);
 
6. Version up to 2.0 in PIPL and header file
7. Open up version 1.0 project, check value of checkbox:
8. It’s true, even though it should be false:
PF_Boolean checkboxValue = params[RESIZE_DOWNSAMPLE]->u.bd.value;
 
Am I misunderstanding how this flag works? Thanks in advance.
TOPICS
SDK

Views

553

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

Community Expert , May 21, 2020 May 21, 2020

answered elsewhere, but here's the solution for future generations:

take a look at the definition of PF_ADD_CHECKBOX.

you can see it's copying the passed default over the passed value.
i don't recommend changing the AE headers because updating the SDK would undo the change. (and it's generally bad practice)
just just copy the macro code to your files and fix it there, ot don't use the macro at all and define the param the old fashioned way. (which is the way the macro does it)

Votes

Translate

Translate
Community Expert ,
May 21, 2020 May 21, 2020

Copy link to clipboard

Copied

LATEST

answered elsewhere, but here's the solution for future generations:

take a look at the definition of PF_ADD_CHECKBOX.

you can see it's copying the passed default over the passed value.
i don't recommend changing the AE headers because updating the SDK would undo the change. (and it's generally bad practice)
just just copy the macro code to your files and fix it there, ot don't use the macro at all and define the param the old fashioned way. (which is the way the macro does it)

Votes

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