Qt Blender Integration - Demo WIP

Are any news for a possible integration with blender(the core tweeak to run it better…). I would like to know if i must create new window or i can add it as child widget…?

Hi Rebellion,
Sorry I have been very busy at work so haven’t had any time to work on this.
Currently you need to create a separate window (still within the blender application instance)
However it is on my list to embed Qt UI’s into Blender.
-Alex

Hi metalix,

I just read your post and am very interested in your ongoings with QT. I am from the NPR community and we are investigating if it is possible to have PyQT native in Blender as an addon. In that way we can get around the opengl problems we currently have and use the opengl part of QT for rendering purposes. To have a very good workflow we are going for layers which is an UI issue in which could use QT as well.We even discussed a fork, but actually you already created one. We would like to contact you please visit us at https://www.facebook.com/groups/BNPRandFreestyle/

Pyqt would not be an add-on, it would be a library that would be included.
I gave up the idea of it being included in trunk as developers seem more concerned with keeping the file size of blender low rather than include such a large ui toolset as “blender already has a functioning ui toolset”
However in answer to your question, no, in order to render in qt you would need to convert the scene to raw open gl data for qt before it could be rendered, or subclass the qglview to read blender data, either way it would probably be easier to add your code to the blender source, qt is more of a ui toolkit.
Hope that answers your question

Thanks for the fast reply.

Well maybe I should state better what our project (BEER) is all about. Its about non photorealistic rendering and the current renders are more confined to photorealistic rendering, which is pretty natural for any 3D software. Freestyle is NPR and BI gets us at some reasonable place but does not travel the complete road. Furthermore we defined in our project that nodes is not the way to go but layers would give us the artistic freedom we demand. I presented this idea at the BCF 2014 two weeks ago to discuss the possibilitys. They are scarce. The wiki can be accessed by this link: http://wiki.blender.org/index.php/User:LightBWK This will give you a nice overview for what we strife for. In short we want the following options:

  • speed / flexible=> refering to rendering and its way of adressing seperate components (diffuse/ao/specular)
  • expandable => how easy is it to create a new shader
  • workflow => ui / wysiwig

There are several options to build such an NPR renderer and we are currently discussing matters with developers regarding the viewport project which is a step in the right direction. A BI solution will be difficult in mutiple ways but an external sollution/addon or fork is pretty much possible. Because the layer system we want to build is pretty demanding and will be difficult to do in current ui I was looking for other sollutions. Thats why I am more refering to the ui as well. Aka a fork with QT in it could solve our ui issue.

Regarding to the opengl. Yeah I suspected such an approach but going for PyQt was more from the perspective that you can easily programm this in python and enhance it later to c code when everything works. Sure we can build our own opengl stuff but that would take much more time and resources.

In short do you have a link to the fork you used for demonstrating the ui stuff. And I do not care about the size of the package, I care about the functionality and what we can achieve with it. Thanks in advance anyway.

Hi,
Currently I am working 70h+ at Weta so I don’t know when I will be back at my home workstation,

Are you on windows?
You can download the PyQt4 installer and install directly into blender’s python path,
Next you need to alter the startup script to make sure it starts a qEventLoop,
Also be aware you will not have access to bpy.context from qt,
You can make a custom context wrapper if you wish.
Here is my old context wrapper before I migrated maya.cmds to blender
Admittedly it’s old untidy code but should get you started

You can do basically anything in Qt depending on your skill level, I can send you the code to any of the simple examples here if you wish.
You may also wish to use PySide instead of PyQt4 (They are interchangeable) as it is more stable and has better licensing, but harder to install.

Thanks for reply. Yeah know the 24/7 situations myself pretty well.

Will see how far I will come with the cluses you gave. Did not understand them all but have seen other posts on BA and outside about QT so think I will get further with that. Yeah know that Pyside is a bit compattible with regards to QT but not so much information popped up regarding installing into blender. Just have toe experiment a bit to see where it get us. Thnaks and will reply when I have a bit of progress.

Great work!
Sorry for opening an old thread, but this is really interesting.
Is this tutorial (or other Blender - Qt tutorials) available somewhere?

I don’t believe so, Although I still use and develop Blender, I no longer create tutorials due to working full time and having limited “free time”

Fully understandable!
There is a lot of information in this thread I can use, so thank you for that :slight_smile:

Sorry for the thread necromancy, Alex, but did you ever post the code for your Qt integration anywhere? I’d also be interested in your maya.cmds port, if you can share.

Hey, sorry I haven’t opened blender in over a year so don’t have much code up online, but you can check out my github page for the blender cmds stuff. Just search metalix blender.cmds, I am on my phone so can’t look it up easily, there should be an old qt example there too

@metalix hey I am working on a Qt integration for blender. Currently, I am spinning up a QApplication on another thread and accessing operations from the bpy module. I need to save a reference to the QApplication in the blender context, so I am store it in a Scene property, however when I do that it causes some threading issues. You seem to have created I functional Qt UI integration for blender, and I am curious how you did it. Do you have any tips or possibly some code I can look at? I checked your github repo and didnt see any Qt examples. Any help you give will be greatly appreciated! Thanks!