Krita plugin to help with texture painting

Technically this isn’t that relevant for Blender directly as there is nothing Blender-specific about it (aside from the mesh exporter only supporting Blender) but i was told Blender users are going to find this useful anyway :slight_smile:

I was doing some texture painting recently and i was using an old painting program for that (PSP7). However going back and forth from the program and Blender to check out the texture was a PITA and decided to check if Krita (being newer and all) had some sort of “3d mode” in views so i could paint directly on the model, like in Blender but with layers, selections, copy/paste, etc - and sadly learned that this is not the case.

Supposedly this is something the Krita devs (based on an older forum post i found) want to add at some point but in the meanwhile i decided to make a stopgap solution with a plugin written in Python that displays the currently edited document in an OpenGL viewport that you can rotate, pan and zoom so you can at least avoid the whole “export PNG, alt+tab to Blender, reload texture, notice the mistakes, alt+tab to paint app, do modifications while trying to imagine how they’d end up, export PNG, alt+tab to Blender, reload texture, notice your imagination is lacking, etc” cycle.

You can find the Krita plugin here: Krita View3D Plugin

(there is also a video linked in the site but the forum software doesn’t let me post more than two links :sweat_smile:)

A quick example i did today for healing a seam:
View3D quick example to heal seams

The functionality the plugin provides is:

  • The aforementioned model viewing

  • Draw “blobs” by alt+clicking on the model (it isn’t exactly painting on the model itself but can help find where things are in an image)

  • Create a new image with the current render

  • Backproject a layer from the previously created image to the current image in a new layer (can help with doing some indirect painting on the model)

Some limitations are that the whole backprojection is slow (everything is done in Python) and not very accurate, especially if you zoom out the model (you’ll get gaps between pixels in the texture). Also no undo for blob painting since Krita does not provide a way to do that (make a new layer to draw blobs in to avoid damaging the existing image).

Note that the plugin is very rough as i primarily made it for my own use but thought about sharing it. I only tested it on my own PC running Linux and it may or may not work with other systems (i think it may not work with Intel GPUs and probably also macOS).

Also this is really about texture painting for models that you want to make texture details by hand instead of using sculpting, etc - i.e. basically anything until around 2005 in terms of computer games 3D modelling :stuck_out_tongue: (actually the character in the videos is something i’m trying to make for a homebrew original xbox project) or at least diffuse-only (or diffuse-mainly) materials. I don’t think editing normalmaps in Krita would be very user friendly :stuck_out_tongue: (though hacking in some bumpmap support might be doable in the future, but again some program that allows you to paint with full materials / multiple textures all at once would be easier anyway).

Here is the krita-artists forum post: https://krita-artists.org/t/view3d-plugin-to-view-modify-3d-mesh-with-the-current-image-as-texture/77235

4 Likes

Nice…

…and it is…

… because it connects with blender… somehow… :stuck_out_tongue_winking_eye:

There was also already some *Krita-Blender-Bridges" or “Blender-Krita-Bridges” (whatever you prefere)… i do not remember correctly if this was this:

or this:

( Even if i use Krita :sweat_smile: )

It doesn’t connect with Blender, it loads mesh files and does the rendering itself (the renderer is very simple, just textured triangles with OpenGL’s default lighting). It uses a custom mesh file format (JTF) which is incredibly simple: just a list of triangles with their normals and texture coordinates. The only Blender-specific aspect is that the format only has exporters for Blender but it is so simple to implement that someone could make an exporter for 3ds max or Maya or Modo or whatever other modeller in a manner of minutes. Or well, someone who knows how to make exporters for these programs could do that in minutes anyway, the point is that it is trivial to support :stuck_out_tongue:. Technically if you use any other program than Blender you can still use this Krita plugin by using Blender as a mesh conversion tool and after you create the .jtf file you don’t need to keep Blender running.

I didn’t knew about KritaToBlender but i did notice Blender Layer. The latter does have some overlapping functionality with View3D but AFAICT it is more geared towards using a Blender viewport as a layer inside Krita to assist with referencing 3D models, posing, etc for 2D drawing whereas View3D’s main purpose is to use the Krita as a texture painting tool and provide a (mostly) realtime view of the image you are editing as a texture with all of Krita’s features (layers and all).

2 Likes

I noticed that the plugin wont work out of the box with Krita on Windows because Krita uses the Direct 11 / ANGLE renderer by default and the OpenGL code in the plugin is not compatible with ANGLE. To use this plugin you need to switch to the OpenGL renderer, otherwise you’ll get some errors when Krita starts up.

I added a note on the site about it for Windows users.

Yeap… because of that i wrote:

Nevertheless… thanks for the explanation… i haven’t looked too much into it :sweat_smile: …and overlooked the blender exporter…

Addtionally i wanted to push this thread… :wink: