SUMMARY When creating brush tips, if one adjusts the tip, and then 'recreates' the brush tip with the stamp or clipboard options, Krita just creates a new brush tip entry, and doesn't consider this a new version of the old one. When opening a brush tip in Krita and editing it, Krita does load the new tip, but does not update the icon in the database, leading to confusion in usage. Finally, when loading brushtips no metadata is kept about the state of the brush as imported, such as the spacing and whether or not to keep the alpha channel, leading to a lot of confusion. SOFTWARE/OS VERSIONS Krita Version: 5.0.0-prealpha (git dfadcb9) Languages: en_US, en, en_GB, en, nl, en_US, en Hidpi: true Qt Version (compiled): 5.15.2 Version (loaded): 5.15.2
The same problem holds for patterns: and any other resource we edit as a krita document, like gamut maps.
As an aside, I recall when I was going over each of those, whether we shouldn't also have a centralized function that checks if a resource name will overwrite, because right now it's all over the place.
I tried to smooth over some issues with the saving of gbr files by way of this patch: ---------- diff --git a/plugins/impex/brush/KisWdgOptionsBrush.cpp b/plugins/impex/brush/KisWdgOptionsBrush.cpp index 7d833dff0b..682f8984db 100644 --- a/plugins/impex/brush/KisWdgOptionsBrush.cpp +++ b/plugins/impex/brush/KisWdgOptionsBrush.cpp @@ -40,7 +40,7 @@ void KisWdgOptionsBrush::setConfiguration(const KisPropertiesConfigurationSP cfg if (nameLineEdit->text().isEmpty()) { nameLineEdit->setText(cfg->getString("name")); } - colorAsMask->setChecked(cfg->getBool("mask")); + colorAsMask->setChecked(!cfg->getBool(KisImportExportFilter::ImageContainsTransparencyTag, false)); brushStyle->setCurrentIndex(cfg->getInt("brushStyle")); dimensionSpin->setValue(cfg->getInt("dimensions")); ----------------- However, while it may seem to work initially, when I introduce transparency it doesn't work anymore??? Maybe I am misunderstanding how import/exportfilter works :/
I think the export code should probably check whether this resource already exists and then use the resourceserver to update the resource.
(In reply to Halla Rempt from comment #4) > I think the export code should probably check whether this resource already > exists and then use the resourceserver to update the resource. I'd be careful with that, don't forget people might want to save these resources outside of the resource folder for whatever reason. Maybe a checkbox???
Yes, I'm keeping that in mind.
Git commit c8b1df11eadc111e17797b6ca03a92bb601a38c8 by Halla Rempt. Committed on 11/05/2021 at 12:44. Pushed by rempt into branch 'master'. Check in the resource folder whether we are saving a resource Brushes and patterns can be saved in the resource folder. When doing so, the normal export code would bypass the versioning, so use the resources model. M +8 -0 libs/resources/KoResource.cpp M +2 -0 libs/resources/KoResource.h M +103 -42 libs/ui/KisDocument.cpp M +9 -4 libs/ui/KisDocument.h M +1 -1 libs/ui/kis_favorite_resource_manager.h D +0 -47 libs/widgets/KoResourceServerObserver.h M +2 -2 libs/widgets/KoResourceServerProvider.cpp M +1 -1 plugins/dockers/artisticcolorselector/artisticcolorselector_dock.cpp M +1 -1 plugins/dockers/artisticcolorselector/artisticcolorselector_dock.h M +1 -1 plugins/dockers/gamutmask/gamutmask_dock.cpp M +1 -1 plugins/dockers/gamutmask/gamutmask_dock.h M +1 -1 plugins/dockers/palettedocker/palettedocker_dock.h https://invent.kde.org/graphics/krita/commit/c8b1df11eadc111e17797b6ca03a92bb601a38c8