Jump to content
Paint.NET 5.1 is now available! ×

Recommended Posts

Posted

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:

  1. Using BoltBait's "Apply Mask" and "Switch Alpha to Gray" plugins here for demonstration.
  2. Open paint.net, open the included testA.pdn and testB.pdn images
  3. Make a new image, fill it with black
  4. Run Switch Alpha to Gray. Finish effect.
  5. Switch to testA.pdn, select the "heart" layer.
  6. 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.
  7. Switch to testB.pdn, select the "color" layer.
  8. Run Apply Mask, browse through the layers and confirm in preview that the mask is being applied. Do not finish but cancel instead!
  9. Switch to blank new image.
  10. Run Apply Mask. Finish effect.
  11. Switch back to testB.pdn.
  12. Run Apply Mask: same issue, you can no longer use or even preview any other layer than "diamond".

 

layerselector_bug.zip

Posted

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. 
 

  • Upvote 1
Posted
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() ?

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Posted
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.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...