Re: Moefs not storing all FxPlug parameters?
Re: Moefs not storing all FxPlug parameters?
- Subject: Re: Moefs not storing all FxPlug parameters?
- From: Nathan Weston <email@hidden>
- Date: Thu, 04 Aug 2011 12:55:03 -0400
On 8/4/2011 12:46 PM, Darrin Cardani wrote:
On Aug 4, 2011, at 8:55 AM, Nathan Weston wrote:
When I make a Motion Effect containing an FxPlug, it appears that it only stores parameters which have been changed from the default value. Is that expected behavior?
Yes this is intentional. It's an optimization to make reading Motion Effects faster.
This is a really bad idea. Consider the following case:
1. User creates a Motion Effect with version 1 of my plugin. They leave parameter X at the default value.
2. I release version 2 of my plugin, in which I've changed the default value of X to something nicer.
3. User installs version 2, and their Motion Effect now renders differently.
In effect, it means we can never change parameter default values if we want to keep backward compatibility. If you store all the parameters in the Motion Effect it's guaranteed to render consistently even if the FxPlug changes default values underneath it.
You should be checking the -versionAtCreation method and setting the default appropriately. If the plug-in's versionAtCreation is 1, set the default to the version 1 default. If it's 2, set the default to the version 2 default. Note that if your plug-in didn't have a version when the document was created, -versionAtCreation will return 0. So when you update it and add a version, just set it to 1, and you'll be able to tell the current version from older versions.
I still think it's a bad idea, and I strongly urge you guys to
reconsider. Compatibility tricks with versionAtCreation are a big burden
on the plug-in developer, and provide many opportunities to screw things up.
By storing the default values you can protect your users from this
potential problem in one easy step, even if plug-in developers are lazy
or careless.
It's hard to believe that the overhead of reading a few params (or even
a few dozen) can make a significant speed difference, unless your
storage format is really screwed up. :)
--
. . . . . . . . . . . . . . . . . . . . . . . . .
Nathan Weston email@hidden
GenArts, Inc. Tel: 617-492-2888
955 Mass. Ave Fax: 617-492-2852
Cambridge, MA 02139 USA www.genarts.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden