Combined Brushes and Brush Randomizer

Wouldn’t it be cool if you could select a brush, hold down CTRL (for instance) and select another brush, and another brush,etc? Each selected brush would “override” the settings from the previous brushes to create a composite brush. Then you could try it out and even save that as a new brush. The only technical change would be some GUI logic and a way to “merge” brush settings.

Another idea is a randomizer interface to create new brushes. This is a feature found in musical instrument software tools provided by Korg (and I’m sure many others). The idea is you have say, 50 different variables to produce sounds, why not start off with a completely random set of variables and see if it sounds good. If not, click a button and get a new set of variables. Like rolling the dice to create your character in a role-playing game. Wouldn’t that be a neat way to discover brushes? Maybe the interface would let you lock certain variables like brush radius, or provide thresh-holds to avoid HUGE brushes that make your computer crawl. It would also be nice to limit the number of randomized variables. Say, only randomize 10 settings at a time, or only these particular settings. This could basically be its own standalone GUI program/window and wouldn’t affect anything else as far as the brush engine.

2 Likes

The random brush button sounds fun! For a start that could simply be one button “add new random brush” above “Copy To New” in the Brush Editor. The other controls are nice to have.

I’m not so sure about the combined brushes, though. The results would not be what you expect most of the time. When I make a brush the settings are strongly connected :thinking: and small changes can look very different. You’d probably end up with a brush that looks nothing like the two brushes it was based on… (well of course, I did not test this assumption).
From a technical point: the .myb files save all brush data, regardless if it is the default value or something the user set… So when loading a ctrl-brush it needs to be checked against the “normal”/“default” values for each value, I GUESS. Doesn’t sound too complicated, but I can’t help. GUI and mypaint-libmypaint-interoperation are still too complicated for me :wink:

I’ve gotten as far as adding a button called “Shuffle” to the editor. I have a lot to learn. :slight_smile:

I think you’re right, combining brushes with a replacement of settings would get really crazy. What about this instead-- an “averaging” of the settings, like a cross-pollination? Almost if two brushes had a baby. So if each brush setting is a set of points defining a curve (for each input), we could average two sets of points to get a new curve. That should avoid extremely jarring changes of brushes and be more likely to result in something you might predict.

For the randomize function, the one thing that worries me is that some settings/inputs have a really wide range of allowed values but in practice only a very narrow range is useful or even function. We’d have to identify new ranges that are “sensible” or even blacklist some settings (Opacity Multiply comes to mind). Or, just deal with the likelihood that most brushes generated by the Shuffle are going to be horribly broken :-P.

Another thought I had is that maybe the randomize function only shuffles a random subset of settings per click. Maybe a total of 10 setting/input combinations. This would mean that with each shuffle the brush becomes more complex, which might affect cpu usage.

https://github.com/briend/mypaint/tree/BrushRandomizer

I have something working. It doesn’t quite randomize the brush but it does add two random settings and two random inputs each time you click “Shuffle”. Right now it just adds two points on the curve widget, the min,min and max,max values for the particular setting/input (a big ramp up from left to right). I want to add between 2 and 8 points and have the points randomized (but valid). Also I think an undo button will be nice for when you break the brush horribly and want to quickly go back one step and try again. It’s already pretty fun to see what will happen to the brush.

Alright it’s getting a lot more interesting. The button now generates between 2 and 8 random points on two random settings and two random inputs. If you click the button enough, you WILL get a broken brush. Live update works. You’ll see the settings turn bold when they are modified, so you’ll have an idea what the button did. Also, it tells you on the command line which settings it changed. Couple more things to do like set the button icon, randomize base values and make sure the generated points are always valid. Also really need that undo button for when the brush breaks.

1 Like