Tela Plugin

Hello, thanks for sharing your work, I’m just discovering Tela and Pigment_O. The second is working without noticeable problem with Krirta 5 beta but Tela shows an error message

ZeroDivisionError
Python 3.8.1: C:\krita-x64-5.0.0\bin\krita.exe
Sat Aug 21 10:27:10 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.

C:\Users\Seven\AppData\Roaming\krita\pykrita\tela\tela.py in Krita_2_Tela(self=<tela.tela.TelaDocker object>)
645
646 # Panel Update
647 self.Panel_Update()
648 # Sync Control Variable
649 self.sync = False
self = <tela.tela.TelaDocker object>
self.Panel_Update = <bound method TelaDocker.Panel_Update of <tela.tela.TelaDocker object>>

C:\Users\Seven\AppData\Roaming\krita\pykrita\tela\tela.py in Panel_Update(self=<tela.tela.TelaDocker object>)
650 def Panel_Update(self):
651 if ((self.canvas() is not None) and (self.canvas().view() is not None)):
652 self.panel.Update_Panel(
653 True, self.q_image,
654 self.eraser,
self = <tela.tela.TelaDocker object>
self.panel = <tela.tela_modulo.Panel object>
self.panel.Update_Panel = <bound method Panel.Update_Panel of <tela.tela_modulo.Panel object>>
self.q_image = True
self.eraser = False
self.sof_1 = 32.0
self.sof_2 = 1.0
self.sof_3 = 1.0
self.can_rotation = 0.0
self.can_zoom = 0.141
self.hdr_e = 0
self.hdr_g = 1
self.can_mirror = False
self.can_wrap = False
self.doc_width = 6713
self.doc_height = 5347
self.ui_d_ref = False
self.delta_new = [0, 0, 0, 0]
self.gui_hor_norm = []
self.gui_ver_norm = []
self.layout = <PyQt5.QtWidgets.QWidget object>
self.layout.panel = <PyQt5.QtWidgets.QWidget object>
self.layout.panel.width =
self.layout.panel.height =
self.gray_natural = ‘#3b3b3b
self.gray_contrast = ‘#c4c4c4

C:\Users\Seven\AppData\Roaming\krita\pykrita\tela\tela_modulo.py in Update_Panel(self=<tela.tela_modulo.Panel object>, status=True, q_image=True, eraser=False, sof_1=32.0, sof_2=1.0, sof_3=1.0, can_rotation=0.0, can_zoom=0.141, exposure=0, gamma=1, mirror=False, wrap=False, doc_width=6713, doc_height=5347, ui_d_ref=False, delta_new=[0, 0, 0, 0], gui_hor_norm=[], gui_ver_norm=[], panel_width=295, panel_height=10, gray_natural=’#3b3b3b’, gray_contrast=’#c4c4c4’)
438 six = (dw / self.doc_width)
439 siy = (dh / self.doc_height)
440 sox = (self.doc_width / dw)
441 soy = (self.doc_height / dh)
442 self.sx = doc_width*six
sox undefined
self = <tela.tela_modulo.Panel object>
self.doc_width = 6713
dw = 0.0
ZeroDivisionError: float division by zero
cause = None
class = <class ‘ZeroDivisionError’>
context = None
delattr = <method-wrapper ‘delattr’ of ZeroDivisionError object>
dict = {}
dir =
doc = ‘Second argument to a division or modulo operation was zero.’
eq = <method-wrapper ‘eq’ of ZeroDivisionError object>
format =
ge = <method-wrapper ‘ge’ of ZeroDivisionError object>
getattribute = <method-wrapper ‘getattribute’ of ZeroDivisionError object>
gt = <method-wrapper ‘gt’ of ZeroDivisionError object>
hash = <method-wrapper ‘hash’ of ZeroDivisionError object>
init = <method-wrapper ‘init’ of ZeroDivisionError object>
init_subclass =
le = <method-wrapper ‘le’ of ZeroDivisionError object>
lt = <method-wrapper ‘lt’ of ZeroDivisionError object>
ne = <method-wrapper ‘ne’ of ZeroDivisionError object>
new =
reduce =
reduce_ex =
repr = <method-wrapper ‘repr’ of ZeroDivisionError object>
setattr = <method-wrapper ‘setattr’ of ZeroDivisionError object>
setstate =
sizeof =
str = <method-wrapper ‘str’ of ZeroDivisionError object>
subclasshook =
suppress_context = False
traceback =
args = (‘float division by zero’,)
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\Seven\AppData\Roaming\krita\pykrita\tela\tela.py”, line 647, in Krita_2_Tela
self.Panel_Update()
File “C:\Users\Seven\AppData\Roaming\krita\pykrita\tela\tela.py”, line 652, in Panel_Update
self.panel.Update_Panel(
File “C:\Users\Seven\AppData\Roaming\krita\pykrita\tela\tela_modulo.py”, line 440, in Update_Panel
sox = (self.doc_width / dw)
ZeroDivisionError: float division by zero

Thank you for the report, but I am curious.
What did you do to trigger this?
I see the values but I don’t know how you arrived to them.

It showed after I tried to enlarge the docker with the mouse/pointer. I did nothing more before the message showed.
I will try again.

Thank you, I will keep this in mind.
However I will only solve this issue when Krita 5 comes out.

No problem. I understand that.

Was checking and Exposure and Gamma seems to be finally working on Krita 5 :partying_face:
exposure_gamma_working

Also I must say Krita 5 with the floating docker headers on windows look so dope now. I Love them!

@lian00
I was taking a look at the code again and it should have been impossible for you to trigger that error and have those values. Regardless I introduced a limiter to handle that error. if you can trigger it again tell me about it.

Fixed a really minor ui irregularity for the UI text.

OK. I did not make any new test and I will be careful looking at the action giving any error.

OK, it seems the problem occurs when I open a new window of Krita (4 and beta 5). Krita freezes when Tela is activated. I have to kill it.

1 Like

Update:

  • UI update
  • New Features
  • Bug Fixes

Slowly it becomes something more decent. The Ui was polished all over but not much difference. Most changes were done internally. I tried to fix bugs but with the new features it is possible I made even more.

UI Cleanup:

If your used to Pigmento you will feel right at home with Tela now. Updated the manual also nothing much.

Features:

  1. I have a bug report pending over the usage of QThread but even with it not working properly I managed to find myself into a new solution to display the Thumbnail of the Canvas that is much faster even with the handicap of the QThread. Even the crooked QThread rewrite gave boosted performance considering it does not go through so many signals now, that is usually an bottleneck. Regardless if the QThread issue gets fixed this will be faster hopefully. Because of this the Settings has the variable set for the update interval.

  2. Added shortcuts for all sliders. Needs to be set as they are empty shortcuts out of the box as usual.

  3. Created a Recorder window, might be with a odd bug here and there as it is a very odd setup for me codewise. In the Settings press “Record : Window” and it will open a window that updates with the Krita’s Canvas display. it does not lag more than when it displays the thumbnail by default because it can’t. With this recording window you can mark it as a target for OBS to record. If this works for everyone I find it debatable as most people always have some issue in performance with my plugins so calibrate the update rate of the record window with the Preview Interval as both are connected. However this allows OBS to record with no transformations of the canvas and updates close to real time. If the recording window is showing nothing especial just rescale the window a bit to update the display size. The document resolution is the output resolution. I might play with this in the future more.

Tela_Thumbnail_and_Record_Window

Bug Fixes:

  • opening 2 windows with Krita should not crash instantly Tela. I wanted to make Window registry here so each instance of Tela would only respond to that identifier, but the identifier seems to change over time with canvas changes or be identical on both windows for the options I saw available, needs some more work to get fully right.
  • preview of a image surrounded by alpha will not be create an offset of the painted bounding box. so it is not required a full opaque background to display things correctly now.
  • little to no lag when preview is on and even if there is lag it is adjustable from 0.1s up to 10 seconds. However this could be further optimized if there were more tools to read the user behavior. Python - User Activity Versus Inactivity Timer

I just ran a test and found that it turned gray when checked. This is the first time I encountered this problem in the plugin.And I can’t find it’s docker

Hover your mouse over the grey text and take a screen shot or something. It will report the error with it. Only will be fixing tomorrow though, is sleep time now.

Warning

Please uninstall tela before updating to krita 5.2.

the new python version will break the plugin.

I don’t know how I will continue with this plugin so I will not be fixing it.
There was simply too many limitations for it’s development to begin with and it was a failure considering it’s initial vision. I mean I could but the consequences would be eternal lag.

However I will come back to it later and reshape it into something new.

4 Likes

The refresh rate of the navigator in Krita is very slow, and it can’t function independently in multi-view mode. i think your Recorder window is very useful

I know that is why I deleted it.
Tela is totally different now.

HI, sorry if this is not the right place to ask. I just instaled the plugin and theres a docker that doesn’t show anything, I’m not sure if it’s just there as placeholder. Is there a way to change how the other tools are accessed from the menu? as it is I can only access by right click and my pen doesn’t have space to add a right lick button in it. Could I change it to display the hamburger menu just by clicking on it with the tip of the pen?

what the plugin does is grabs the toolbar inside that docker and moves it into the canvas. just ignore it. it is not a placeholder it is the whole UI home.

if you know how to code you can custom the plugin to your available clicks.
I have available buttons so I use it. but if you do that you will not be able to swap tools after, so to just be clear what you suggest will just destroy the plugins easy to use interaction. constantly accessing a menu to select tools sounds even more work.

Also I am waiting for a krita API command to exist to finish this plugin. so this is a incomplete plugin.

1 Like

thanks, I understood the docker thingy, I suspected that was the case so I was ignoring it as you said. About the UI, how are you setting up your right click if not with the mouse? My stylus has two buttons, one I use with ALT for colorpicking and the other with CTRL for brush resizer. I don’t know how to code but I guess I could try. I thought the plugin was way to have the toolbox more centered on the canvas, if not for the right click it would work better for me than the pie menu plugin (because I wouldn’t need to hit a shortcut) so changing the richt click to something like left click or ALT would break the plugin? as in it would not select the tools in the buttons and only activate the hamburger menu? How about long press (press and hold) to activate the hamburger menu?
Also Thanks for your work, your plugins are some of the best things about using Krita.

these options look good ?


2 Likes

They seem very good options to me.

1 Like

Update:

  • User interface changes
  • Added new Actions
  • Added Mirror Fix

User Interface

Press to select the tool or press and hold to open the menu. no more need to use Right click. Theme sensitive Highlight buttons. Sync tool selected when hovering over it.

New Actions

Two extra buttons that show various options

Mirror Fix

The new upgraded mirror fix script now is able to act on multiple layers.

mirror_fix

3 Likes