On Mar 28, 2013, at 10:07 AM, Martin Baker <
email@hidden> wrote:
Still not understanding how this would work - answers below
On 28 Mar 2013, at 16:42, Darrin Cardani wrote:
Martin,
This is disappointing but not surprising. I think there are a couple of things going on here:
1) It looks like Motion Templates do store the menu items in some form. That surprises me a little, but thinking about it, the published menu is not the plug-in's menu (at least not directly), so they have to store the additional information and if you change the plug-in, it won't line up anymore. That's a bummer. But my alternate suggestion of having 2 menus and showing the appropriate one for the version works around this problem.
But for the 2 menu option, both menus would surely need to be individually published in Motion so they showed in FCP but the plug-in would only show one at a time since it can't be both a v1 and v2 version.
Yes, you'll need to publish both menus. One will always end up hidden, so it shouldn't be a problem. (You'll need to make them both visible during creation of the template, which is inconvenient, but it shouldn't be too difficult). I would work like this:
1) In -addParameters, show both menus
2) Create your Motion Template and publish both menus
3) Now go back into your code and in -addParameters, check the -versionAtCreation. If version is 1, then set the parameter flags to show the menu with 3 items and hide the menu with 5 items. If version is 2, then show the menu with 5 items, and hide the menu with 3 items.
4) Also make sure that your rendering does the right thing according the version number.
5) Test both old and new instances of your plugin in FCP and let me know what you see.
2) -versionAtCreation should always return the version number for the original instance that the user placed in the project. It should never be updated unless the plugin explicitly calls -updateVersionAtCreation:.
"original instance that the user placed in the project" - the Motion project? (which is what I'm seeing and is no use) or the FCP project (which is what I need)? If it always returns the version of the plug-in in the Motion Template then I'm never going to be able to tell it was created with a previous version.
I'm not sure why you think that. The *only* way you'll be able to tell it was created by a previous version is by telling you which version went into the Motion Template that was in use when the user placed it on FCP's timeline.
As I mentioned, we do this with our shipping plug-ins now and haven't had problems with it. If the user creates an FCP project using the old Motion Template, then when they open it with the new template, you'll be told that the instance of your FxPlug was created with version 1. If you don't call -updateVersionAtCreation:, then every time they open it with the new template, it will still have the old version number. It will only tell you it's a new instance if you call -updateVersionAtCreation:. This makes it possible to work both ways - if you decide to have 2 menus, it will work. (Every time they open an old one, you'll see it's a version 1 project and only show the 3 item menu, every time they open a new one, you'll see it's a version 2 project and only show the 5 item menu.) If you decide to update the plug-in and only have 1 menu it should also work. (The first time they open it, it says it needs to be updated. You'll update it and then set the version number to 2. The next time they open it, it will be at version 2 and it will just work.)
Darrin