Plugin Help: Krita-Blender live bridge

Hi, direct to the matter: my idea is to make a live bridge between Krita and Blender for texture painting, more specific for hand-painting workflow.

What I mean with ‘live’?

While painting in Krita you should see a brush gizmo being projected in Blender model indicating its position in 3d space. Also refreshing textures to see the changes on Krita reflected in your 3D model.

About refreshing texture for live linking:

Options:

  • Auto refresh at the end of the stroke.
  • Manual refresh when saving on Krita.
  • Use a proper timer to auto-refresh.

Problems:

  • So much impact and maybe lag at the end (or in-between for timer case) of each stroke --> Use threading may solve this(?
  • What about quick followed strokes? --> Maybe use a QTimer and listen to mouse events to avoid overload(?
  • So big texture maps may need too much time to export/import --> Use a quick low res version for preview? (Could be an option).

Conclusion:

  • Ideal: automatic way, but so problematic and can have serious performance issues at the end.
  • Efficient: manual way, but not so practical at the end as it lose all live thing.

What is minimum needed - in general - to make it possible:

  • Blender Addon and Krita Plugin. Set the bridge between them.
  • (Krita) Read mouse relative position over canvas. This will be helpful to sample the position on Blender and then “project” it over the model.
  • Krita sends mouse position to Blender each x time. And refresh signal when export/save is complete so Blender can refresh gizmo position and texture image.

So in instance I need to know if it’s possible to access relative mouse position over canvas or at least absolute mouse position over viewport area along with canvas size/ratio as well as canvas zoom and position/offset.

Thoughts?

5 Likes

Out of curiosity why do you need see the cursor in 3D space while you paint though?

I really fear for performance.

If you wish to create fast data transfer from Krita <-> Blender, following can be helpfull

And sockets! if you wish to connect from machineA:Krita to machineB:Blender
(issue: running reactor inside qt is not fun!)

ps: MachineA:Krita <-> MachineB:Krita bridge would also be really nice… (multi-user Krita!)

/AkiR

1 Like

To locate urself by sync 2D->3D spaces, this avoid to make twice the work cause you skip steps as you can start painting in a blank canvas if you wish or over UV template with no guides and you still know exactly what part of the mesh are you going to paint even before you paint, specially useful in messy UVs or even UDIMs - with several UV maps -.
As said this is for a handpainted workflow, so not PBR, not shaders, etc. That’s why using Krita for it can really make it powerful as Blender don’t have proper workflows, tools and good UI/UX for it yet, so having something nearest to the idea of a live link between Blender and Krita would be awesome.

2 Likes

Thanks for the links, I will take a look!
btw the SharedMemory thing looks interesting! but PyQt5 is not included in Blender (so there are so much libs and deps that users may install in the Blender python environment and for instance sounds not eligible to be included in Blender by default), also Blender uses Python 3.7… :frowning: I will investigate the possibilities over it anyway. Thanks again!

I would loooove a plugin like this! I love using Krita for texturing 3D assets, but it always takes some time to save, update, and see the new changes. This would be a game-changer, and I wish you the best of luck! :grin:

1 Like

Thats really interesting idea. I would love to see something like that :slight_smile:

1 Like

I’m not too much into blender but you could use the grease pencil in combination with some of the plugins available on the blendermarket.

As long as you’re still working on this plugin…

I’d be happy to see more seamless workflow between Krita and Blender. Is this still in development?

1 Like

to my understanding there is no one working on this.
I think this is just another feature request that is miss labeled.

I’m sorry I haven’t told any news for a long time.

I didn’t find a cheap and efficient way to connect both software in real time without any performance issues, at least based on my full original idea. Also couldn’t find access to certain data inside Krita via scripting.

At least, I will wait for Blender and Krita in supporting python 3.8+ so I can test python Shared Memory feature - as proposed in this thread - and see if that can speed-up performance the way I want, avoiding export/import times and so that have a lot of negative impact and create continuous lagg and freezes UI making it a really helpless solution. Is the “best” I can think of atm but ofc performance is not the only requirement for that connection.

So by the way I think I can close this thread somehow just to avoid misunderstandings.

2 Likes

oh sorry I thought you were doing a proposal. I miss read the situation I apologize.

if your working on it it is more than in the right place, just a lot of threads in the plugin that are just proposals and I though this was one too because I miss read. i kinda started doing stuff myself without consent or warning to no one I would not expect someone to do it.

but concerning performance issues:
I was super worried about it but I have a stupid suggestion that helped me a couple of days ago. like if you can detect a mouse release event or any other event, do the update during that event. like during a mouse release the user has a small gap of reaction time to create another input again.

it was what helped me with pigmento become faster on Linux. Like everything is crazy slow in Linux but if you limit the amount of signals to a specific point in time it does that one cycle in a nice speed. but a flood of signals and it clogs the drain. it is like the drain in Linux is much smaller to get rid of the excess commands. Talking to PyqQt5 you can clog the drain and later as I just discovered talking to Krita itself can clog the drain also. with that realization made me make pigmento as fast as their c++ color picker in linux as far the user can see, I still have not updated it since I am working on new features but it’s there. Hope that can help somehow.

1 Like