Martin,
Let me see if I get this right:
The task: Your plugin needs to determine if your project was created with V1 of the plugin or with V2. Depending on that you want to display two different looking popup menus.
Let's say your V1 plugin only has on parameter, which is the popup menu with 3 items. Your V2 plugin needs to display 5 items. Now you add to the V2 plugin a BOOL which is set to YES, thinking that you only get a YES from the BOOL when you open a project where the V2 plugin was used.
What happens:
Your V1 project opens with the installed V2 plugin. The -addParameters method now adds the BOOL and the popup menu. The project does not have a BOOL parameter, because the old V1 plugin only added the popup menu with the 3 items. And so the BOOL will be added with the default parameter of YES. Your -renderOutput method will therefore always see a YES when its gets the BOOL value.
If your V1 project would have also had a BOOL which is set to NO as a default, then you can determine in the -renderOutput method if the plugin was created with the V1 plugin (BOOL is set to NO) or the V2 plugin (BOOL is set to YES).
If you would have used a hidden INT, then you can do even more, because then you will be able to determine if the V1, V2 or V35 plugin was used when the project was created.
Christoph
On Mar 28, 2013, at 1:12 PM, Martin Baker wrote: Hi Christoph
Not sure I understand. The BOOL has a default value of NO, and is only set to YES if the popup migration has taken place. For a previous instance of the plug-in, the BOOL doesn't exist, so it should have the default value of NO.
It's a bit immaterial anyway though if the versionAtCreation is never returning v1 with the v2 plugin in a v2 template!
Martin ------------------------------------------------------ Digital Heaven Ltd is registered in England and Wales Company registration number: 3628396 Registered address: 55 Lynwood Drive, Worcester Park, Surrey KT4 7AE VAT registration number: GB 736 0989 03
On 28 Mar 2013, at 15:11, Christoph Vonrhein wrote: The problem is that the new version of the plugin adds the Bool parameter to the V1 project and so you will always wind up with V2. It might have worked if you've added a hidden INT to the project declaring the version of the plugin used in the project. Then the parameter will not be overwritten be the new version of the plugin.
|