Ability to Create New Presets from Brush Engines that have no presets
Closed, ResolvedPublic

Description

There is a "chicken and egg" type situation that comes up while the developers are creating new brush engines for Krita. This ticket is to come up with a clear and simple way on how to solve this dilemma.

Once a preset is created for a new brush engine this is not an issue. To clarify...this situation mostly applies to developers, not artists.

From what I know, this is currently what is done in this situation.

When a new brush engine is created in code, there is no process for generating the first brush preset

3.0 process for generating the first brush preset
In 3.x, the work-around is to use the application's (Krita) GUI brush editor to do this. If you change a brush engine, it 'disconnects' the currently selected brush from the editor and changes the settings area to the new engine. From here, a developer can save the brush preset as the new engine type.

4.0 process for generating the first brush preset
In 4.0, this behavior was changed so that you cannot have a "disconnected editor" from your brush. The brush engine drop-down is a filter that filters out brush presets from the full list. It does not actively change the settings area unless a preset is selected. The original reasoning is that a brush engine is a category/filter of a brush preset, not a brush itself. The current work around is to apply this patch that allows for this brush engine settings behavior to function closer to how it did in 3.x
https://phabricator.kde.org/D6525

The patch created other issues, so it could not be merged into master

The goal of this is to come up with a good solution for generating "the first preset" for an engine. This will mostly be useful for developers...so we might not want to call it out too much

scottpetrovic updated the task description. (Show Details)

A couple of points and suggestions that were mentioned already

@woltherav mentioned a potential solution. We could add a drop-down option in the brush area. It could be by the "load default engine brush" in the brush editor. The options would list all the brush engines. Selecting one would create a new brush preset that uses the selected brush engine settings.

Other points we might want to discuss
@dkazakov brought up a point in the 4.0 patch that we need to think about deleting all the default presets in Krita (krita crashes if they are deleted). @rempt mentioned we could store the engine defaults in a QRC file to prevent this situation. I know @Deevad has explained to me that he usually deletes all the default presets that come with krita. I am not sure if he deletes the 'default engine brush preset', but it seems like something we might want to think about.

There is another bizaro situation with the presets that relates to multiple defaults.

Traditionally, Krita is programmed to freak out when it cannot find brush presets in the resources it has loaded. This is to prevent crashes.

Then, during the 2.8 development, Tyson Tan requested a button in the brush settings editor to revert to an "engine default", which Sven Langkamp implemented as kpp files stored in plugins/paintops/defaultpresets.

The question is whether we should still have Krita freak out in this situation or get it to look at those default presets, or is there something more complicated I am missing here? (I think I am, because I am not sure if the resource manager can handle none existent presets?) It would certainly simplify the several times we've been thinking about resource loading changes to improve start up if we don't have to worry about Krita freaking out here.

Deevad added a comment.EditedOct 31 2017, 8:26 AM

I know @Deevad has explained to me that he usually deletes all the default presets that come with krita

@scottpetrovic : Yes, it was necessary when Krita had too many bugs for tagging presets. I kept the habit of deleting all default during a couple of years. It was the only solution for opening Krita and get only my brushkit displayed on new session via the preset docker. Nowaday, Krita preset docker remember the focus on the last selected tag on opening; a good thing since I'm using a lot appimage version (impossible to delete default presets on it).
So, just for the info: I no longer delete all default presets nor I would recommend it; it was a strategy to workaround a bug. No need to take this behavior in account in the current discussion.

@woltherav mentioned a potential solution. We could add a drop-down option in the brush area. [...]

It sounds good!

This is one idea I had for brush management with creating new presets...

It would operate similar to the layers docker. The idea is that if you would click the + icon, it would create a pixel brush engine. If you would click the drop-down by the plus icon, Krita would give options to create other brush engine types like Color Smudge, deform, etc.

I am not sure if this would be part of this ticket, but we could also have a trash can to the bottom right. Clicking it would blacklist the preset that you currently have selected.

Thoughts?

scottpetrovic closed this task as Resolved.Jan 3 2018, 12:41 PM
scottpetrovic claimed this task.

I added that design for now to master. I am going to close this ticket. If there are bugs or issues with what I have we can open up a new task.