Bug 446292 - Can't change Ten Brushes brushes
Summary: Can't change Ten Brushes brushes
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 5.0.0-beta2
Platform: Compiled Sources Microsoft Windows
: NOR major
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords: regression, release_blocker
Depends on:
Blocks:
 
Reported: 2021-11-30 17:34 UTC by Stig (Rakurri)
Modified: 2021-12-16 11:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stig (Rakurri) 2021-11-30 17:34:43 UTC
SUMMARY
Ten Brushes has stopped working as intended for me in the latest versions of Krita 5.0 beta, I can't change the brushes used by the plugin and are stuck with those I had in Krita 4.x

STEPS TO REPRODUCE
1. Try to change a the brushes in Ten Brushes (Tools -> Scripts -> Ten Brushes")
2.  Try to use the shortcuts to change between them. Or go back in the menu to see there were no changes
3. Changes were not applied.

OBSERVED RESULT
Can't configure or change the brushes used by Ten Brushes

EXPECTED RESULT
Being able to configure and change brushes

SOFTWARE/OS VERSIONS
Windows 10
Krita Plus - 5.0.0-beta2 (git a642eb0)
Comment 1 Stig (Rakurri) 2021-11-30 17:35:18 UTC
System Info
Krita

 Version: 5.0.0-beta2 (git a642eb0)
 Languages: en_US, en, en_US, en, en_US, en, en_US, en, nn_NO, nn, en_US, en
 Hidpi: true

Qt

  Version (compiled): 5.12.12
  Version (loaded): 5.12.12

OS Information

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

OpenGL Info
 
  Vendor:  "Google Inc." 
  Renderer:  "ANGLE (NVIDIA GeForce RTX 2070 SUPER 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 
  supportsBufferMapping: true 
  supportsBufferInvalidation: false 
  Extensions: 
     "GL_EXT_read_format_bgra" 
     "GL_CHROMIUM_copy_compressed_texture" 
     "GL_ANGLE_program_cache_control" 
     "GL_EXT_discard_framebuffer" 
     "GL_EXT_texture_compression_s3tc_srgb" 
     "GL_EXT_texture_rg" 
     "GL_ANGLE_client_arrays" 
     "GL_ANGLE_request_extension" 
     "GL_OES_texture_npot" 
     "GL_ANGLE_texture_usage" 
     "" 
     "GL_EXT_color_buffer_half_float" 
     "GL_OES_mapbuffer" 
     "GL_OES_EGL_image" 
     "GL_EXT_shader_texture_lod" 
     "GL_EXT_texture_format_BGRA8888" 
     "GL_OES_packed_depth_stencil" 
     "GL_EXT_color_buffer_float" 
     "GL_OES_EGL_image_external_essl3" 
     "GL_ANGLE_framebuffer_multisample" 
     "GL_CHROMIUM_sync_query" 
     "GL_OES_compressed_ETC1_RGB8_texture" 
     "GL_ANGLE_texture_compression_dxt3" 
     "GL_EXT_debug_marker" 
     "GL_OES_get_program_binary" 
     "GL_OES_rgb8_rgba8" 
     "GL_CHROMIUM_bind_uniform_location" 
     "GL_ANGLE_translated_shader_source" 
     "GL_CHROMIUM_color_buffer_float_rgba" 
     "GL_OES_surfaceless_context" 
     "GL_EXT_texture_norm16" 
     "GL_NV_EGL_stream_consumer_external" 
     "GL_EXT_frag_depth" 
     "GL_OES_texture_half_float" 
     "GL_ANGLE_pack_reverse_row_order" 
     "GL_ANGLE_depth_texture" 
     "GL_NV_fence" 
     "GL_KHR_debug" 
     "GL_NV_pixel_buffer_object" 
     "GL_ANGLE_multiview" 
     "GL_EXT_texture_storage" 
     "GL_ANGLE_texture_compression_dxt5" 
     "GL_OES_EGL_image_external" 
     "GL_EXT_blend_minmax" 
     "GL_EXT_disjoint_timer_query" 
     "GL_ANGLE_robust_client_memory" 
     "GL_OES_depth32" 
     "GL_OES_vertex_array_object" 
     "GL_ANGLE_lossy_etc_decode" 
     "GL_OES_standard_derivatives" 
     "GL_ANGLE_instanced_arrays" 
     "GL_OES_texture_float" 
     "GL_EXT_sRGB" 
     "GL_NV_pack_subimage" 
     "GL_EXT_occlusion_query_boolean" 
     "GL_CHROMIUM_copy_texture" 
     "GL_EXT_map_buffer_range" 
     "GL_OES_texture_float_linear" 
     "GL_EXT_robustness" 
     "GL_EXT_draw_buffers" 
     "GL_OES_texture_half_float_linear" 
     "GL_CHROMIUM_bind_generates_resource" 
     "GL_CHROMIUM_color_buffer_float_rgb" 
     "GL_EXT_texture_filter_anisotropic" 
     "GL_EXT_texture_compression_dxt1" 
     "GL_EXT_unpack_subimage" 
     "GL_OES_element_index_uint" 
     "GL_ANGLE_framebuffer_blit" 

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

useBufferInvalidation (config option): false


Hardware Information

  GPU Acceleration: auto
  Memory: 40873 Mb
  Number of Cores: 8
  Swap Location: C:/Users/sti-n/AppData/Local/Temp

Current Settings

  Current Swap Location: C:/Users/sti-n/AppData/Local/Temp
  Current Swap Location writable: true
  Undo Enabled: true
  Undo Stack Limit: 100
  Use OpenGL: true
  Use OpenGL Texture Buffer: true
  Disable Vector Optimizations: false
  Disable AVX Optimizations: false
  Canvas State: OPENGL_SUCCESS
  Autosave Interval: 120
  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: 3
	Screen: 0
		Name: \\.\DISPLAY1
		Depth: 32
		Scale: 1
		Resolution in pixels: 2560x1440
		Manufacturer: 
		Model: 
		Refresh Rate: 144
	Screen: 1
		Name: \\.\DISPLAY2
		Depth: 32
		Scale: 1
		Resolution in pixels: 1920x1080
		Manufacturer: 
		Model: 
		Refresh Rate: 60
	Screen: 2
		Name: \\.\DISPLAY3
		Depth: 32
		Scale: 1
		Resolution in pixels: 1920x1080
		Manufacturer: 
		Model: 
		Refresh Rate: 60
Comment 2 Ahab Greybeard 2021-12-03 10:15:52 UTC
I can Confirm this for the 5.0.0-beta2, 5.0.0-beta3 and the Dec 02 5.1.0-prealpha (git 3eb5d55) appimages on Debian 10.
It works in the 5.0.0-beta1.

New entries are shown when made but are not saved and are not there when you reopen it.
If you try to change an existing brush, that entry is deleted and no longer works.
Comment 3 Dmitry Kazakov 2021-12-09 12:20:11 UTC
Hi, Ahab and Stig!

Could you please try to reset your settings file and resources folder? I have a feeling like there was some problem with the state of the local settings folder, because I could reproduce this bug before, but now after resetting the folders I cannot. I tried on on master, krita/5.0, beta5, beta3. All of them seem to work fine. I tried master on both Linux and Windows, and the rest on Linux only.
Comment 4 Dmitry Kazakov 2021-12-09 12:41:28 UTC
I also tried to assign brushes in Kirta 4.4.8 and then open them in Krita 5.0-beta3. On opening Krita 5.0-beta3 all the slots were reset to empty, but I could assign them successfully. The shortcuts loaded from 4.x fine.
Comment 5 Ahab Greybeard 2021-12-09 15:47:59 UTC
Hi Dmitry,

If I run 4.4.8 with a fresh resources folder and fresh configs, I can make brush preset shortcuts using Ten Brushes.
If I then run 5.0.0-beta3, the Ten Brushes slots are empty, even though the kritarc file has them listed, but I can fill them and use them with no problem.
Quiting then updates the kritarc file.
If I then run the Dec 08 5.1.0-prealpha, all behaves normally.
If I then run 4.4.8, Ten Brushes is empty, even though kritarc has them listed.

Initially, I had an 'old' resources folder that had been used with various different versions and I got this error message when trying to change Ten Brushes with the Dec 08 5.1.0-prealpha:

--------start of error message-------------------------
AttributeError
Python 3.8.1: /usr/bin/python3
Thu Dec  9 15:01:14 2021

A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.

 /home/adminahab/.local/share/krita/tenbrushes/dropbutton.py in selectPreset(self=<tenbrushes.dropbutton.DropButton object>)
   26         self.setIconSize(QSize(64, 64))
   27 
   28     def selectPreset(self):
   29         self.preset = self.presetChooser.currentPreset().name()
   30         self.setIcon(QIcon(QPixmap.fromImage(self.presetChooser.currentPreset().image())))
self = <tenbrushes.dropbutton.DropButton object>
self.preset = 'a)_Eraser_Circle'
self.presetChooser = <PyKrita.krita.PresetChooser object>
self.presetChooser.currentPreset = <built-in method currentPreset of PresetChooser object>
).name undefined
AttributeError: 'NoneType' object has no attribute 'name'
    __cause__ = None
    __class__ = <class 'AttributeError'>
    __context__ = None
    __delattr__ = <method-wrapper '__delattr__' of AttributeError object>
    __dict__ = {}
    __dir__ = <built-in method __dir__ of AttributeError object>
    __doc__ = 'Attribute not found.'
    __eq__ = <method-wrapper '__eq__' of AttributeError object>
    __format__ = <built-in method __format__ of AttributeError object>
    __ge__ = <method-wrapper '__ge__' of AttributeError object>
    __getattribute__ = <method-wrapper '__getattribute__' of AttributeError object>
    __gt__ = <method-wrapper '__gt__' of AttributeError object>
    __hash__ = <method-wrapper '__hash__' of AttributeError object>
    __init__ = <method-wrapper '__init__' of AttributeError object>
    __init_subclass__ = <built-in method __init_subclass__ of type object>
    __le__ = <method-wrapper '__le__' of AttributeError object>
    __lt__ = <method-wrapper '__lt__' of AttributeError object>
    __ne__ = <method-wrapper '__ne__' of AttributeError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of AttributeError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of AttributeError object>
    __repr__ = <method-wrapper '__repr__' of AttributeError object>
    __setattr__ = <method-wrapper '__setattr__' of AttributeError object>
    __setstate__ = <built-in method __setstate__ of AttributeError object>
    __sizeof__ = <built-in method __sizeof__ of AttributeError object>
    __str__ = <method-wrapper '__str__' of AttributeError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __suppress_context__ = False
    __traceback__ = <traceback object>
    args = ("'NoneType' object has no attribute 'name'",)
    with_traceback = <built-in method with_traceback of AttributeError object>

The above is a description of an error in a Python program.  Here is
the original traceback:

Traceback (most recent call last):
  File "/home/adminahab/.local/share/krita/tenbrushes/dropbutton.py", line 29, in selectPreset
    self.preset = self.presetChooser.currentPreset().name()
AttributeError: 'NoneType' object has no attribute 'name'
----------- end of error message ---------------------------

If I restore the old resources folder, I can't replicate this error message.
Comment 6 Stig (Rakurri) 2021-12-11 01:06:22 UTC
(In reply to Dmitry Kazakov from comment #3)
 Hi! Yep that worked! 😁 Thank you very much. I will soon try bringing the presets and most important settings back as I have wanted to have a christmas cleaning of my Krita folder for Krita 5. I think this is solved, but if I experience the problem again I will send a message! Should I change this bug report to resolved?
Comment 7 Bug Janitor Service 2021-12-11 04:35:11 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 8 Dmitry Kazakov 2021-12-16 11:57:13 UTC
Git commit 9ffe46d0b44adcd1ea8f0410f35ea9cf16136e9c by Dmitry Kazakov.
Committed on 16/12/2021 at 11:56.
Pushed by dkazakov into branch 'master'.

Fix loading presets into Ten Brushes plugin with settings from Krita 4.x

In Krita 4.x we used to replace spaces in preset names with
underscores, which has changed in Krita 5.x. Here we just
try hard to load the legacy preset.

M  +13   -5    plugins/python/tenbrushes/tenbrushes.py

https://invent.kde.org/graphics/krita/commit/9ffe46d0b44adcd1ea8f0410f35ea9cf16136e9c
Comment 9 Dmitry Kazakov 2021-12-16 11:57:54 UTC
Git commit fc632cc5b2032e6f1d6d35139677a9f8b652ea86 by Dmitry Kazakov.
Committed on 16/12/2021 at 11:57.
Pushed by dkazakov into branch 'krita/5.0'.

Fix loading presets into Ten Brushes plugin with settings from Krita 4.x

In Krita 4.x we used to replace spaces in preset names with
underscores, which has changed in Krita 5.x. Here we just
try hard to load the legacy preset.
(cherry picked from commit 9ffe46d0b44adcd1ea8f0410f35ea9cf16136e9c)

M  +13   -5    plugins/python/tenbrushes/tenbrushes.py

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