Skip to main content
February 10, 2014
Question

How to prevent parameter value saving (for a trial/demo plugin)

  • February 10, 2014
  • 1 reply
  • 3261 views

Hi guys,

I need to make a demo/trial version of a commercial plugin with the requirement that the plugin can be loaded normally and all parameters are accessible, but when the project is saved and later re-loaded, all parameters should reset to their default values. Do you have any approach to this?

I tried modifying the params[] array in SequenceSetup/SequenceResetup, but that did not seem to work.

What is the best function to hook into to do this?

Thanks,

Mike

This topic has been closed for replies.

1 reply

Community Expert
February 10, 2014

changes to the params[] array values only apply on certain events.

(userChangedParam only, if memory serves...)

you can however reign terror on your parameters at any time using

AEGP_SetStreamValue().

as for SequenceSetup/Resetup:

setup is called only when a brand new copy is applied to a layer though the

effects menu.

resetup is called on numerous occasions, including: when a project is

loaded with an existing instance, when the effect is copied, when the

effect is duplicated, when the project is saved, ect... (anything that

causes the sequence data to flatten, and then unflatten)

so you'll need to tell these events apart so you won't go resetting the

user's params in mid session.

the easiest way IMHO, is to add an invisible checkbox that is PUI_ONLY, and

set it's default value to FALSE. on the first check, change it's value to

TRUE. on every load, it's value will reset automatically to FALSE, but it

will keep it's TRUE value during the entire session.

February 10, 2014

Thanks shachar for this helpful reply!

I am already playing with an invisible parameter, but did not yet try to make it a UI only param. Also, I try to avoid adding more parameters to the actual plugin to make it compatible with the old version, but if it can't be helped, I will go that route.

What is "PUI_ONLY" - I could not find it in the SDK?

And in what function would I do the first check?

Community Expert
February 10, 2014

oh sorry, i was winging it from memory.

it's actually PF_PUI_STD_CONTROL_ONLY, and it requires additional flags to

be set:

def.flags = PF_ParamFlag_SUPERVISE |

PF_ParamFlag_CANNOT_TIME_VARY;

def.ui_flags = PF_PUI_STD_CONTROL_ONLY;

what it means is that param has no data stream associated with it. the user

can change it (if it's visible), but it's change won't trigger a render,

and the value won't save with the project.

it's mostly used for popup and checkboxes that affect UI supervision

decisions, but this time you'll use it for mischief.