Jump to content

can PDN remember the parameters to a Plugin-Effect-Command  from last time ? -- (e.g., on the previous day) ?


Recommended Posts

 

it'd be nice if PDN remembered all the parameters to a Plugin-Effect-Command  from the last time i used it --- e.g. on the previous day.

 

For example,   SquirkleWarp  has  these parameters  and more:    pos-X, pos-Y,     angle, wide, shape, size magnification, curvature, ....   

Link to comment
Share on other sites

It will remember the settings for an effect until you exit Paint.NET.

 

I'm considering a feature that would add some kind of save/load/undo/redo toolbar at the bottom of most effects and adjustments (those that are IndirectUI-based). It wouldn't be available until sometime later next year, however.

  • Like 1
  • Upvote 4
  • Hooray 1

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

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

forumSig_bmwE60.jpg

Link to comment
Share on other sites

40 minutes ago, Rick Brewster said:

I'm considering a feature that would add some kind of save/load/undo/redo toolbar at the bottom of most effects and adjustments (those that are IndirectUI-based).

Would a global 'File/export settings' and 'File/import settings' be possible? (to save all the tokens for effects/adjustments used in that session).

I've no idea whether that is practical or how much work would be involved but saving all changed settings at once may be easier for the user and avoid
appending a tool bar to each Effect's Indirect U.I.

 

Any standardised method of saving effect settings using IndirectU.I. would be greatly appreciated!

  • Upvote 1

 

Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings

 

PdnForumSig2.jpg

Link to comment
Share on other sites

1 hour ago, Red ochre said:

Would a global 'File/export settings' and 'File/import settings' be possible? (to save all the tokens for effects/adjustments used in that session).

 

Quite possibly, just remind me again if/when the features comes out in an alpha/beta

  • Upvote 2

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

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

forumSig_bmwE60.jpg

Link to comment
Share on other sites

6 hours ago, Red ochre said:

Would a global 'File/export settings' and 'File/import settings' be possible? (to save all the tokens for effects/adjustments used in that session).

 

FYI - It's relatively easy to save & load a set of tokens. This is what I used in Planetoid to save planets.

 

        private void ButtonSave_Click(object sender, EventArgs e)
        {
            TryPlaySound(@"C:\Windows\Media\Windows Battery Low.wav");
            using System.Windows.Forms.SaveFileDialog svfd = new();
            svfd.FileName = "Untitled"; // set default title 
                                        // get last used path
            svfd.InitialDirectory = GetLastFolder();
            // look for *.pln files
            svfd.Filter = "Planetoid Files (.pln)|*.pln|All Files (*.*)|*.*";
            svfd.FilterIndex = 1;
            svfd.OverwritePrompt = true;
            // Show the filename extension
            svfd.AddExtension = true;

            if (svfd.ShowDialog() == DialogResult.OK)
            {
                using (FileStream stream = File.Open(svfd.FileName, FileMode.Create))
                {
                    Token.SaveTo(stream);
                }
                // show Ok message
                MessageBox.Show(this, "Dude, you saved an entire planet.", "What a hero!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                // store path in case it changed.
                SaveLastFolder(svfd.FileName);
                //
                // ************** Cool little trick: put the saved filename into the plugin title! :)  *******************
                //
                Text = Path.GetFileName(svfd.FileName) + " - " + ActiveForm.Text;
            }
            else
            {
                // Wasn't saved - informal message to say so.
                MessageBox.Show(this, "You're probably like...'Whatever Man' but I should tell you that Planet wasn't saved!", "Whoa....Dude!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }

 

Loading snippet....

 

using (FileStream stream = File.OpenRead(ofd.FileName))
                        {
                            PlanetoidEffectConfigToken token = PlanetoidEffectConfigToken.LoadFrom(stream);
                            InitDialogFromToken(token);
                            FinishTokenUpdate();
                        }

 

  • Thanks 1
  • Upvote 1
Link to comment
Share on other sites

I was hoping for a way to save the settings of all the (indirectUI) effects/adjustments used in a session, not relying on a particular effect having a its own way of saving.

 

Actually @Null54 kindly added some code to my Scribble effect to allow saving settings in .xml but that was done using Visual studio and Windows forms,
 as I remember, it was 10 years ago!...11th post on this page: Null54's Scribble src code

 

... but many thanks for your example code too! ...Sadly I haven't really got the spare time to experiment and learn/re-learn at the moment.☹️

 

I believe a way to save settings for existing indirectUI effects/adjustments would be far broader and more useful.

 

Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings

 

PdnForumSig2.jpg

Link to comment
Share on other sites

As long as an IndirectUI effect is using the set of standard built-in types, and isn't trying to use raw objects in its properties, it should be auto-serializable.

 

IndirectUI plugins can't do this on their own; their UI is declarative, with no room for customization beyond what's available in-box. So what works for Planetoid will not work for them.

 

The reason I'd be targeting IndirectUI effects is that they are by far the vast majority of effect/adjustment plugins out there (and the majority of built-ins as well).

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

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

forumSig_bmwE60.jpg

Link to comment
Share on other sites

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