Nodes in PySide/PyQt?

1,767 views
Skip to first unread message

Fredrik Averpil

unread,
Mar 16, 2016, 8:27:23 AM3/16/16
to python_in...@googlegroups.com
Hey everyone,

This isn't really specific to Maya, but I figured I'd ask away in here anyways... :)

So I'm thinking about creating a node graph view in PySide. Have you guys done anything like that?

Basically, what I wish to do is to create a widget in which you can create nodes with inputs/outputs and move them around. Save their positions etc.

What would be a good way to approach this in PySide/PyQt do you think?

Regards,
Fredrik

Eric Thivierge

unread,
Mar 16, 2016, 10:01:29 AM3/16/16
to python_in...@googlegroups.com
Hi Frekrik,

Check this repo out that we are using for Kraken and Horde. We keep pushing on it for those tools so it's getting better and better. The graph, nodes, connections are already done. :)

https://github.com/HordeSoftware-co/pyflowgraph

--------------------------------------------
Eric Thivierge
http://www.ethivierge.com

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWNKBSLdhNaA%2Bo9%3Dtdj%3DEtK7NusQFsGU3rLnFdDJwkjEYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Fredrik Averpil

unread,
Mar 16, 2016, 10:01:48 AM3/16/16
to python_in...@googlegroups.com
Just found this:

...which is nice, for starters.

Cheers,
Fredrik

Fredrik Averpil

unread,
Mar 16, 2016, 10:02:41 AM3/16/16
to python_in...@googlegroups.com
Hi Eric, 

Wow, very nice!
This seems awesome, will check it out!

Cheers,
Fredrik

Marcus Ottosson

unread,
Mar 20, 2016, 12:02:46 PM3/20/16
to python_in...@googlegroups.com
Hey Fredrik,

If or when you get around to the automatic layout of nodes, I'd be interested in following your progress! Graph layout is an exciting area, but I could never quite get past the baby steps myself..

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Justin Israel

unread,
Mar 20, 2016, 2:42:11 PM3/20/16
to python_in...@googlegroups.com


On Mon, 21 Mar 2016 5:02 AM Marcus Ottosson <konstr...@gmail.com> wrote:
Hey Fredrik,

If or when you get around to the automatic layout of nodes, I'd be interested in following your progress! Graph layout is an exciting area, but I could never quite get past the baby steps myself..

When I did a node graph type interface for a component of an app at work, I used graphviz to do all the heavy lifting for performing a node layout. The general idea is that when you need to layout, you build up a graph model of your nodes (X connects to Y, Y connects to Z) and pass it to graphviz either via the python API or shelling out to the "dot" command. You tell it to perform a certain type of layout with some options, and you get back a new graph that has the new positions for your nodes. Then you use that to move the nodes in your own node graph view. 

Marcus Ottosson

unread,
Mar 20, 2016, 3:01:10 PM3/20/16
to python_in...@googlegroups.com
I was also looking into graphviz at first, but I'm interested in the math behind it.

After having drawn *my* first nodes, the next logical step was to lay them out. Like how they seemed to automagically layout in Maya and other software. A quick Google search afterwards revealed that layout is actually a vast area of research, just look at some of these books!


Inspiring stuff!


For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Ravi Jagannadhan

unread,
Mar 20, 2016, 3:24:05 PM3/20/16
to python_in...@googlegroups.com
Hi Justin, do you have any sample code for this? I am looking to do something similar in PySide.

Thank you for your time,
Ravi
--
"There are no dumb questions" - Carl Sagan.

Justin Israel

unread,
Mar 21, 2016, 6:04:36 AM3/21/16
to python_in...@googlegroups.com


On Mon, 21 Mar 2016 8:24 AM Ravi Jagannadhan <enr...@gmail.com> wrote:
Hi Justin, do you have any sample code for this? I am looking to do something similar in PySide.

Thank you for your time,
Ravi

I had, at one point, a really experimental port of a C++ lib where I was trying to also make it a bit more flexible and extensible. But I had deleted it after I just did it from scratch for an internal project, using a simpler approach. 

The original C++ lib was
https://github.com/nbergont/qgv

It lists a decent talk about how to use graphviz for this purpose 
http://www.mupuf.org/blog/2010/07/08/how_to_use_graphviz_to_draw_graphs_in_a_qt_graphics_scene/


If I manage to find the PySide version I did, I will share it. 

Justin 

Reply all
Reply to author
Forward
0 new messages