Joshua Lamusga

What's next for brush factory?

Recommended Posts

@Joshua Lamusga, thanks for the clarification. Evidently I do have pressure sensitive device, so if you need me to test anything, I'm more than happy too. But I will give you this disclaimer: I'm no artist, and haven't used this pen a whole lot; so my testing will basically be limited to if it works; and not so much to how well it works. In any case, I willing to help :P

Share this post


Link to post
Share on other sites

Thanks, @Sormany. I have friends I can probably borrow from if I need to test it, but I'll keep you in mind in case that doesn't work.

 

Thanks again for completing those PRs, @null54. I think the only thing left is the .abr filetype support, which should probably be in a separate file. Seriously though, you're great.

Share this post


Link to post
Share on other sites

@Greeneyedlady

 

Use the Brush Rotation Slider on the Controls Tab.  Once selected you can use the keyboard keys to fine tune it

 

brush-rotation.jpg

 

On that thought, being able to use [ ] to increase/decrease by 5 would be cool.  Just for a few less clicks.  But I'm lazy so no biggy

(Now even with the Brush rotation selected if you use the brackets it increases/decreases the brush size by 1)

 

Share this post


Link to post
Share on other sites
6 hours ago, welshblue said:

being able to use [ ] to increase/decrease by 5 would be cool

I won't tie the shortcut to the UI control that has active focus because that would surprise most users, but modifying the keyboard shortcuts to incorporate the brackets is a good idea. So changing size doesn't require holding S. Hold R and use brackets to change rotation, A and brackets to change alpha.

 

New points:

- Adjust keyboard shortcuts to use brackets. User shouldn't have to hold Ctrl, but can to make size/rot/alpha change faster.

 

@null54 You're quite a professional programmer; can I take your advice on what you noticed needs overall improvement / rewriting in the code structure? I wrote this some time ago, and while I have a better understanding now, I'm sure it's not as good as yours. Interpolation for localized strings was an unknown pattern to me back then, for example; extern / Interop is still unknown to me.

  • Like 1

Share this post


Link to post
Share on other sites

Until I read :LayersMoveLayerUp: and went to play around, I didn't realise that Ctrl + [ ] changed the size by 5 ... then I read the Github link and learnt even more. (Always assumed that was for code ? Lesson - should never assume)  Extremely well written and comprehensive guide

 

Share this post


Link to post
Share on other sites
5 hours ago, welshblue said:

Until I read :LayersMoveLayerUp: and went to play around, I didn't realise that Ctrl + [ ] changed the size by 5 ... then I read the Github link and learnt even more. (Always assumed that was for code ? Lesson - should never assume)  Extremely well written and comprehensive guide

 

That was a request I made on the previous page, and Null added that.  It made a huge difference as I didn't have to spend time fiddling with the slider.

Share this post


Link to post
Share on other sites
2 minutes ago, TrevorOutlaw said:

That was a request I made on the previous page, and Null added that.  It made a huge difference as I didn't have to spend time fiddling with the slider.

Well you never really did, unless you can't use mouse wheel. This is relevant because right now, Ctrl + R + mouse wheel and Ctrl + A + mouse wheel are the only ways to rotate and change alpha without using a slider.

Share this post


Link to post
Share on other sites
35 minutes ago, Joshua Lamusga said:

Well you never really did, unless you can't use mouse wheel. This is relevant because right now, Ctrl + R + mouse wheel and Ctrl + A + mouse wheel are the only ways to rotate and change alpha without using a slider.

Perhaps I should be clear.

 

I was refering to a request to have CTRL + brackets to control the brush size.  Now, I didn't know about the other combination.  I don't recall seeing anything about those shortcut, so more to play with!  :)

Share this post


Link to post
Share on other sites
On 10/28/2018 at 9:57 AM, Joshua Lamusga said:

can I take your advice on what you noticed needs overall improvement / rewriting in the code structure?

 

I am not sure how much I would be able to help with the code structure, but I do have a few thoughts regarding the UI.

 

I have to agree with @welshblue that a combo box is difficult to use with a large number of brushes, this could become more important when users have multiple ABR files loaded (ABR files often contain 20+ brushes).

 

In the attached version I changed the dialog to use a customized ListView, it provides larger brush thumbnail images and tooltips with the brush name and location.

The other UI change I made was to replace the classic folder browser in the preferences dialog with the Vista-style version.

 

On 10/28/2018 at 9:57 AM, Joshua Lamusga said:

extern / Interop is still unknown to me.

 

I am probably one of the few Paint.NET plugin developers that uses native interop (P/Invoke, COM interop, etc).

C# and the Paint.NET API are powerful enough that most plugins do not need to interact directly with native libraries.

But it is required when your plugins host Photoshop filters or use the Google WebP library.

 

This attachment was superseded by the one in the following post:

https://forums.getpaint.net/topic/113361-whats-next-for-brush-factory/?do=findComment&comment=550627

 

  • Like 3

Share this post


Link to post
Share on other sites

That is so much better @null54 - really nice job.  Easier to differentiate between brush sets now ... especially as I always put the type of brush in text at the front of the folder.

Easy to spot.  Kudos

 

Nifty Add Brush Icon ?

Share this post


Link to post
Share on other sites

Glad you like it.

It could have different background colors based on the brush location, but with the tooltips I am not sure that is necessary.

 

14 minutes ago, welshblue said:

Nifty Add Brush Icon ? 

 

I combined two icons from the Visual Studio Image Library, I was expecting for it to be a placeholder until some of the artists on this forum came up with a better icon. ?

Share this post


Link to post
Share on other sites

I updated the build in the above post to fix an issue with selecting the last used brush when the dialog is displayed a second time.

Share this post


Link to post
Share on other sites

Why didn't I think of that? Here I was, ready to write a custom combo box. This is simply a better approach. I appreciate it.

 

Quote

I updated the build in the above post to fix an issue with selecting the last used brush when the dialog is displayed a second time.

Are you talking about how the brush resets when you open the dialog after you use a brush, select browse for additional brushes, cancel browsing, confirm the dialog and run it again? I was just about to say that it doesn't remember the brush in that corner case. I downloaded it half-an-hour after your message.

 

I'd approve this change if you pull my changes for keyboard shortcuts which I made after your previous merges and take a look at the issue I wrote above, which might be what you're talking about. These are useful changes, for sure.

Share this post


Link to post
Share on other sites
16 minutes ago, Joshua Lamusga said:

Are you talking about how the brush resets when you open the dialog after you use a brush, select browse for additional brushes, cancel browsing, confirm the dialog and run it again? I was just about to say that it doesn't remember the brush in that corner case. I downloaded it half-an-hour after your message.

 

No, but I can see how that behavior occurs.

Fixing it would require tracking the previously selected item index and using that for the brush index in the effect token.

 

One other thing I considered is changing the ListView Anchor styles so that it expands to fill the empty space in the dialog, this may help usability with large numbers of brushes.

Share this post


Link to post
Share on other sites
7 hours ago, null54 said:

I was expecting for it to be a placeholder

 

I can resolve the issue I mentioned by moving add brushes to a button below the list view, so it'll better separate concerns, improve user UI, and remove the need to solve that issue. The button will be the same width as the list view and might have its own icon. I made sample icons at 64 x 64, but I'll probably go for a smaller version of the gray one. The reason I didn't start off with a button was because it didn't look right with a combo box above it (ah, solving many UI problems at once).

 

The icons, if you're wondering.

image.png.e2fd4e8890b3a993094b8d2ad35b2554.png    image.png.dfa089a359ed5807e98aff106fc52c4a.png

Share this post


Link to post
Share on other sites

@null54 and @Joshua Lamusga

 

One thing I have observed since updating the Brush Factory with the pull and released version of the plugin is this behavior:

 

When I load the ABR brush for the first time, the pluging goes through the conversion process of the ABR file, and when that does, the plugin window disappear for a second or two and reappear again.  I don't know if this a normal behavior, but I thought I would bring this up.  If you aren't understanding what I am talking about, I can record a screenshot of it using Parallel tool.

Share this post


Link to post
Share on other sites
1 hour ago, Joshua Lamusga said:

Thanks for the video. It looks like ordinary lag to me, which should be resolved by better image management when I implement lazy-loading brushes.

 

When you say lazy-loading brushes, do you mean that the brush collection will be populated on a background thread?

That would be easy to implement with a BackgroundWorker.

Share this post


Link to post
Share on other sites
2 hours ago, null54 said:

When you say lazy-loading brushes, do you mean that the brush collection will be populated on a background thread?

We can load all images and ABR files in a background thread and add them in real-time to the brush window, that's a start. Memory usage still increases as we load images, so I'd like to delay loading the images until the user can see the thumbnails in the list view (lazy-loading, or more aptly, load-on-demand).

 

This is how it will work:

1. On a separate thread when the plugin starts, crawl listed directories for .abr files and read the number of images in each .abr file.

2. Add an option to the list view for each image, then add an option for each entry in the .abr files we just read.

3. Options have metadata for: doPersist (true for default brushes), isActive (true for selected brush), filePath, isLoaded..

4. Find which items are visible in the list view. If !isLoaded && (doPersist || isActive)), load it from the filePath. If !doPersist && !isActive && isLoaded, unload it.

5. When you load and unload images, do it asynchronously and dispose properly.

 

It would be great if you could develop/inform me about reading the number of images in each .abr file, null54.

Edited by Joshua Lamusga

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now