Better way to create brush bundles

There needs to be a better way to create brush bundles. Right now the process is too tedious.

  • Problem: Creating bundles based on existing bundles require importing the bundle, which will duplicate brushes that already exist in your brush presets. This is a problem if you create the brushes, then create the bundles for those brushes, then try to add a new brush to the bundle, where you need to import that bundle, which end up duplicating the brushes (which I don’t ever see a use-case for having two of the same exact brushes). The work-around is to delete the bundle every time after you update the bundle and back it up somewhere else. This makes updating and creating bundles very annoying as these steps are counter-intuitive.
    Solution: Add a bundle identifier for Krita to know that when a bundle is imported, it checks to see if the bundle is already in use, and do not import those brushes if the identifier already exists. Importantly, this identifier is cached with the local Krita when the bundle is created, where Krita will consider the bundle to be automatically in use because obviously the bundle is created based on brushes that already exist in your Krita brush presets (again no reason why a user would want to duplicate brushes by importing bundles). Obviously, there must be some bundle identifier already, but it needs to apply when bundles are created as well and not just imported, i.e., when bundles are created, they are also imported. Maybe add an option to turn this on.

  • Problem: Bundles don’t include textures, would be good if a brush bundle would contain all the settings required to make the brush function exactly as the way when it was imported.
    Solution: Add textures to brush bundles when they are created. I don’t really understand why this is not a feature in the first place.

  • Problem: Allow creation of bundles based on tags. Current creation of bundles require selecting from potentially hundreds of brushes. The UI for selecting these brushes is not resizable on my Krita for some reason, so the brush names are cut off and so if two brushes have the same icon, I cannot tell which brush is which.
    Solution: Allow creation of bundles based on tags. You basically select a tag of brush presets and export them all as a bundle. Importing that bundle should also automatically tag those brushes with the same tag as when it was exported. This is convenient if a user uses Krita between multiple devices and want the same brushes with the same tags across those devices. This potentially allows Krita to sync brushes from the cloud as well.

2 Likes

They don’t include them AUTOMATICALLY, right now you have to add them by hand!

It contains all the settings, but it can happen that it does not contain all the resources, i.e., it is possible that the texture is missing.
How should a bundle determine what you want to have into that bundle? If it takes the state of the time you have imported the bundle that is the base for your new one, you would always save unmodified presets. If there should be an automatism for this, the brush should contain the texture that it holds at time of bundle-creation, which can be a different one. Exact in the way it is for the brush tips since Krita 5, when a texture is part of a preset it should be in a bundle you create with this preset.

Oops, it is 5:40am, I have to go to sleep for now!

Michelist

Sorry but the way this is written feels very confusing to understand. I usually make bundles based on other bundles, as i like to just import the brushes i want to use instead of everything in the bundle.
I am trying to understand this part:

What exactly you mean by this? from the steps that i know you need to import the bundle into krita in the first place to be able to create the bundle for it, but after you create this new bundle you can delete it from krita that what i do here. do you mean when you have both bundles active?

i guess you mean by the bundle contents not the bundle itself, check the contents of the bundle are the same, i think there is already a md5sum for presets that could be used for the check or another type of hash based on the brush settings and name (code wise would be a hash based on the string in the preset tag in the brush metadata that contains all the settings). but i agree with you if the brush is the exact same makes no sense importing twice.

it existis but it wont help you in this case, as it check the bundle file not the contents. if you try to import a bundle twice you will see a message telling you it is already imported.

About the texture i agree it should be added alongside the brush tip when adding a preset.

Check for dependencies, in the brush preset is saved both the brush tip and the pattern it uses so just as the brush tip is added when the preset is added to the bundle just check if the brush preset uses a pattern / texture

i completely agree with this, alongside this i will add a better ui for bundle creation. allow to filter brushes by tag and bundle, be able to search for resource name and a better visualization of what is inside the bundle already.

i dont really see how creating bundles from tags would help with this though, and i disagree that it allows krita to sync brushes.

My statement was based on this aspect of @Whey’s statement:

I know this, but @Whey asked that the preset should be incorporated into the new bundle like it came out of the bundle it is based upon. What if you have changed the texture in between? You would probably be astonished or even feel niggled in such a case to find the initial preset like it came out of the original bundle in the new bundle. That is why I added:

Which can be intentional, but how should Krita know that now? And, if Krita from now on would act the way @Whey asked for, you never can save a modified preset in the future.

Michelist

From what i understood reading what whey said they mean if the preset is the the exact same, changing the texture already changes the preset. As it was explained here:

When they say that i interpreted it in the way that they want to create a bundle with the presets of another bundle, no changes at all. In this case the way they wrote makes sense, however if we think in the way that you probably thought that you changed something about the brush and overwrote the original, i agree with you it doesn’t make any sense at all.
In this case what should happen in my opinion is that the current preset to be added with all the modifications made. If you overwrite a brush means you don’t want the original anyway, otherwise you would create a new brush preset.
But all dependencies this modified preset has to work properly should be added to the bundle.

You mean you overwrote the preset from a bundle? I would understand that it’s a different brush, as it is stored in a different location and also the texture is different, if we use a hash to identify brushes the hash would be different.

I understand that they don’t know in depth how the bundle and preset files work or how the resource system handles them, i also don’t claim i know how everything works but i have some understanding about them so i can imagine a way it would work.

The way they described i agree it doesn’t make much sense but i don’t think it blocks saving modified presets.
From what i understand from your original post you are assuming, probably by how whey wrote that, that all decision on which brush should be imported be based on the bundle itself, so you say that if it works this way and it uses the first bundle imported as the one that it should have the presets imported it would cause problems.

I agree that this would cause problems, but i also don’t think it would work at all if the check was made like that. Again i don’t know all the details by how bundles are imported so this info can be wrong but the way i understand is if we just check by let’s say preset name and bundle date we run into the issue of not importing completely different presets with the same name.

There is no way for krita to know a preset was originally from another bundle (by this i mean, the preset in this bundle was originally from another bundle, this information is not stored anywhere i think). The only way we can create any sort of link is by the preset name so in the case of people naming different presets the same name and we use this check we would not import some presets. This is a complete faulty check, even in the case the preset was the same and some settings were changed, the settings changed already define that this is another preset.

So to me this already doest work and i don’t even consider this a valid solution. Reason why i also said this in my response to them:

However even in this scenario i still don’t see this blocking being able to save a modified preset. As the way i understand how krita handles brush overwriting is by creating a new preset, but the filename is different (filename and the preset name are different informations for krita you can have a brush with a filename and preset name being completely different) and it hides the original. For bundles it creates a new folder to add all the overwrites. And the way krita handles it i would assume you would still have the overwritten preset there.

But anyway this solution already doesnt work for many reasons so no need to get too in depth on how it would work i think.

What i think it would work as a better check is what I said in my post of checking the hash of the brush preset based on the preset tag in the brush presets file metadata ( which is how all the preset settings are stored) which contains the preset name and all the settings. The way hashes work is that one string will always give you the same hash so if we transform the string into a hash and compare to a hash with a brush of same filename or preset name we can easily check if they are the same or not. a positive would mean they are the exact same so wouldn’t make any difference which version would be kept. Also in the case of one of the bundles being dectivated the preset should be shown as it still exists in another bundle.

I think it would be sufficient to enable Krita, apart from the brush tips already taken into account, to automatically integrate the textures possibly linked to the preset into a bundle, i.e., to treat the textures like the brush tips. This way, you no longer have to worry about overlooking a resource when importing into new bundles.

I prefer it simple, but I confess I felt challenged by Whey’s text and had to comment on this conceivable problem :wink:

But now I don’t care anymore, I have too much else to do at the moment.

Michelist

That would solve one problem but not the other, to me both can be solved. Though i honestly think that if krita reworked the way they deal with resources to maybe use a database to store the settings for the brush not just the path to it would be simpler to do these sort of things.

It is all stored in the “resourcecache.sqlite”, every resource, its hash, settings, everything, even the bitmap-data of the resources are stored there, if I remember this correctly.
Only the textures aren’t taken into account, if a new bundle is created.
@tiar should be able to give an in depth explanation on this, I think.

Michelist

Sorry i but looked each table in that database recently and i don’t remember seeing all this information you are talking about in there though i would like to see tiar input on this to see if i am missing something in my understanding .

I may have misunderstood the posting where I’ve read (something like) this, but I haven’t looked it up, I recapitulated. And I don’t have a good “relationship” with databases in particular. I don’t like them.

Michelist

I also seek a convenient way to create and then maintain a bundle. At this point, if I want to make an update to the existing bundle (that I originally create) I have actually recreate it from scratch :confused:

It would be nice to dynamically add or remove some parts from the bundle and then release it with a new version tag.

4 Likes

That should be feasible, you have to update the manifest.xml in the bundle’s-folder META-INF, and every resource you add needs a md5-checksum. Only possible issue may be if Krita does not look into this file in case the bundle is found in the DB. But if the manifest.xml is read every start of Krita it should work, it may pay out for a few new entries, but it would be a chore to make a lot of them…
:wink:

Michelist

1 Like

Ideally, a bundle creator would also edit bundles, and would be more convenient. It’s planned, there should be even a thread with GUI mockups for bundle creator, maybe? But I got a bit fed up with resource management and I’m not sure who would do it. Resource code wise, it shouldn’t be difficult. But it wouldtake some time.

1 Like

Would it be a problem to add an automatically import of the patterns when creating the bundle, like the brush tips?

Michelist

It should be already happening, I didn’t make an exception for brush tips but just added all “dependent” resources… if it doesn’t happen, please create a bug report.

Maybe it doesn’t happen because the brush presets already contain them…

I’ve opened .bundle file and I’ve seen that there is a manifest with md5s which is hopefully going to be used to filter out duplicate brushes but due to that I can’t just shove new files into the archive. Thus I really really need a feature in krita that lets me modify the .bundle file. Adding, updating, deleting files and the manifest getting updated automatically. Esp. changing embedding tags is important. Changing info and preview pic would also be nice.

You might want to add your feedback here in this thread by @Srirupa_Datta

3 Likes

I was very surprised to discover that this isn’t possible! And what’s worse, there appears to be no way to filter the brushes at all – not by tag, by string search, or anything – when adding to a bundle. So you have to manually scroll through every single brush looking for the each individual one to add? Is that correct? (In a non-resizable window which cuts off the end of brush names.)

Pretty much every other place you interact with resources there’s both a tag filter and a text search available.

I also tried selecting the resources I want to export (in “Manage Resources”) and clicking “Create bundle”, but no luck – the “Create bundle” dialog starts from scratch regardless.

Sorry to revive this years-old thread, but I just want to confirm that I’m not missing something here :sweat_smile:

I’m using the latest Krita appimage, by the way – 5.2.11.