Is there a Python reusable component that is like the Blender node editor? [closed]
Asked Answered
R

1

18

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.

Rocketeer answered 18/2, 2014 at 16:38 Comment(4)
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.Aldrin
This seems like a large overhead, especially because my project would be of a totally different domain.Rocketeer
I think you are looking for this: github.com/FMichelD/PyQt5NodesHolbert
“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) The library is 2 years younger than this question. Inspired by Blender.Encore
M
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

Meza answered 18/2, 2014 at 16:53 Comment(8)
Sorry for the confusion, I don't want to create custom nodes within Blender. Please see the edit, and thanks for your answer thoRocketeer
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.Rocketeer
Fair enough, thank you!Meza
Ok, thanks. I guess I have to roll my own :)Rocketeer
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.Tyrosine
@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).Theadora
@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.Bradstreet
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. thanksSchistosomiasis

© 2022 - 2024 — McMap. All rights reserved.