29 January 2013

MyPaint and PyGI

I got several emails from mypaint users who want to know the progress of windows version. I have tidying up what I left last weekend. I hope you could participate as I lack of time nowadays.

Several days ago a user of gramps (gramps-project.org) put his interest on my PyGI build which motivated me to look at it again after I failed to get it work with mypaint. Last sunday I put new PyGI build which better than previous one (read the comments here), in short it's "somewhat" working but I still find many non-crashing errors and warnings when run Gramps 4.0a3 though. Later I tried it on mypaint and it started! but gave me loads of fatal error messages and crashes. This make me unmotivated again :(

The important thing with GTK 3.6.4 is pressure-sensitive tablet apparently not working broken but is detected (so you won't get lag bug naturally, not sure). Strangely the zoom bug only happen when packaged by py2exe so it's not related to lag bug as I thought before.

Here I put mypaint 270113git  in non packaged mode so everyone could investigate more thoroughly.

mypaint_270113git_dbg_rev2.7z (due to difficulties in uploading, localisations are stripped out)

Some info that might be useful when reporting bugs:

blockers:
lag+break bugreport (if you find something new please post at the bugtracker to let mypaint devs know)
zoom bug, currently unreported as this is a packaging issue

specs:
mypaint 270113 1.1.0+git (debug)
python 2.6.7
pygtk 2.24.0
pygobject 2.28.6
pycairo 1.10.0
psyco 2.0
numpy 1.6.2
pygi/pygobject 3.4.2 (debug)
gobject introspection 1.34.2 (debug)
gtk+ 2.24.14 (debug)
gtk+ 3.6.4 (debug)
atk 2.6.0
cairo 1.12.10
pango 1.32.6 (debug)
glib 2.34.2 (debug)
gdk-pixbuf 2.26.4 (debug)

Inside the 7zip file contains:
mypaint_gtk2.bat -> run mypaint in GTK2/PyGTK mode
mypaint_gtk2_debug.bat -> run mypaint in GTK2/PyGTK mode under GDB session
mypaint_gtk3.bat -> run mypaint in GTK3/PyGI mode
mypaint_gtk3_debug.bat -> run mypaint in GTK3/PyGI mode  under GDB session

How to help:
- If you're user with python knowledge try check options.bat file and try uncomment/comment the available options to help with diagnostics. All mypaint python files are under mypaint folder, the lag bug is probably workaround-able via python too.
- If you're user with C knowledge also check  options.bat file and run mypaint under GDB (I don't know the best way to debug it, so you know what to do better). The GTK3 port is badly need for debugging though finding the lag bug (GTK2) is priority. You might also interested in PyGI in general, in this case also download the GI-1.34.2 package. Note that is unofficial don't report to GTK/GI devs something that is probably my mistake, well you know what to do :)
- If you're user who use both Linux and Windows, try GTK2 and GTK3 and tells mypaint's devs if you spot a misbehaving of Windows' version.
- If you're neither one above, the GTK3 port might not interesting for you, try GTK2 instead and tell mypaint's devs your suggestion to make Windows' version better.

Enjoy and Thank You!
More info about participating MyPaint development can be found at http://mypaint.intilinux.com/?page_id=18

62 comments:

  1. I did download mypaint_270113git_dbg_rev2.7z. But it seems to me the content isn't complete because 7zip shows more than 2000 errors and a lot of files having a packed size of zero kb. Or do I have a 7zip issue?
    Comment: The whole file has 20.784 kb.

    ReplyDelete
  2. Thanks, the downloaded file is OK now. I tried for a short first time both (gtk2 and gtk3): nice program. For gtk2 it runs smooth so far I tried some thing. For gtk3 the change brush dialogue crashes:
    Traceback (most recent call last):
    File "C:\ProgrammeNeutral\MyPaint\mypaint\gui\dialogs.py", line 332, _on_style_set(no details)
    #sw.modify_bg(gtk.STATE_NORMAL, bl_style.base[gtk.STATE_NORMAL])
    self.brushlist.modify_bg(gtk.STATE_NORMAL, bl_style.base[gtk.STATE_NORMAL])
    icon_size = self.ICON_SIZE
    variables: {'gtk.STATE_NORMAL': ('global', ), 'self': (None, []), 'bl_style': (None, [])}
    IndexError: list index out of range

    I'll try to change the batch files for Gramps on the week end.

    ReplyDelete
  3. OK, heres whats happening on my Win7 64bit.
    gtk3 - changing brushes is crashing MyPaint. I cant even see icons of brushes.
    gtk2 - first run goes ok however It seems to work without pressure detection. Whats interesting is every other then first run of the program. Brush strokes are slow and discontinuous and in cmd.exe window, when I move stylus that text is continuously displayed:

    _gdk_input_other_event: native_window=00010010 +586+978
    _gdk_input_other_event: native_window=00010010 +584+981
    _gdk_input_other_event: native_window=00010010 +582+985

    and so on, ONLY when I move stylus. Also when I switch to mouse MyPaint works smoothly and stops to display that. Switching to wacom stylus brings problem back.

    Hope that helps somehow, really love MyPaint.

    ReplyDelete
  4. On the GTK2 version (the one 1.1 for Windows is supposed to be based on) it appears that if you:

    - Put the stylus down on the canvas (begin a painting stroke)
    - While the stylus is still down press [spacebar] to pull out the popup menu
    - Press the Escape key to remove the popup menu

    You can continue the stroke without lag and breakage.
    In the process, in the debug window it seems as if MyPaint cycles in and out WINTAB libraries.
    If a stroke has already been started when Wintab libraries are invoked, the stroke won't lag or break.

    So, there must be a bug somewhere there.

    ReplyDelete
  5. I just checked and I can confirm what Tizzboom said.

    ReplyDelete
  6. The same can also be performed in this way, although it probably only works on Intuos tablets (with the tilt function):

    - Open MyPaint 1.1 GTK2
    - Help>Debug>GTK Input Device Dialog
    - Click on [Device: WACOM Tablet Pressure Stylus]
    - Under "Axes" set Pressure to 4 (tilt X) instead of 3

    From now on, if you:

    - Click once on the canvas
    - Move the pointer away from the MyPaint window
    - Move the pointer back again on the canvas

    the stroke will be continuously drawn without lagging or breaking up. The only thing is that since pressure is now mapped on the X tilt, it will keep drawing forever. And of course, this is not a very practical behavior for digital painting/drawing.

    Clicking once again with the stylus tip on the canvas makes subsequent strokes lag and break again.

    ReplyDelete
  7. On Windows 8 64 bit,

    The GTK2 version seem to be lagged despite the method in the comment (maybe I did something wrong...)
    The GTK3 Version seem to work perfectly (no lag, zooming okay, mirror okay) while the brush selector is broken (but if ignore the error message, one can still select from one of the 4 brushes)

    ReplyDelete
  8. The tips I posted have been tested on Windows 8 64 bit.

    ReplyDelete
  9. Did you ever try profiling the windows build with something like valgrind and maybe comparing the results to the linux build? I'm probably wrong about it since I'm not a programmer, but software like that always seems to come up when there's performance problems.

    ReplyDelete
    Replies
    1. i did thought that initially, but it's not performance issue see the bugreport for commits that trigger the bug.

      btw it is drmemory rather than valgrind on windows :)

      Delete
  10. I am a keen user of MyPaint on Windows, and I am really looking forward to having 1.10 on Windows. As an ordinary user without any coding or programming knowledge, is there anything I can do to help troubleshooting the bug and bring 1.10 to Windows ASAP? I run Windows 7 64-bit on a 2 year old Acer laptop, without graphic tablets or pen displays.

    ReplyDelete
    Replies
    1. If you dont use tablet then current build should be ok. Only problem I ran into is when using stylus. Mouse works just fine.

      Delete
    2. Where can I get the current build for Windows? Is there anything else I can help out with? I plan to use a graphics tablet in the future, so I would like to help out in this problem (without a tablet currently).

      Delete
  11. Just grab file from the link above (mypaint_270113git_dbg_rev2.7z), unpack it and run mypaint_gtk2.bat. You should be good to go if using just mouse. Ofcourse we are all waiting to stylus related bugs to be fixed.

    ReplyDelete
  12. So mypaint_gtk3.bat runs perfectly fine with my Bamboo Pen. Hmmm.

    ReplyDelete
    Replies
    1. Except for all the UI errors.

      Delete
  13. ..Excited to just have heard about the new 1.1 release only to find out it won't work in windows with tablets?! :/ Hope there is luck in finding the tablet issues because with out my tablet v1.1 is useless to me. 1.0 still works great though, but I might give mypaint_270113git_dbg_rev2.7 a try on my windows 7 & 8's PCs when I can.

    ReplyDelete
  14. I have tried this on Windows 7 ro 64 bit with a cheap Silvercrest tablet.

    Mypaint gtk2 works fine, even with the tablet (with pressure sensitivity turned off (default setting). You can still draw with the tablet and get a good result.

    The new features are awsome and just to say thanks to the guys who made this version possible. You have made an ols artist very happy.

    ReplyDelete
  15. Guys, why don't you just put a bounty for fixing this problem? Or how about hiring a freelancer? I'm sure plenty of users would donate cash to get working windows build.

    ReplyDelete
  16. I get the broken brush strokes like anyone else in GTK2.

    But in GTK3, the brush strokes work fine. Pressure sensitivity works fine also.

    However, like Helge, I do get this error when I try to change the brush:

    Traceback (most recent call last):
    File "E:\FromTRANSFERDI1\mypaint_270113git_dbg_rev2\mypaint\gui\dialogs.py", line 332, _on_style_set(no details)
    #sw.modify_bg(gtk.STATE_NORMAL, bl_style.base[gtk.STATE_NORMAL])
    self.brushlist.modify_bg(gtk.STATE_NORMAL, bl_style.base[gtk.STATE_NORMAL])
    icon_size = self.ICON_SIZE
    variables: {'gtk.STATE_NORMAL': ('global', ), 'self': (None, []), 'bl_style': (None, [])}
    IndexError: list index out of range


    And the brush selection dialog is actually empty. Screenshot here: http://i.imgur.com/9Tqejz7.png

    This bug on the brush selection dialog doesn't happen in the GTK2 version.

    ReplyDelete
    Replies
    1. Interesting.. Do you get excessive repeated warning (at CMD box) during brush stroke with gtk3?. If not That's good news, at least I'd rather deal with GTK3's than GTK2 issue that have been years now.

      About the brush dialog, I still wait for linux users/devs who could confirm if that was windows only issue, because GTK3/PyGI is still preliminary.

      Delete
    2. I do get repeated messages about the pen x,y coordinates whenever I move the pen (not just when brushing), is that what you were referring to?

      It's repeats of this:
      WINTAB motion: 567.431,282.781
      _gdk_input_other_event: window=018D01E4 +567+282

      I'm assuming that's just for debug and not an error/warning.

      Delete
    3. yes, that's just warning. I guess it's an issue with my tablet...

      Delete
    4. The gtkstyle object used in Mypaint is deprecated in GTK+ 3.0.It probraly doesnt support gobject-introspection.

      Delete
  17. Hello,

    Thanks for your attempts at building window version of MyPaint.

    I am no coder and have no compilling knowledge at all, but i noticed on a Gimp board something that imply that the Cairo libraries on windows may have lots of problem.

    I don't know if that's the case with the bugs you encounter when trying to build MyPaint 1.1, but i report it in case you have not noticed :

    On that Gimp board some people are offering windows special builds of Gimp with the MyPaint brushes in it.
    But from the thread about one of those builds :
    http://gimpchat.com/viewtopic.php?f=7&t=6475

    It appears that they have lots of problems of performance and the guilty part seems to be the Cairo library.
    As using an older version of the cairo dll seems to fix this performance problem completely (i have tried as instructed in that thread and indeed it deliver a huge boost of performance).

    ReplyDelete
    Replies
    1. Yes I knew about early cairo 1.10.x bugs that crashed gtk3. The latest one didn't crashed. as I already mentioned for mypaint it's _not_ a performance issue, I have mentioned the cause of the bugs (for gtk2, see bugreport) though the solution is to be found.

      For gtk3 OTOH, the error is completely different I think this blog is the only one providing pygi until now... So we're pretty much alone and without linux users/devs join in to confirm the bugs here, the progress will always slow if not stalled.

      Delete
  18. I've come across this while doing research for a prospective PyGTK -> PyGI migration for Gourmet Recipe Manager (github.com/thinkle/gourmet). Looks great! Do you intend to get in touch with upstream developers? I believe that Dieter Verfaille has done some work on this, maybe you guys can team up in order to turn this into something official!

    ReplyDelete
    Replies
    1. I still use Dieter's old patch for this GI ;) but his github no longer active quite a while.

      I found the scanner still not reliable especially for doc annotation and sometime for the parameters (which can be fatal).

      But from what I know (long time ago, correct me if I'm wrong), the plan at upstream devs is to use MSVC as the main toolchain for windows port. They already did that for most of the C Libraries.

      while what I doing here is tweak mingw to target msvcr90.dll. So I doubt if this will ever be official... in fact mypaint never use official build when using pygtk...

      Personally I'm not qualified to be "in touch" because I'm more into packager than developer. I could do little fixing provide there is sufficient hint (thanks to Helge) as I can't afford testing myself

      Delete
  19. Hello.
    Thank you.
    Screen mode, the Windows version has a bug.
    Wacom tablet ...
    See the video.
    MyPaint 1.1.0 gtk2 Screen mode bug
    http://youtu.be/nZpGe2ckXrU

    ReplyDelete
  20. Same here... gtk3 runs just fine on my windows 7 64 machine
    just the UI looks like shit and cant see the brushes lol

    ReplyDelete
  21. Quick test of GTK2 version, running Win 8 64 Bit with Genius Wizard Pen WP (5540U).

    If I toggle back and forth between screen mode and window mode on the pressure setting dialogue and then leave it on window mode, I get pressure sensitive input, without a lag.

    Can't promise it is consistent. Also I do not get a cursor showing exactly where I am about to draw.

    Not a coder/programmer but perhaps gives a hint, different handling of pressure tablet between screen mode and window mode

    And cynically thinking that now my computer is going to stop this work-around from working

    ReplyDelete
  22. how can i open the file after the download?

    ReplyDelete
    Replies
    1. You'll need to install 7zip http://www.7-zip.org/

      Delete
    2. oh god i feel bad that i keep asking :/ im really not a computer wiz i wish i was though. so i have the thing downloaded and have the 7 zip out now what?

      Delete
    3. I see, no prob :)

      Double click mypaint_270113git_dbg_rev2.7z if it doesn't open 7zip automatically use "open with" dialog and choose 7-zip file manager, inside 7zip, Extract all files to somewhere.

      browse there and double click either mypaint_gtk2 or mypaint_gtk3, see which suit you better.

      Delete
    4. when extrecting the files it stops at 35% :/

      Delete
    5. ahhh yes! i did it thanks :)

      Delete
  23. when extrecting the files it stops at 35% :/

    ReplyDelete
  24. Would it be possible to, say, splice the old tablet engine (is that the correct term? Driver, maybe? I don't know nothin' :/) from 1.0 to 1.1? or is the driver/engine for the tablet too ingrained with the rest of the program in 1.1 to remove it and splice 1.0's into it?
    Did they actually change how the pressure sensitivity is read in 1.1, or is it just that the new settings and variables put in 1.1 don't sit well with the existing tablet driver input thingamabob?
    Sorry for all the questions :P I may not be too intelligible, as I really don't know what it is that reads the tablet's input or how the input is translated into something MyPaint can use.

    ReplyDelete
    Replies
    1. I think from tablet to mypaint can be sort of this:

      Mypaint Stroke (Tablet) -> Vendor Driver Apps (which allow change settings etc) -> Vendor Driver Wintab32.dll (which interact with Operating System) -> Gdk2/3 (part of GTK2/3) -> MyPaint Canvas

      Tablet issue usually happen between Driver to GDK part. For example I can't use Genius Mousepen tablet with Mypaint/PyGI while others seems able to. This is driver incompatibility. Tablet engine is probably refer to Wintab32 which GDK3/GDK2 try to interact with. Right now the best bet IMO is to wait GTK3 matured for Windows and MyPaint properly ported (I haven't checked this) to GTK3.

      That said gdk2 (which has issue) is not exchangeable with gdk3 (which seems has less issue). You could try different driver version to try with MyPaint/PyGI as workaround, but probably useless for MyPaint/PyGTK. OTOH the change from 1.0 to 1.1 is (at least) not expected to trigger gdk2's bug which we luckily get away in version 1.0. I've no idea whether "undoing" the change is feasible or not though.

      Delete
  25. Please forgive me posting here. I just wanted to say how much I appreciate all time and mental effort the developers have put in to this programme.

    As a Windows XP user I have been using MyPaint for some time. It is already a lovely programme but the ability to create, save and load colour pallets would be fantastic and I do look forward to having this feature however might I humbly ask that any new Windows version offers the Gamut mask feature in addition to the rather wonderful Harmonies feature. We are not all highly skilled and we do not all have tablets. I think I like the idea of the masks but I would stick to V1 if the Harmonies feature were removed.

    I may not have any great skill but I get a very great deal of pleasure from a few free artistic programmes including yours, Sirs THANK YOU.

    Briðnoð

    ReplyDelete
    Replies
    1. Just to clarify MyPaint is by MyPaint Devs. I'm just providing win32 port ;)

      BTW last weekend I tried the latest mypaint and things are getting better, it getting closer to gegl-ready state.

      Delete
  26. masbro, mypaint release terbarunya untuk windows apa sudah bisa di download?

    ReplyDelete
    Replies
    1. belum bro, dah tanya ke martin renold katanya masih sebagian portingnya ke gtk3 dan maih ada bugsnya (palagi windows) kyknya ga mungkin versi 1.1 deh, versi 1.2 kali

      Delete
  27. Hi Developers,

    Do MyPaint 1.1 for windows is ready ?
    I appreciate your effort and thanx for making this wonderful tool.

    ReplyDelete
  28. Any news about the Windows version? All the windows artists in the world have their eyes focused on you!!! ;-)
    (and I am not trying to put more pressure on you)

    ReplyDelete
    Replies
    1. Thanks :-D, I can't give any promises though

      The effort eventually depends on GTK3 progress, I have waited for newer version 3.10.x to be released. See http://ftp.gnome.org/pub/GNOME/sources/gtk+ for their progress

      Delete
    2. On 2013-09-23 20:48 the 3.10 gtk has been added ^_^
      Keep fingers crossed...
      Thank you for your commitment!

      Delete
  29. 3.10 is out!
    ive spent hours trying to get the cintiq13hd running on linux with no success- I really hope the windows build is possible.. mypaint.. #1

    ReplyDelete
  30. This post is originally written almost a year ago. The 1.1 Mypaint was out in november... this is so annoying =( Maybe there's a chance for the 1.2 release in the winter, and hopefully is gets ported without bugs?
    Tumagonx, have you tried building the current development version? We're all confused without any information...

    Thank you for doing this!

    ReplyDelete
    Replies
    1. I'm about to update pygi to latest gtk 3.10.1, will see what happen next

      Delete
    2. Thanks for the update, I've been refreshing this page several times everyday ever since the first GTK 3.10.x release.

      Can't thank you enough for working on the windows version for MyPaint, and wish you luck in a successful build.

      Again thanks

      Delete
  31. word up, big hugs

    ReplyDelete
  32. Gosh, after absent in compiling win32 packages for months I felt slow and senile... Or this gtk thingy have been getting away from windows world...

    ReplyDelete
    Replies
    1. That bad?.. ='( Any specifics?

      Delete
    2. On my side I need to refresh a bit. On gtk side for ex. definition files are missing, it was easy to create but could be a bad sign of lacking Windows developer upstream. Usually a release version is buildable out of box.

      Some test files even use non-portable unixish function, slowing down the process.

      Delete
    3. Has everything been sorted out or are there still issues with compiling a build?

      Delete
    4. A bit confused, sometime ago Gnome's guy contact me about my pygi build and asking if I plan to update it (he linked my build in gnome page in fact: https://wiki.gnome.org/PyGObject). But apparently since gtk 3.8.x there has been steady progress to move o Microsoft Visual C++ compiler based build. That's why I felt its getting harder to build as I use GCC/MinGW.

      In the end I don't want to confuse the whole pygtk/pygi community with my build that probably has no prospect in the future. I will contact him for more info, this could mean I will cease my pygi build entirely and encourage any advanced mypaint users to learn this guide https://live.gnome.org/GTK%2B/Win32/MSVCCompilationOfGTKStack and lead on.

      Basically I realize there are problems with my current pygi build, while no official pygi has been released yet it would be better if I retreat.

      Sorry

      Delete
    5. noooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

      Delete
    6. This comment has been removed by the author.

      Delete
    7. I got a positive encouraging word from Tagliaretti although I firmly believe the stable releases (3.10.0, 3.10.1, 3.10.2 including 3.8.x) no longer tested with mingw/gcc as they consistently broken out of box. I'll continue on, right know I have a minimal runtime built, it can run with older pygi but I have problem generating "proper" new girs/typelib.

      Delete