Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It crash the plugin when you change the harmony #23

Open
RamonKrita opened this issue Nov 3, 2024 · 4 comments
Open

It crash the plugin when you change the harmony #23

RamonKrita opened this issue Nov 3, 2024 · 4 comments
Labels
invalid This doesn't seem right

Comments

@RamonKrita
Copy link

It happens when i change the harmony from Analogus to complementary. Maybe the photo helps? The fail, makes Krita not usable and the user needs to restart.

70802d1c80a93683fd5d9e2a94ded995a3f5e4e7

Now i need to put the text complete here isn't it?

@RamonKrita
Copy link
Author

Now i am testing in Krita 5.2.6 and i get this

UnboundLocalError
Python 3.10.7: C:\Users\Ramon\Downloads\krita-x64-5.2.6\bin\krita.exe
Sun Nov 3 11:08:47 2024

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

C:\Users\Ramon\AppData\Roaming\krita\pykrita\pigment_o\pigment_o_docker.py in Harmony_Rule(self=<pigment_o.pigment_o_docker.PigmentO_Docker object>, harmony_rule='Triadic')
5871 self.harmony_rule = harmony_rule
5872 self.harmony_spread.Set_Rule( self.harmony_rule )
5873 self.Pigmento_RELEASE()
5874 Krita.instance().writeSetting( "Pigment.O", "harmony_rule", str( self.harmony_rule ) )
5875 def Harmony_Edit( self, harmony_edit ):
self = <pigment_o.pigment_o_docker.PigmentO_Docker object>
self.Pigmento_RELEASE = >

C:\Users\Ramon\AppData\Roaming\krita\pykrita\pigment_o\pigment_o_docker.py in Pigmento_RELEASE(self=<pigment_o.pigment_o_docker.PigmentO_Docker object>)
4292 def Pigmento_RELEASE( self ):
4293 self.widget_press = False
4294 self.Sync_Elements( True, True, True )
4295
4296 #endregion
self = <pigment_o.pigment_o_docker.PigmentO_Docker object>
self.Sync_Elements = <bound method PigmentO_Docker.Sync_Elements of <pigment_o.pigment_o_docker.PigmentO_Docker object>>

C:\Users\Ramon\AppData\Roaming\krita\pykrita\pigment_o\pigment_o_docker.py in Sync_Elements(self=<pigment_o.pigment_o_docker.PigmentO_Docker object>, p2k=True, color_active=True, color_previous=True)
5015 # Layout
5016 self.Pigmento_to_Krita( p2k )
5017 self.Harmony_Header( har_01, har_02, har_03, har_04, har_05 )
5018 self.Update_Header( color_active, color_previous )
5019 self.Panels_Set_Value()
self = <pigment_o.pigment_o_docker.PigmentO_Docker object>
self.Harmony_Header = <bound method PigmentO_Docker.Harmony_Header of <pigment_o.pigment_o_docker.PigmentO_Docker object>>
global har_01 = {'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}
global har_02 = {'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}
global har_03 = {'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}
global har_04 = {'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}
global har_05 = {'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}

C:\Users\Ramon\AppData\Roaming\krita\pykrita\pigment_o\pigment_o_docker.py in Harmony_Header(self=<pigment_o.pigment_o_docker.PigmentO_Docker object>, har_01={'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}, har_02={'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}, har_03={'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}, har_04={'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}, har_05={'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...})
5140 def Harmony_Header( self, har_01, har_02, har_03, har_04, har_05 ):
5141 # Variables
5142 self.Color_Harmony( self.harmony_span, har_01, har_02, har_03, har_04, har_05 )
5143 # Update
5144 self.Harmony_Update()
self = <pigment_o.pigment_o_docker.PigmentO_Docker object>
self.Color_Harmony = <bound method PigmentO_Docker.Color_Harmony of <pigment_o.pigment_o_docker.PigmentO_Docker object>>
self.harmony_span = 0.7302325581395349
har_01 = {'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}
har_02 = {'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}
har_03 = {'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}
har_04 = {'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}
har_05 = {'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}

C:\Users\Ramon\AppData\Roaming\krita\pykrita\pigment_o\pigment_o_docker.py in Color_Harmony(self=<pigment_o.pigment_o_docker.PigmentO_Docker object>, span=0.7302325581395349, hue_1={'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}, hue_2={'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}, hue_3={'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}, hue_4={'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...}, hue_5={'aaa_1': 0.5685780617028473, 'aaa_d1': 0, 'active': True, 'ard_1': 0.15857605267535324, 'ard_2': 0.5583333436244474, 'ard_3': 0.470638292007904, 'cmy_1': 0.38823527097702026, 'cmy_2': 0.40784311294555675, 'cmy_3': 0.7921568602323532, 'cmyk_1': 0.0, ...})
4692
4693 if self.wheel_mode == "ANALOG":
4694 angle_1 = self.convert.huea_to_hued( angle_1 )
4695 angle_2 = self.convert.huea_to_hued( angle_2 )
4696 angle_3 = self.convert.huea_to_hued( angle_3 )
angle_1 undefined
self = <pigment_o.pigment_o_docker.PigmentO_Docker object>
self.convert = <pigment_o.pigment_o_calculations.Convert object>
self.convert.huea_to_hued = <bound method Convert.huea_to_hued of <pigment_o.pigment_o_calculations.Convert object>>
UnboundLocalError: local variable 'angle_1' referenced before assignment
cause = None
class = <class 'UnboundLocalError'>
context = None
delattr = <method-wrapper 'delattr' of UnboundLocalError object>
dict = {}
dir =
doc = 'Local name referenced but not bound to a value.'
eq = <method-wrapper 'eq' of UnboundLocalError object>
format =
ge = <method-wrapper 'ge' of UnboundLocalError object>
getattribute = <method-wrapper 'getattribute' of UnboundLocalError object>
gt = <method-wrapper 'gt' of UnboundLocalError object>
hash = <method-wrapper 'hash' of UnboundLocalError object>
init = <method-wrapper 'init' of UnboundLocalError object>
init_subclass =
le = <method-wrapper 'le' of UnboundLocalError object>
lt = <method-wrapper 'lt' of UnboundLocalError object>
ne = <method-wrapper 'ne' of UnboundLocalError object>
new =
reduce =
reduce_ex =
repr = <method-wrapper 'repr' of UnboundLocalError object>
setattr = <method-wrapper 'setattr' of UnboundLocalError object>
setstate =
sizeof =
str = <method-wrapper 'str' of UnboundLocalError object>
subclasshook =
suppress_context = False
traceback =
args = ("local variable 'angle_1' referenced before assignment",)
name = None
with_traceback =

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

Traceback (most recent call last):
File "C:\Users\Ramon\AppData\Roaming\krita\pykrita\pigment_o\pigment_o_docker.py", line 5873, in Harmony_Rule
self.Pigmento_RELEASE()
File "C:\Users\Ramon\AppData\Roaming\krita\pykrita\pigment_o\pigment_o_docker.py", line 4294, in Pigmento_RELEASE
self.Sync_Elements( True, True, True )
File "C:\Users\Ramon\AppData\Roaming\krita\pykrita\pigment_o\pigment_o_docker.py", line 5017, in Sync_Elements
self.Harmony_Header( har_01, har_02, har_03, har_04, har_05 )
File "C:\Users\Ramon\AppData\Roaming\krita\pykrita\pigment_o\pigment_o_docker.py", line 5142, in Harmony_Header
self.Color_Harmony( self.harmony_span, har_01, har_02, har_03, har_04, har_05 )
File "C:\Users\Ramon\AppData\Roaming\krita\pykrita\pigment_o\pigment_o_docker.py", line 4694, in Color_Harmony
angle_1 = self.convert.huea_to_hued( angle_1 )
UnboundLocalError: local variable 'angle_1' referenced before assignment

@RamonKrita
Copy link
Author

image
This what i was doing in Krita

@EyeOdin
Copy link
Owner

EyeOdin commented Nov 3, 2024

This error does not seem normal. I am not able to trigger it on my end. I have tripled checked now this section of code on the reported section and all looks sound. conversion is also not breaking in isolation.
ramon_check.webm

I will require more information to better trigger this or analyze it running on your machine to pin point the issue (it would require boring testing).

@EyeOdin EyeOdin added the invalid This doesn't seem right label Nov 3, 2024
@RamonKrita
Copy link
Author

No problem, after I release the video about templates i will record a video for you . I hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants