Bug 439817 - Those brushes cannot be found after importing "mypaint brush bundle".
Summary: Those brushes cannot be found after importing "mypaint brush bundle".
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Unclassified
Component: Resource Management (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
Depends on:
Blocks: 445282
  Show dependency treegraph
 
Reported: 2021-07-13 22:37 UTC by Eranthis stellata Maxim
Modified: 2021-11-25 13:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eranthis stellata Maxim 2021-07-13 22:37:01 UTC
SUMMARY

Those brushes cannot be found after importing "mypaint brush bundle". 

STEPS TO REPRODUCE

1. Manually import mypaint1.2.1 brushes (.myb and .png).
2. Make a bundle of mypaint brushes. 
3. Restore krita to default. (It's like after the first installation.)
4. Import the "mypaint brush bundle". 

OBSERVED RESULT

The mypaint brush file is included in the mypaint brush bundle, but it cannot be found in krita. 

EXPECTED RESULT

After importing the mypaint brush bundle, find and use the mypaint brush in krita. 

Krita

 Version: 5.0.0-prealpha (git 6010423)
 Languages: zh_CN, zh, en_US, en
 Hidpi: true

Qt

  Version (compiled): 5.12.11
  Version (loaded): 5.12.11

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.19042
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10

OpenGL Info
 
  Vendor:  "Google Inc." 
  Renderer:  "ANGLE (NVIDIA GeForce GTX 970 Direct3D11 vs_5_0 ps_5_0)" 
  Version:  "OpenGL ES 3.0 (ANGLE 2.1.0.57ea533f79a7)" 
  Shading language:  "OpenGL ES GLSL ES 3.00 (ANGLE 2.1.0.57ea533f79a7)" 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
  Current format:    QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile) 
     Version: 3.0
     Supports deprecated functions false 
     is OpenGL ES: true 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsAngleD3D11: true 
  isQtPreferAngle: true 

Hardware Information

  GPU Acceleration: auto
  Memory: 32693 Mb
  Number of Cores: 16
  Swap Location: C:/Users/xi/AppData/Local/Temp

Current Settings

  Current Swap Location: C:/Users/xi/AppData/Local/Temp
  Current Swap Location writable: true
  Undo Enabled: true
  Undo Stack Limit: 30
  Use OpenGL: true
  Use OpenGL Texture Buffer: true
  Use AMD Vectorization Workaround: false
  Canvas State: OPENGL_SUCCESS
  Autosave Interval: 900
  Use Backup Files: true
  Number of Backups Kept: 1
  Backup File Suffix: ~
  Backup Location: Same Folder as the File
  Backup Location writable: false
  Use Win8 Pointer Input: false
  Use RightMiddleTabletButton Workaround: false
  Levels of Detail Enabled: false
  Use Zip64: false


Display Information
Number of screens: 2
	Screen: 0
		Name: \\.\DISPLAY1
		Depth: 32
		Scale: 1
		Resolution in pixels: 2560x1440
		Manufacturer: 
		Model: 
		Refresh Rate: 59
	Screen: 1
		Name: \\.\DISPLAY2
		Depth: 32
		Scale: 1
		Resolution in pixels: 1920x1080
		Manufacturer: 
		Model: 
		Refresh Rate: 60
Comment 1 amyspark 2021-10-17 19:30:53 UTC
I cannot reproduce on commit 804225bc51. Can you check if your user folder has a copy of these old brushes? if so, can you try removing them, regenerate the database and check if the brush pack appears?
Comment 2 amyspark 2021-10-17 19:44:42 UTC
(Apologies for the previous comment, I copy/pasted it from another bug report.)

Confirming on commit 804225bc51. Bundle manifest shows that MyPaint brushes that are exported are listed as ".kpp", but the actual file has ".myb". On load, this appears in the log:

Bundle "C:/Users/Amalia/AppData/Roaming/krita/Test_Mypaint.bundle" is broken. File "paintoppresets/c)_Pencil_1_Sketch_(mypaint amyspark).kpp" is missing
Bundle "C:/Users/Amalia/AppData/Roaming/krita/Test_Mypaint.bundle" is broken. File "paintoppresets/c)_Pencil_2b_(mypaint amyspark).kpp" is missing
Comment 3 Tiar 2021-10-17 19:49:12 UTC
Kind of funny since I just reported this bug: bug 443907, which talks about bundle manifest having wrong filenames.
Comment 4 amyspark 2021-10-18 00:10:36 UTC
They do have the correct filenames *grins* but MyPaint brushes serialization is completely broken. The original author assumed they'd be read as JSON; but on saving to disk, the save format is KoResource's PNG serialization, which is in turn ignored by the loadFromDevice impl.
Comment 5 amyspark 2021-10-18 00:15:04 UTC
If I may amend the above, MyPaint brushes loaded from .myb will preserve their extensions on save, which is wrong because of the change in serialization format.
Comment 6 Bug Janitor Service 2021-10-18 01:40:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1102
Comment 7 Halla Rempt 2021-10-19 07:57:24 UTC
Git commit cbf78192cb7e3a4774de736cf2bd2e4dec91f6da by Halla Rempt, on behalf of L. E. Segovia.
Committed on 19/10/2021 at 07:51.
Pushed by rempt into branch 'master'.

MyPaint: accept brushes serialized as KPP and fix their names

M  +34   -5    plugins/paintops/mypaint/MyPaintPaintOpPreset.cpp
M  +5    -0    plugins/paintops/mypaint/MyPaintPaintOpPreset.h

https://invent.kde.org/graphics/krita/commit/cbf78192cb7e3a4774de736cf2bd2e4dec91f6da
Comment 8 Dmitry Kazakov 2021-11-17 14:01:09 UTC
Git commit ea5450925630338c79be9af21a9468f458ae11ff by Dmitry Kazakov, on behalf of L. E. Segovia.
Committed on 17/11/2021 at 13:47.
Pushed by dkazakov into branch 'krita/5.0'.

MyPaint: accept brushes serialized as KPP and fix their names

M  +34   -5    plugins/paintops/mypaint/MyPaintPaintOpPreset.cpp
M  +5    -0    plugins/paintops/mypaint/MyPaintPaintOpPreset.h

https://invent.kde.org/graphics/krita/commit/ea5450925630338c79be9af21a9468f458ae11ff
Comment 9 amyspark 2021-11-25 13:49:14 UTC
Git commit 14e8cd88b267d0c083cb7bee693d02f684d022d6 by L. E. Segovia.
Committed on 25/11/2021 at 13:47.
Pushed by lsegovia into branch 'krita/5.0'.

Fix naming of MyPaint brushes on versioned serialization

Before this commit, versioned .myb files would apply the .kpp suffix,
only to be overridden by the save preset dialog.
Related: bug 445281, bug 445282

M  +5    -6    libs/ui/dialogs/KisDlgSavePreset.cpp
M  +6    -4    plugins/paintops/mypaint/MyPaintPaintOpPreset.cpp
M  +0    -7    plugins/paintops/mypaint/MyPaintPaintOpPreset.h

https://invent.kde.org/graphics/krita/commit/14e8cd88b267d0c083cb7bee693d02f684d022d6
Comment 10 amyspark 2021-11-25 13:53:44 UTC
Git commit a4f84ca9a3070ff4fe5949da3e8028fe131f3b26 by L. E. Segovia.
Committed on 25/11/2021 at 13:50.
Pushed by lsegovia into branch 'master'.

Fix naming of MyPaint brushes on versioned serialization

Before this commit, versioned .myb files would apply the .kpp suffix,
only to be overridden by the save preset dialog.
Related: bug 445281, bug 445282
(cherry picked from commit 14e8cd88b267d0c083cb7bee693d02f684d022d6)

M  +5    -6    libs/ui/dialogs/KisDlgSavePreset.cpp
M  +6    -4    plugins/paintops/mypaint/MyPaintPaintOpPreset.cpp
M  +0    -7    plugins/paintops/mypaint/MyPaintPaintOpPreset.h

https://invent.kde.org/graphics/krita/commit/a4f84ca9a3070ff4fe5949da3e8028fe131f3b26