Highlighted

Correct use of PF_ParamFlag_USE_VALUE_FOR_OLD_PROJECTS ?

Participant ,
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.
Adobe Community Professional
Correct answer by shachar carmi | Adobe Community Professional

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)

TOPICS
SDK

Views

320

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

Correct use of PF_ParamFlag_USE_VALUE_FOR_OLD_PROJECTS ?

Participant ,
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.
Adobe Community Professional
Correct answer by shachar carmi | Adobe Community Professional

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)

TOPICS
SDK

Views

321

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
Apr 01, 2020 0
Adobe Community Professional ,
May 21, 2020

Copy link to clipboard

Copied

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)

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
Reply
Loading...
May 21, 2020 2