frio Posted November 9, 2023 Posted November 9, 2023 The layer selector control in plugins gets stuck after first run, limiting itself to however many layers are available on that image. The stuck state is per plugin, so layer selectors in other plugins will still work until they're used once. Since I realized this affects CodeLab plugins as well as @BoltBait's effects, this might be a paint.net internal issue. Steps to reproduce: Using BoltBait's "Apply Mask" and "Switch Alpha to Gray" plugins here for demonstration. Open paint.net, open the included testA.pdn and testB.pdn images Make a new image, fill it with black Run Switch Alpha to Gray. Finish effect. Switch to testA.pdn, select the "heart" layer. Run Switch Alpha to Gray: it is stuck using only the "Background" layer, and you can't get to the "heart" layer to get alpha from. Finish or cancel effect. Switch to testB.pdn, select the "color" layer. Run Apply Mask, browse through the layers and confirm in preview that the mask is being applied. Do not finish but cancel instead! Switch to blank new image. Run Apply Mask. Finish effect. Switch back to testB.pdn. Run Apply Mask: same issue, you can no longer use or even preview any other layer than "diamond". layerselector_bug.zip Quote
BoltBait Posted November 9, 2023 Posted November 9, 2023 I believe this is a bug for @Rick Brewster in Paint.NET. The issue here is the token. If the number of layers changes, there is no way to refresh the token information from the current document. The contents of the drop-down list in the plugin UI always comes from the token. If the number of (or names of) layers has changed, we need a way to keep that drop-down list up-to-date. 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
Rick Brewster Posted November 9, 2023 Posted November 9, 2023 3 hours ago, BoltBait said: If the number of (or names of) layers has changed, we need a way to keep that drop-down list up-to-date. Isn't the property collection, and thus the layer control, rebuilt during OnCreatePropertyCollection() ? Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
BoltBait Posted November 9, 2023 Posted November 9, 2023 1 hour ago, Rick Brewster said: Isn't the property collection, and thus the layer control, rebuilt during OnCreatePropertyCollection() ? Yes, but that's only called once, the first time the effect is run... since there is no token. If the token exists, it is populated from there and there is no chance to rebuild that list of layers. I just don't think drop-down list boxes in IndirectUI were designed for data that could change, like a list of layers or a list of fonts. We may be pushing the limits of the original design here. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
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.