Simon Brown Posted December 15, 2008 Share Posted December 15, 2008 Recently, some new guidelines for plugins were published. I normally use PDNInfo.UserDataPath to get the Paint.NET User Files folder path, but due to the following guideline: Plugins should not use the PdnResources or PdnInfo classes.The text and images that Paint.NET uses for its own user interface are not for plugins. Strings are not guaranteed to have the same text between versions, or to even exist. Same with images. If you want to take advantage of the localized text for effect submenus such as Artistic, Blurs, Distort, etc. then please use the static SubmenuNames class. I can no longer do this. Is there an alternative? ------------------------------------------------- FileType plugins must not masquerade as "export" pluginsA plugin for "export to photobucket" would be completely inappropriate, for instance. The user experience would be completely inappropriate: the user would asked to choose a file, and then your UI would upload the file somewhere, and then the user would have a 0-byte file on their disk because you ignored the Stream object that Paint.NET handed to you. These types of plugins will be deleted. But I gather the types of plugins I write to do this (export plugins written as effects) are OK? ------------------------------------------------- All that said, if you are just playing with plugins for your own private use, then feel free to do whatever you want! Do the rules apply when publishing to a 3rd-party source? Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted December 15, 2008 Share Posted December 15, 2008 Recently, some new guidelines for plugins were published. I normally use PDNInfo.UserDataPath to get the Paint.NET User Files folder path, but due to the following guideline:I can no longer do this. Is there an alternative? No -- but it's only fair that I provide an alternative. Stay tuned. For now, stay with the code patterns you have. (Remember, that rule uses the word "should", not "must".)But I gather the types of plugins I write to do this (export plugins written as effects) are OK?I don't really like it, but until an actual export extensibility point is added, this is how you'll need to do this.Do the rules apply when publishing to a 3rd-party source?If I'm not in charge there, then I can't enforce it! Remember, lots of people come to the forum and download tons of plugins -- even people who are not active in the forum (remember the 1% rule, http://www.guardian.co.uk/technology/20 ... gysection2 ). Then, when things in Paint.NET change, I will get e-mails from them asking things like, "why did you remove features from Paint.NET?" (I didn't, your plugin stopped working because they were using the wrong APIs!) or "please fix ________" (I can't, it's a plugin!) Some of these can be addressed in code (e.g., the newer effect crash dialog in v3.10+). Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
BoltBait Posted December 15, 2008 Share Posted December 15, 2008 Effect plugins must follow "the rules."This means, no writing to the source surface. No writing to the destination surface except where indicated by "rois" (region of interest). Rendering must only happen in the Effect's Render/OnRender methods, and not in the EffectConfigDialog or EffectConfigToken implementations. So, what are we allowed to do in the OnSetRenderInfo method? For example, in my Bevel Selection plugin, I create a new surface and render stuff to it. Now, I don't render anything to the actual destination canvas until the OnRender function. Is this "legal"? Plugins should not use the PdnResources or PdnInfo classes.The text and images that Paint.NET uses for its own user interface are not for plugins. Strings are not guaranteed to have the same text between versions, or to even exist. Same with images. If you want to take advantage of the localized text for effect submenus such as Artistic, Blurs, Distort, etc. then please use the static SubmenuNames class. I think it is awesome that you have given us access to the SubmenuNames class. Can we get more stuff like this to make it easier for plugin authors to have localized plugins? Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Rick Brewster Posted December 15, 2008 Share Posted December 15, 2008 So, what are we allowed to do in the OnSetRenderInfo method? For example, in my Bevel Selection plugin, I create a new surface and render stuff to it. Now, I don't render anything to the actual destination canvas until the OnRender function. Is this "legal"? That's fine. It's not a very good user experience, but it's really the best you can do without first-class support for multipass rendering. I think it is awesome that you have given us access to the SubmenuNames class. Can we get more stuff like this to make it easier for plugin authors to have localized plugins? Give me a list of what stuff you want, and we can go from there. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.