MJW Posted July 5, 2020 Share Posted July 5, 2020 A feature I often wish for is the ability to optionally reset an Indirect UI control to the value when the control was last run instead of the default value. I frequently run an effect with the intent of modifying the last-used values, then realize I don't like the modification for one of the controls, and wish I could restore it to the starting value. Often, I have to exit the effect, so I can rerun it with the original settings, even though it means losing the modifications of the other controls. What I suggest is that a right mouse click on the reset button restore the control to the starting value, rather than the default value. If a right mouse click isn't a good choice, perhaps a click while the shift key or control key is held down. Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted November 24, 2021 Share Posted November 24, 2021 Currently I am trying to find the code to add to a Codelab plugin to reset all the values of 4 ListBoxControls (None). I see a Reseed button Control but no Reset Button control. My search found this thread which leads me to believe its a feature request long forgotten. Quote Link to comment Share on other sites More sharing options...
MJW Posted November 24, 2021 Author Share Posted November 24, 2021 1 hour ago, AndrewDavid said: My search found this thread which leads me to believe its a feature request long forgotten. Actually, my request is different. It's a request that the user (not the programmer) optionally be able to restore individual controls to the value that was set when the plugin was started, instead of the default value. In other words, the value to which the control would be set if the plugin were cancelled and rerun. I quite often adjust a control, then wish I could return the control to its original value when I started the plugin; sometimes because I adjust the wrong control; other times because I simply realize the adjustment wasn't what I wanted. As to your hope of resetting a number of controls with a button or some such, unfortunately I believe there's no way to do that in Indirect UI, either in CodeLab or Visual Studio. There's no external ability to change or reset a UI control. Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted November 24, 2021 Share Posted November 24, 2021 In the case of a drop down list - I just added a new choice (None) that seems to do the trick I read in another thread that this request is on @Rick Brewster to do list. Quote Link to comment Share on other sites More sharing options...
MJW Posted November 24, 2021 Author Share Posted November 24, 2021 1 hour ago, AndrewDavid said: In the case of a drop down list - I just added a new choice (None) that seems to do the trick If I understand your UI correctly, you might want to disable the ListBoxControls when None is selected. As I recall, unfortunately that can only be done in CodeLab if None is the first choice in the list, but it seems like it might be an appropriate first choice. Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted November 24, 2021 Share Posted November 24, 2021 After compiling in codelab and testing in paint, it really didn't work. One crash. Adding None as the first choice messed up the code as well. You can see the code in Gradient Bars, https://forums.getpaint.net/topic/116419-another-plugin-gradientmap-and-first-difficulties/?do=findComment&comment=571377 A plugin that was never really published, but I find it usefull. There is a second codelab entry modifying his original one. That is the one I have been playing with. Quote Link to comment Share on other sites More sharing options...
MJW Posted November 24, 2021 Author Share Posted November 24, 2021 After looking at the code, I'm not at all sure what you meant by "reset all the values of 4 ListBoxControls (None)," or how that relates to "I just added a new choice (None) that seems to do the trick." Perhaps if you explain in more detail, I'll have a theory about why it would crash. Did you add a "None" choice to each list box. And if so, what does it mean as far as the desired behavior of the plugin? What's supposed to happen if None is selected? Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted November 24, 2021 Share Posted November 24, 2021 29 minutes ago, MJW said: reset all the values of 4 ListBoxControls (None) While the plugin is active - I do not want it to make any changes to the canvas. You will see when you run it a second time the values are locked in. 32 minutes ago, MJW said: Did you add a "None" choice to each list box. Yes, at the end. 32 minutes ago, MJW said: What's supposed to happen if None is selected? The image returns to its original colors. The reason it crashed is because I did not add this line of code to the None choice. I settled on this 0x00, 0x00, 0x00, 0x00 //None When all the choices are set to none the image turns to black. I want the original image to be displayed, That should clear things up. Quote Link to comment Share on other sites More sharing options...
MJW Posted November 24, 2021 Author Share Posted November 24, 2021 11 hours ago, AndrewDavid said: When all the choices are set to none the image turns to black. I want the original image to be displayed Well, the only way I can see to do that is to treat None as a special case. When a control in set to None, instead of getting the color to use from a table, as you do with the other entries, you need to get it from the pixel in the source image. Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted November 24, 2021 Share Posted November 24, 2021 @MJW "Theoretically" When I open the image it gets saved to the WRK surface. When the user applies the menu choices they are applied to the WRK surface. If a user selects a reset button the WRK canvas is disposed and restored to the SRC image. Can that be coded? I have been looking at other plugins to see if I can figure out how to code that process. Quote 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.