16

Blender has a powerful, fun-to-use, flexible node editor:

Blender 2.6 node editor

Is there a Python library that will allow me to easily create a visual developing environment like this? In Blender, the node editor works with shaders, images, colors and the like, and I'd like to define the types of nodes, sockets and preview widgets myself, as in building a "visual DSL".

Edit: I don't want to create custom nodes within Blender, but use a component LIKE the node editor in my own projects. I removed the Blender tag to avoid confusion.

Community
  • 1
  • 1
Phae7rae
  • 524
  • 2
  • 4
  • 14
  • As suggested in Peter's answer: why not use Blender itself? All the UI is ready. All you need is to check the docuemtation to learn how to create a file that will open on the nodes view, with you desired nodes already in place. – jsbueno Feb 18 '14 at 17:02
  • This seems like a large overhead, especially because my project would be of a totally different domain. – Phae7rae Feb 18 '14 at 17:06
  • I think you are looking for this: https://github.com/FMichelD/PyQt5Nodes – Rolandf May 22 '18 at 07:18
  • **“libgtkflow** supports GObject-Introspection which means you can consume it in various popular languages including but not limited to: **Python,** Perl, Lua, JS, PHP. I compiled some examples on how to program against the library in **Python** in the examples-folder. Feel free to add examples for **your favorite language.”** ([source](https://notabug.org/grindhold/libgtkflow#examples)) The library is 2 years younger than this question. [Inspired by Blender](https://lwn.net/Articles/697224/). – 7vujy0f0hy Jan 16 '19 at 09:23

1 Answers1

11

You can find how to do that in the documentation:

http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes

If you want to use the nodes to build objects and meshes procedurally with it then I recommend you to use and/or fork and and improve this project:

http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Nodes/Sverchok

(These guys are also using the API linked above)

If you have blender specific questions, like this, I also recommend you to ask it on this blender dedicated stack exchange site:

https://blender.stackexchange.com/


EDIT:

As far as I know, there isn't any pre-made node-editor widget or anything similar like that in any UI libraries. However it is quite easy to implement the basic rectangles , input and output ports and the bezier lines to connect them. After the first steps it is only a matter of preference how many hours you put into design and smaller details.

I implemented my own in Python with the builtin tkinter library:

enter image description here

And then later in Pyglet and after that to improve speed I implemented it in pure C with OpenGL wrapped with Cython for Python usage:

enter image description here

Community
  • 1
  • 1
Peter Varo
  • 11,726
  • 7
  • 55
  • 77
  • Sorry for the confusion, I don't want to create custom nodes within Blender. Please see the edit, and thanks for your answer tho – Phae7rae Feb 18 '14 at 17:04
  • Thanks for your detailed answer, but I'm a little hesitant to accept it because it is basically "don't know". But I guess if the answer to my question is "does not exist", so I will accept it in a few days when no other suggestions appear. – Phae7rae Feb 19 '14 at 19:06
  • Fair enough, thank you! – Peter Varo Feb 19 '14 at 20:08
  • Ok, thanks. I guess I have to roll my own :) – Phae7rae Feb 25 '14 at 21:30
  • Hi @PeterVaro, I'm really interested in your GUI design, with nodes and bezier curves. That is exactly what I would like to have. I'm really new in Python and Tkinter, I found some good tutorials and of course I checked the docs, but I didn't found anything even close at yours. Can you give me some tips? Thank you a lot. – Niccolò Jul 17 '15 at 11:57
  • @PeterVaro Are you willing to share your C code? I've wanted to do something similar for a while: a UNIX shell, with nodes for processes and beziers for pipes (and other relations, like when to re-execute). – nebuch May 20 '17 at 19:36
  • @PeterVaro I would also like to nudge you a bit, if you could share that library to be used as a starting point for something custom made. Heck, at this point I would even be happy for some keywords on how to google anything similar to that. My google-foo is weak on this one. My usecase is similar to the original poster. Just wanting to use a similar worklfow as the node editor on Blender to implement a multistep workflow pipeline. – stratosgear Jul 07 '17 at 09:06
  • If you don't mind, would you be able to point others in the right direction on creating a node editor like yours (either)? a git repo or something? I've been contemplating how to create something like this in javafx, python or html5/js. As you said, it should be easy, but I don't quite see that. thanks – ldmtwo Oct 16 '17 at 21:18