<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">Hi! I can answer number 3
<div dir="auto"><br /></div>
<div dir="auto">I was working on reloading the python plugins at runtime, but I diverged from it and have not being able to finish it. so as it stands today, there is no way to reload Python plugins without restarting krita at the moment.</div>
</div>
</div>
<div name="messageSignatureSection"><br />
<div class="matchFont">-IvanYossi-</div>
</div>
<div name="messageReplySection">El 21 de jul de 2019 9:34 -0500, Nathan Lovato <nathan@gdquest.com>, escribió:<br />
<blockquote type="cite" class="spark_quote" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">Hi,<br />
<br />
I'm Nathan, also known as gdquest on the web. I make Krita tutorials<br />
from time to time:<br />
https://www.youtube.com/watch?v=qjUOdxP_L_s&list=PLhqJJNjsQ7KE3FLHIE31UgmLdcqsZfXTw<br />
<br />
My teammate Razvan made an add-on to batch export layers flexibly. The<br />
tool can save lots of trimmed images for you, produce a clean folder<br />
structure, and scale the images on export. It uses metadata in the layer<br />
names.<br />
<br />
We took inspiration from the export tools you can find in Sketch,<br />
affinity designer, and photoshop, and designed a tool adapted to Krita.<br />
<br />
Here's the GitHub repository: https://github.com/GDquest/GDquest-art-tools/<br />
<br />
Flexible batch export is something that we need as game developers, and<br />
that can also be of use to people making comics, doing graphic design,<br />
Web  design.<br />
<br />
Thanks to Larpon, a contributor, you can also export your document for<br />
the Blender cut-out animation tools add-on, which allows you to do<br />
modular 2D animation for games.<br />
<br />
I think it can be useful to many users and that's why we would like to<br />
contribute it so that it ships with Krita.<br />
<br />
THE PROBLEM<br />
=============<br />
<br />
The code currently relies on the Pillow Python imaging library. The user<br />
needs to install a local version of Pillow in the add-on’s directory<br />
that matches their operating system. Right now, it’s a +/- manual process.<br />
<br />
We use Pillow for a few reasons:<br />
<br />
1. Resizing/scaling the image via Python starts an asynchronous process,<br />
but the function returns immediately. We couldn’t find a way to wait for<br />
the scale operation to finish before Krita calls Node.save() and exports<br />
the image. The only way we could solve this so far was using Pillow.<br />
2. Pillow is fast. Using it makes export 2+x faster compared to using<br />
Krita’s built-in functions.<br />
<br />
As a bonus, it’s a lot easier to manipulate the image with Pillow than<br />
using Krita’s API.<br />
<br />
It's technically possible to automate the installation of the<br />
dependency, to have the right version of pillow bundled with Krita upon<br />
building the program.<br />
<br />
A FEW QUESTIONS<br />
<br />
About the add-on:<br />
<br />
1. Is there a reliable way to transform the layer from Python with<br />
Krita, and wait for it to finish before saving the file?  If so we could<br />
remove Pillow as a dependency. (code contributions welcome!)<br />
2. Would having pillow as a dependency be okay if we contributed the<br />
add-on? The library itself is sizeable, and it takes a good 6 megabytes<br />
on disk. For a single add-on, I bet it's too big but never hurts to ask. 🙂<br />
<br />
Python add-on development with Krita:<br />
<br />
3. Is there a way to reload Python plugins without closing and<br />
restarting Krita? Plugin dev is quite slow because of that right now.<br />
<br />
Thank you for your time,<br />
 Nathan<br />
<br /></blockquote>
</div>
</body>
</html>