Popular Post Roly Poly Goblinoli Posted December 11, 2016 Popular Post Share Posted December 11, 2016 Drawing with brush dynamics (similar to Krita/Photoshop), but within Paint.Net! Everything in the pic below was drawn with it except the letter shapes Additional thanks to TechnoRobbo, Null54, Pyrochild, Toehead, and xchellx for valuable code contributions Using Dynamic Draw 1. Pick a brush image (and add your own under Settings - Brush section -> Brush Image Locations) 2. Change settings (don't forget you can scroll down for more settings) 3. Draw on the canvas (with some tablet support for huion/wacom via WinTab) You'll see explanations & keyboard shortcuts in a tooltip as you hover over settings. Note: If you're working with multiple layers, you can merge down all the layers below to copy it to the clipboard and use it as the background in a right-click menu on the canvas itself. Installing Extract the Dynamic Draw folder to the Effects folder of your paint.net installation, which for me is at C:/Program Files/paint.net/Effects. Leave it in the folder. Then restart paint.net. What's New? changelog new Global command lookup/execution invoked with / new Extensive keyboard shortcut editing new Customize keyboard shortcuts dialog, exposing all of it including action data new Supports user secondary color new Themeing for light/dark mode added to Options menu new Generated palettes (between primary/secondary colors) and user palette new Added a line tool new Added a clone stamp tool (has issues) tweak Rewritten UI supporting dark mode, Blender-inspired sliders, a nice color wheel new Button to save current brush settings tweak Changed trackbars to sliders + directly type values while hovered, enter to confirm tweak Keyboard shortcuts in tooltips are dynamic, showing all shortcuts + user shortcuts tweak Many important functions moved to top menubar and Options button + these new functions: new "Reset canvas" action new In canvas background, "Use clipboard as image only if same size" new Brush indicator can be a brush preview new Show symmetry lines when in use new Show the circle for minimum draw distance when in use new Color picker copies transparency new Color picker switches to last tool when used new Remove brush image paths when not found new Don't ask to confirm when closing/saving tweak Canvas zoom shortcut snaps to 100% when passing by it tweak Brush rotation shortcuts go by 15 instead of 20 by default tweak Shortcut system allows mouse wheel, any number of keys tweak Settings are now in Documents/paint.net User Files and stored as .json tweak Ctrl+left click to pan was removed bugfix Color picker is now pixel-perfect for unrotated canvases (still wrong on rotated canvases) bugfix User color is correctly restored with saved brushes Known Issues This version is not perfect, but it's a massive overhaul of the old version. I believe it's significantly better, but it was halted in development to update and subsequently abandoned. Since both version 3.3 and the newest version 4.0 are built against the Paint.net 4 binaries, there is no guarantee that this plugin will continue to work in the future, but there is also no reason not to release these changes as-is since I'm not updating to a newer version. Get Dynamic Draw v4.0 optional extra brushes How to use Dynamic Draw old downloads Source code 13 18 Quote Link to comment Share on other sites More sharing options...
lynxster4 Posted December 11, 2016 Share Posted December 11, 2016 Well done, Anthony! Thanks for making it 'official'. Quote My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer" Link to comment Share on other sites More sharing options...
Eli Posted December 11, 2016 Share Posted December 11, 2016 (edited) Thanks, Anthony! I think that Brush Factory will be a favorite for many users. Request: - A mouse speed controller, if I move the mouse too slow the brush will be recreated too many times.On the other hand, if I move the mouse too fast it will leave important gaps between the repeated images. Perhaps matching the "Minimum Draw Distance" with a "Maximum Draw Distance" could do it. Edited December 11, 2016 by Eli Quote Link to comment Share on other sites More sharing options...
homebrew Posted December 11, 2016 Share Posted December 11, 2016 nice work too bad it's on an external canvas and you can't use layers should be native Quote Link to comment Share on other sites More sharing options...
Roly Poly Goblinoli Posted December 11, 2016 Author Share Posted December 11, 2016 (edited) @Eli I attempted it, but it was countered by lag. I think I'd have to rewrite this plugin to do something like that. I hope that's not a deal-breaker. Alternatively, you or another person can try to implement it. @homebrew We make all of our plugins on an external canvas because it's the only way to hack in these kinds of features. PDN does not lend itself to canvas-type plugins; there is no way to make it native. Rick would have to modify the API to allow us to write tool plugins or something. Edited December 12, 2016 by AnthonyScoffler Updated information Quote Link to comment Share on other sites More sharing options...
LionsDragon Posted December 11, 2016 Share Posted December 11, 2016 @AnthonyScoffler, I didn't even know about this plugin until last night. Installed it right away and love it! Quote Link to comment Share on other sites More sharing options...
Roly Poly Goblinoli Posted January 6, 2017 Author Share Posted January 6, 2017 Version 1.1 has been released. You can find the changes in the changelog at the bottom, just above the download. I didn't get a big response for the initial release (but then, it had no publicity). Now that a few people have seen it, I would like some feedback if you have the time @Eli I haven't given up on that idea. I might create an alternate way to draw. I was trying to draw as a percent of image size, but now I'm thinking of running a timer that every few ticks will look at the mouse position and add X images at some fixed distance (that might still be %-based). If I get it to work, I'll have it as an optional way to draw under the 'other' tab. 2 Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted January 6, 2017 Share Posted January 6, 2017 Have you been able to investigate the possibility of using pyrochild's CanvasPanel UserControl? I may want to use it in a future plugin of mine, so I'd be curious of your findings. On an unrelated note, please see this post: https://forums.getpaint.net/index.php?/topic/110458-the-plugin-browser-v1102-updated-dec-30-2016/&do=findComment&comment=525886 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Roly Poly Goblinoli Posted January 6, 2017 Author Share Posted January 6, 2017 6 minutes ago, toe_head2001 said: Have you been able to investigate the possibility of using pyrochild's CanvasPanel UserControl? I may want to use it in a future plugin of mine, so I'd be curious of your findings I won't tear the two plugins apart to fuse a canvas for this plugin. They are both well-integrated into the rest of their respective application, so it would be begging for instability if I did that to Brush Factory. I have plans to implement the two things it does that I don't: use the clipboard image and mark the selected area. Quote On an unrelated note, please see this post: https://forums.getpaint.net/index.php?/topic/110458-the-plugin-browser-v1102-updated-dec-30-2016/&do=findComment&comment=525886 I never had enough plugins installed to use or look at that. The use of AssemblyCompany for the author is rather bizarre, but I suppose I can. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted January 6, 2017 Share Posted January 6, 2017 12 minutes ago, AnthonyScoffler said: The use of AssemblyCompany for the author is rather bizarre Read this entire thread: http://forums.getpaint.net/index.php?/topic/110384-pluginsupportinfo-properties/ Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Roly Poly Goblinoli Posted January 6, 2017 Author Share Posted January 6, 2017 (edited) That was enlightening, BoltBait. Thanks. @toe_head2001 I added myself as a company and changed the functionality of lock alpha so it applies after each stroke instead of at the end of the image, which is a more useful method. I can't lock alpha & copy after every individual brush stroke without doing some crazy size calculations (esp. with a rotated brush) and other things like that, so I think doing it after a brush stroke is better. It might be plausibly useful, now. Edited January 6, 2017 by AnthonyScoffler 1 Quote Link to comment Share on other sites More sharing options...
Shochi Posted January 6, 2017 Share Posted January 6, 2017 Tnq Anthony. it's very useful tool. and fun too good luck Quote Link to comment Share on other sites More sharing options...
Seerose Posted January 7, 2017 Share Posted January 7, 2017 Dear @AnthonyScoffler! Thank you so much. Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
Eli Posted January 7, 2017 Share Posted January 7, 2017 @AnthonyScoffler I keep my "brushes"in a folder inside the "Pictures folder" and every time I want to "add a new brush" the browser defaults to the "Desktop" . Can something be done so it will remember the last opened folder when adding brushes? 1 Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 7, 2017 Share Posted January 7, 2017 @AnthonyScoffler - these routine saves (and recalls) the last directory path to/from a registry key. These will allow you to solve the inconsistent path issue @Eli is referring to public static string AuthorName = "Ego Eram Reputo"; public static string PluginName = "A Brand New Plugin"; /// <summary> /// Saves the path of the last folder the user navigated to (either load or save). /// Thanks to TechnoRobbo for this and the sister routine getlastFolder() /// </summary> public static void savelastFolder(string fp) { RegistryKey key; key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(AuthorName); key.SetValue(PluginName, Path.GetDirectoryName(fp)); key.Close(); } public static string getlastFolder() { string glF = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); // registry key under HKCU is my username. RegistryKey LastFolder = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(AuthorName); if (LastFolder != null) { try { // Multiple plugins might use the use the same Key Name - this sets the sub-key specifically for this plugin. glF = (string)LastFolder.GetValue(PluginName); if (!Directory.Exists(glF)) glF = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); } catch { glF = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); } } return glF; } 2 Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Roly Poly Goblinoli Posted January 8, 2017 Author Share Posted January 8, 2017 (edited) Quote I keep my "brushes" in a folder inside the "Pictures folder" and... can something be done so it will remember the last opened folder when adding brushes? I was going to add an .ini file to the Effects folder as sort of a workaround, but using the registry is much better. I will add a preferences option under miscellaneous. It will open a little dialog for all that stuff. Rather than just remembering the location to load, I will definitely have auto-loading of locations (I was already planning that ). Thank you @Ego Eram Reputo for the code. That makes this a lot faster Thanks for the great idea @Eli! I appreciate the feedback, and it helps me organize which issues to tackle next. ...I'd also like to thank everybody that gave me positive feedback! I like to know when I'm doing something right Version 1.2 is released and it addresses some of the concerns @toe_head2001 had. User selections are now shown in the canvas, and you can right-click to set the background image if you'd like (courtesy of Pyrochild's open-source Liquify plugin). Keep the feedback coming Edited January 8, 2017 by AnthonyScoffler 3 Quote Link to comment Share on other sites More sharing options...
Eli Posted January 8, 2017 Share Posted January 8, 2017 @AnthonyScoffler One observation regarding the sliders when I use the keyboard arrows : - if I use the LEFT keyboard arrow (<) the values decrease. So this is OK. - It is also OK when I use the RIGHT keyboard arrow (>) The values increase. However, the UP and DOWN arrows confuse me a little : - if I press the UP arrow I would expect the values to increase but they don't, they decrease - and if I press DOWN arrow I would expect it to decrease but the values increase instead. Is this behavior OK? Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted January 8, 2017 Share Posted January 8, 2017 3 minutes ago, Eli said: One observation regarding the sliders when I use the keyboard arrows That's the standard behavior of a TrackBar in WinForms. It makes perfect sense when TrackBars are orientated vertically, but that is rarely the case. Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Eli Posted January 8, 2017 Share Posted January 8, 2017 52 minutes ago, toe_head2001 said: That's the standard behavior of a TrackBar in WinForms. It makes perfect sense when TrackBars are orientated vertically, but that is rarely the case. Thanks toe_head2001, I thought the UP and Down keyboard assignments had been inverted. Quote Link to comment Share on other sites More sharing options...
Eli Posted January 8, 2017 Share Posted January 8, 2017 (edited) 13 hours ago, AnthonyScoffler said: Thanks for the great idea I have one more idea but I do not know if it is great . Take for instance this rocket that will travel in space . Look at the first image, when I draw a path using only one stroke around the planets, with Rotate with Mouse activated, the rocket looks like it is a little bit lost in space. Could an option be added so the tip of the rocket will always head in the right direction as in the second image? One more thing. I do not know why but some of the rockets are smaller than what they should be. Edited January 8, 2017 by Eli 2 Quote Link to comment Share on other sites More sharing options...
Roly Poly Goblinoli Posted January 8, 2017 Author Share Posted January 8, 2017 (edited) 7 hours ago, Eli said: Look at the first image, when I draw a path using only one stroke around the planets, with Rotate with Mouse activated, the rocket looks like it is a little bit lost in space. Could an option be added so the tip of the rocket will always head in the right direction as in the second image? The picture of the spaceship could point in any direction. When you use it as a brush, it could've been upside-down, pointing in a diagonal, etc. The computer doesn't know what direction it points to, so it assumes it points to the right. This is a standard practice with similar algorithms. The fix is easy: go to the first tab and increase Brush Rotation by 90 degrees. It should point to the right when drawn, which means it will work. You know what's cool? If you mentally rotate the spaceships in the first picture by 90 degrees, you'll have the second picture If only that explanation could fit inside the tooltip! Don't forget to check the tooltip at the bottom, though. It shows information for anything you hover the mouse over. Quote One more thing. I do not know why but some of the rockets are smaller than what they should be. I've been fighting it for awhile. I need to resize the image to account for apparent shrinking based on rotation angle. Width = w·|cos φ| + h·|sin φ| Height = w·|sin φ| + h·|cos φ| The problem is that rotating the image increases the image dimensions. I'm trying to draw the image with an absolute size. The size can be larger by a factor as large as √2 at 45-degree angles. You probably know that drawing a 1000x1000 pixel image in a 16x16 space makes it look crummy. That's what's going on. Before I rotate, the image might by 100x100 pixels drawn in a 16x16 space. After rotation, it's 140x140 pixels drawn in the same space, which causes it to be visibly smaller. I need to offset the visual decrease in size by increasing the radius of the brush at drawing time. In the past, I'd tried to increase the size of the brush before rotation, which doesn't work because it's drawn in an absolute size. I'll be tackling that again soon. I suspect drawing at (sqrt(2)cosφ, sqrt(2)sinφ) will do it. Edited January 8, 2017 by AnthonyScoffler 1 Quote Link to comment Share on other sites More sharing options...
Eli Posted January 8, 2017 Share Posted January 8, 2017 56 minutes ago, AnthonyScoffler said: The fix is easy: go to the first tab and increase Brush Rotation by 90 degrees. It should point to the right when drawn, which means it will work. You know what's cool? If you mentally rotate the spaceships in the first picture by 90 degrees, you'll have the second picture Thanks, that is a neat trick to know. Quote Link to comment Share on other sites More sharing options...
Roly Poly Goblinoli Posted January 9, 2017 Author Share Posted January 9, 2017 (edited) Version 1.3 is released. I fixed a rotation issue where angles close to 45 degrees were visibly smaller as a result of weirdness I described in a post above. Thanks to @Eli for bringing my attention back to that issue. I made a Preferences button under the 'other' tab that opens a little window where you can browse and add folders on your computer that Brush Factory should scour when it starts. The textbox is editable, so you can type any reasonable folder or file path in there. It will handle both of them. The brush location settings are stored permanently. I released it a little early (day after last update) because I start another quarter of college tomorrow, which means I'll focus less on this and more on school. But I'll still visit to see what I can do and what I can work on, so please keep addressing concerns. I'll have to face that alpha issue sometime Edited January 9, 2017 by AnthonyScoffler 1 Quote Link to comment Share on other sites More sharing options...
Eli Posted January 10, 2017 Share Posted January 10, 2017 @AnthonyScoffler, Sorry to disturb your studies. I managed to make it crash. How did I do it? I loaded a brush and just kept drawing for a very, very long time without releasing the mouse button (two or three minutes). I do not have a computer with lots of memory so I probably did run out of something. I am posting the crash log. Spoiler This text file was created because paint.net crashed. Please e-mail this to crashlog4@getpaint.net so we can diagnose and fix the problem. Application version: paint.net 4.0.13 (Final 4.13.6191.1824) Time of crash: 1/10/2017 8:35:47 PM Application uptime: 00:09:21.9266349 Application state: Running Working set: 100,624 KiB Handles and threads: 1609 handles, 29 threads, 232 gdi, 273 user Install directory: C:\Program Files\paint.net Current directory: C:\Program Files\Paint.NET OS Version: 10.0.14393.0 Workstation x86 .NET version: CLR 4.0.30319.42000 x86, FX 4.6 Processor: "Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz" @ ~2826MHz (4C/4T, DEP, SSE, SSE2, SSE3, SSSE3, SSE4_1) Physical memory: 3325 MB Video card: ATI Radeon HD 2400 XT (v:1002, d:94C1, r:0), Microsoft Basic Render Driver (v:1414, d:8C, r:0) Hardware acceleration: False (default: True) UI animations: True UI DPI: 96.00 dpi (1.00x scale) UI theme: Aero/Aero + DWM (Aero.msstyles) Updates: False, 6/27/2016 Locale: pdnr.c: en-US, hklm: en-US, hkcu: en-US, cc: en-US, cuic: en-US Flags: Exception details: System.ArgumentException: Parameter is not valid. at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) at System.Drawing.Bitmap..ctor(Int32 width, Int32 height) at BrushFactory.Utils.RotateImage(Bitmap origBmp, Single angle) at BrushFactory.winBrushFactory.DrawBrush(Point loc, Int32 radius) at BrushFactory.winBrushFactory.displayCanvas_MouseMove(Object sender, MouseEventArgs e) at System.Windows.Forms.Control.OnMouseMove(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseMove(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Managed assemblies: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @ C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll PaintDotNet, Version=4.13.6191.1824, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.exe PaintDotNet.Base, Version=4.13.6191.1824, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.Base.dll WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 @ C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @ C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @ C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @ C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 @ C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 @ C:\WINDOWS\Microsoft.Net\assembly\GAC_32\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @ C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll PaintDotNet.Core, Version=4.13.6191.1824, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.Core.dll PaintDotNet.SystemLayer, Version=4.13.6191.1824, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.SystemLayer.dll PaintDotNet.Framework, Version=4.13.6191.1824, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.Framework.dll PaintDotNet.Resources, Version=4.13.6191.1824, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.Resources.dll PaintDotNet.Data, Version=4.13.6191.1824, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.Data.dll PaintDotNet.Effects, Version=4.13.6191.1824, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.Effects.dll PaintDotNet.SystemLayer.Native.x86, Version=4.13.6191.1824, Culture=neutral, PublicKeyToken=null @ C:\Program Files\Paint.NET\PaintDotNet.SystemLayer.Native.x86.dll System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @ C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @ C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @ C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll Quote Link to comment Share on other sites More sharing options...
Roly Poly Goblinoli Posted January 11, 2017 Author Share Posted January 11, 2017 5 hours ago, Eli said: I do not have a computer with lots of memory so I probably did run out of something. I didn't dispose bmpBrushRot. For some reason, despite being a local variable, it won't let me. I don't think drawing is asynchronous, but it seems to have trouble like that. I might look at it more after I get done with homework, but it should be fairly simple. 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.