node editor - pyflow

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Maarten
Posts: 13
Joined: Mon Jul 15, 2019 8:30 pm
Location: Dordrecht, The Netherlands
Contact:

Re: node editor - pyflow

Post by Maarten »

Hello everyone,

I did some experiments with PyFlow Nodes with FreeCAD.

With new nodes using Python lists and made nodes for GIS2BIM in PyFlow based on Python Functions.

GIS2BIM is a collection of nodes I made for Dynamo a couple of years ago:
https://github.com/DutchSailor/GIS2BIM

The quality of the Pythoncode is unfortunately not on the level as you guys do it, I'm trying my best to reach your standard.

Additional nodes: https://github.com/DutchSailor/FOSS-BIM ... /PyFactory
GIS2BIM-nodes: https://github.com/DutchSailor/FOSS-BIM ... m/GIStoBIM
Example PyFlowgraph: https://github.com/DutchSailor/FOSS-BIM ... %20GIS2Bim

Some problems:
• Couldn’t get the FreeCAD-nodes working in Pyflow.
• PythonNode within PyFlow is not working so I made the nodes editing the functionlibraries python file.
• Couldn't figure out how to make your own 'pinType' so a list is now a 'anyPin' type.

Some questions:
• I think that PyFlow can work for FreeCAD like Dynamo for Revit. A lot of users without coding experience can use it for automation. What is your vision on this?
• What do you think of using Python lists within Pyflow versus Numpy Arrays?

Please feel free to make any comments or if you think things should go in another direction.

Image

Image
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: node editor - pyflow

Post by jtm2020hyo »

Sorry for noob question

Could you add nodes for connect LibreOffice Calc and FreeCAD Spread Sheets?
Last edited by jtm2020hyo on Thu Jan 14, 2021 5:45 am, edited 1 time in total.
User avatar
victor_calixto
Posts: 3
Joined: Thu Aug 21, 2014 12:15 am

Re: node editor - pyflow

Post by victor_calixto »

Hi guys,

I am getting a error while I try to run "Create All Nodes for Test". Any ideas? It seems to be something related to 'FreeCAD_Toy3'.

Code: Select all


FreeCAD 0.19, Libs: 0.19R23578 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2020
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

---------get FreeCADPyFlow------------------- getInstance @ .../home/klixto/.FreeCAD/Mod/NodeEditor/nodeeditor/pfwrap.py li: 46
 <module> @ ...AD/Mod/NodeEditor/PyFlowPackages/PyFlowFreeCAD/Nodes/FreeCAD_Base.py li: 7
 <module> @ .../Mod/NodeEditor/PyFlowPackages/PyFlowFreeCAD/Nodes/FreeCAD_Lambda.py li: 7
 <module> @ ...D/Mod/NodeEditor/PyFlowPackages/PyFlowFreeCAD/Nodes/FreeCAD_Logic.py li: 8
<nodeeditor.freecad_pyflowapp.FreeCADPyFlow(0x5615fd02a710) at 0x7f92f47090c0>
create instance getInstance @ .../home/klixto/.FreeCAD/Mod/NodeEditor/nodeeditor/pfwrap.py li: 72
A3 available
Unknown command 'ZebraTool'
Unknown command 'GeomInfo'
Unknown command 'ZebraTool'
Unknown command 'GeomInfo'
---------get FreeCADPyFlow------------------- getInstance @ .../home/klixto/.FreeCAD/Mod/NodeEditor/nodeeditor/pfwrap.py li: 46
<nodeeditor.freecad_pyflowapp.FreeCADPyFlow(0x5616001e3310) at 0x7f92b2303b00>
create instance getInstance @ .../home/klixto/.FreeCAD/Mod/NodeEditor/nodeeditor/pfwrap.py li: 72
-----------; 0; FreeCAD_ShapePattern
tried to run nodeeditor.dev_all.Coin.run_FreeCAD_ShapePattern(self)
-----------; 1; FreeCAD_Dragger
-----------; 2; FreeCAD_QuadMesh
-----------; 3; FreeCAD_Camera
SoOrthographicCamera
Position; 0.0 0.0 -0.0
tried to run nodeeditor.dev_all.Coin.run_FreeCAD_Camera(self)
-----------; 4; FreeCAD_Boolean
-----------; 5; FreeCAD_Compound
-----------; 6; FreeCAD_Loft
no data on pin; shapes
PyFlowFreeCAD.Nodes.FreeCAD_Combination.FreeCAD_Loft
FreeCAD_Loft
no shapes
-----------; 7; FreeCAD_RepeatPattern
-----------; 8; FreeCAD_Seam
PyFlowFreeCAD.Nodes.FreeCAD_Combination.FreeCAD_Seam
FreeCAD_Seam
no ShapeA
PyFlowFreeCAD.Nodes.FreeCAD_Combination.FreeCAD_Seam
FreeCAD_Seam
no ShapeA
PyFlowFreeCAD.Nodes.FreeCAD_Combination.FreeCAD_Seam
FreeCAD_Seam
no ShapeA
-----------; 9; FreeCAD_Slice
-----------; 10; FreeCAD_Sweep
-----------; 11; FreeCAD_ApplyPlacements
-----------; 12; FreeCAD_Reduce
-----------; 13; FreeCAD_FlipSwapArray
flipswap
FreeCAD_FlipSwapArray
shape; (0,)
flipswap
FreeCAD_FlipSwapArray
shape; (0,)
flipswap
FreeCAD_FlipSwapArray
shape; (0,)
-----------; 14; FreeCAD_IndexToList
-----------; 15; FreeCAD_ListOfPlacements
-----------; 16; FreeCAD_ListOfShapes
-----------; 17; FreeCAD_Transformation
tried to run nodeeditor.dev_all.Conversion.run_FreeCAD_Transformation(self)
tried to run nodeeditor.dev_all.Conversion.run_FreeCAD_Transformation(self)
tried to run nodeeditor.dev_all.Conversion.run_FreeCAD_Transformation(self)
tried to run nodeeditor.dev_all.Conversion.run_FreeCAD_Transformation(self)
-----------; 18; FreeCAD_Zip
-----------; 19; FreeCAD_xyz2uv
-----------; 20; FreeCAD_uv2xyz
-----------; 21; FreeCAD_ListOfVectors
-----------; 22; FreeCAD_ListOfVectorlist
-----------; 23; FreeCAD_MoveVectors
-----------; 24; FreeCAD_ScaleVectors
-----------; 25; FreeCAD_Toy3
Running the Python command 'Micro_createAllNodesforTests' failed:
Traceback (most recent call last):
  File "<string>", line 199, in Activated
  File "<string>", line 1, in <module>
  File "/home/klixto/.FreeCAD/Mod/NodeEditor/nodeeditor/Commands.py", line 1276, in createAllNodesforTests
    node=pfwrap.createNode('PyFlowFreeCAD',name,name)
  File "/home/klixto/.FreeCAD/Mod/NodeEditor/nodeeditor/pfwrap.py", line 98, in createNode
    node = classNodes[nodeClass](nodeName,**kvargs)

('FreeCAD_Toy3',)

My configuration:

OS: Arch Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23578 (Git) AppImage
Build type: Release
Branch: master
Hash: 50c3cbf00579dc4941ca743c25720d016b0453ce
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/Australia (en_AU)

Many thanks,
Cheers.
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: node editor - pyflow

Post by jtm2020hyo »

how can I start using Pyflow WB por nodeditor?

Shoould i just download and copy to MOD folder in windows 10?
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: node editor - pyflow

Post by jtm2020hyo »

I installed it according to your README.md but I have some errors

Code: Select all

16:25:06  Traceback (most recent call last):
16:25:06    File "C:\Users\JTM_PC\AppData\Roaming\FreeCAD\Mod\NodeEditor\nodeeditor\freecad_pyflowapp.py", line 240, in closeEvent
16:25:06      self.canvasWidget.shoutDown()
16:25:06    File "C:\Users\JTM_PC\AppData\Roaming\FreeCAD\Mod\PyFlow\PyFlow\UI\Widgets\BlueprintCanvas.py", line 1787, in shoutDown
16:25:06      self.canvas.shoutDown()
16:25:06    File "C:\Users\JTM_PC\AppData\Roaming\FreeCAD\Mod\PyFlow\PyFlow\UI\Widgets\BlueprintCanvas.py", line 343, in shoutDown
16:25:06      node.shoutDown()
16:25:06  AttributeError: 'NoneType' object has no attribute 'shoutDown'
this appear after use "create all nodes for test" and the PyFlow windows start a crazy bug, never stop trying to create a selection rectangle

Image

should I install more dependencies?

Code: Select all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23323 (Git)
Build type: Release
Branch: master
Hash: 512d5c6141aec52b6eecc67370336a28fde862a6
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Spanish/Peru (es_PE)
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: node editor - pyflow

Post by jtm2020hyo »

Code: Select all

20:36:44  Traceback (most recent call last):
20:36:44    File "C:\Users\JTM_PC\AppData\Roaming\FreeCAD\Mod\PyFlow\PyFlow\UI\Widgets\BlueprintCanvas.py", line 1134, in mouseMoveEvent
20:36:44      self.clearSelection()
20:36:44    File "C:\Users\JTM_PC\AppData\Roaming\FreeCAD\Mod\PyFlow\PyFlow\UI\Widgets\BlueprintCanvas.py", line 411, in clearSelection
20:36:44      for node in self.selectedNodes():
20:36:44    File "C:\Users\JTM_PC\AppData\Roaming\FreeCAD\Mod\PyFlow\PyFlow\UI\Widgets\BlueprintCanvas.py", line 404, in selectedNodes
20:36:44      assert(None not in allNodes), "Bad nodes!"
20:36:44  AssertionError: Bad nodes!
20:36:51  selected Nodes ...
20:36:51  Traceback (most recent call last):
20:36:51    File "C:\Users\JTM_PC\AppData\Roaming\FreeCAD\Mod\NodeEditor\PyFlowPackages\PyFlowFreeCAD\Tools\ComputeTool.py", line 60, in do
20:36:51      if n.getWrapper().isSelected():
20:36:51  AttributeError: 'NoneType' object has no attribute 'isSelected'
20:36:51  selected Nodes ...
20:36:51  Traceback (most recent call last):
20:36:51    File "C:\Users\JTM_PC\AppData\Roaming\FreeCAD\Mod\NodeEditor\PyFlowPackages\PyFlowFreeCAD\Tools\ComputeTool.py", line 60, in do
20:36:51      if n.getWrapper().isSelected():
20:36:51  AttributeError: 'NoneType' object has no attribute 'isSelected'
this appears after click here:

Image
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: node editor - pyflow

Post by jtm2020hyo »

this error message appears when FreeCAD is loading (GIS2BIM):

Image

anyway, thanks for share your awesome work.

Code: Select all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23323 (Git)
Build type: Release
Branch: master
Hash: 512d5c6141aec52b6eecc67370336a28fde862a6
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Spanish/Peru (es_PE)
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: node editor - pyflow

Post by jtm2020hyo »

microelly2 wrote: Sat May 11, 2019 6:25 pm
phpBB [video]

Can this be a starting point for a node editor ?
Mr. @Mircroelly2 how did you install the MAYA nodes?

Image

I did install all others except Maya node because, according to internet, is python 2.

Image
jtm2020hyo
Posts: 594
Joined: Wed Aug 12, 2020 1:24 am

Re: node editor - pyflow

Post by jtm2020hyo »

I hope can any dev can read this:

Image

I need to request to create a fork for PyFlow for FreeCAD because microelly2 is MIA (missing in action) anywhere in their blog, discord group, or youtube.

actually, Pyflow is already usable, just a unique node does not load, Maya because python2, for other nodes, just is need install python modules (dependencies) to be usable, I think any developer could do this.

is very necessary to launch a stable Pyflow version because other devs than wish to create nodes for their software need a stable version for than their users can test.

here just is need a unique change if have time, and is than each node should contain their python modules (dependencies)
yorik wrote: Mon May 13, 2019 9:47 pm :!:
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: node editor - pyflow

Post by looo »

jtm2020hyo wrote: Fri Jan 29, 2021 6:29 am I need to request to create a fork for PyFlow for FreeCAD because microelly2 is MIA (missing in action) anywhere in their blog, discord group, or youtube.
As far as I know @microelly2 used a fork of pyflow. There were some attempts to unify pyflow with his fork, but as far as I can remember this never happened.

I created a pyflow package for conda some time ago. version 2.0.2. I would like to work adding necessary patches to make pyflow compatible with freecad, and further adding the changes to the main repo.

You can start pyflow within freecad (assuming you have a working pyflow installed) with:

Code: Select all

from PyFlow.App import PyFlow
from Qt.QtWidgets import QApplication
instance = PyFlow.instance(software="FreeCAD")
instance.show()
Post Reply