j8sr0230 / Nodes

Visual scripting workbench for FreeCAD
GNU Lesser General Public License v2.1
74 stars 11 forks source link

Existing .json files all broken after workbench updated from Addon manager. #115

Closed macdroid53 closed 1 year ago

macdroid53 commented 1 year ago

Just updated Nodes with Addon manager. Now attempting open all .json files produce the following:

`Traceback (most recent call last): 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_scene.py", line 397, in deserialize new_node = self.getNodeClassFromData(node_data)(self) 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_scene.py", line 360, in getNodeClassFromData return Node if self.node_class_selector is None else self.node_class_selector(data) 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_sub_window.py", line 50, in get_node_class_from_data return NodesStore.get_class_from_opcode(data['op_code']) 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_conf.py", line 44, in get_class_from_opcode raise OpCodeNotRegistered("OpCode '%d' is not registered" % op_code) 11:13:11 TypeError: %d format: a number is required, not str 11:13:11 Traceback (most recent call last): 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_scene.py", line 327, in loadFromFile self.deserialize(data) 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_scene.py", line 435, in deserialize new_edge = Edge(self).deserialize(edge_data, hashmap, restore_id, *args, **kwargs) 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_edge.py", line 301, in deserialize self.end_socket = hashmap[data['end']] 11:13:11 KeyError: 139971523285200 11:13:11 Traceback (most recent call last): 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_default_node.py", line 297, in eval return self.eval_primer()[index] 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_default_node.py", line 338, in eval_primer self.markDescendantsDirty() 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_node.py", line 345, in markDescendantsDirty for other_node in self.getChildrenNodes(): 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_node.py", line 414, in getChildrenNodes other_node = edge.getOtherSocket(self.outputs[ix]).node 11:13:11 AttributeError: 'NoneType' object has no attribute 'node' 11:13:11
During handling of the above exception, another exception occurred:

11:13:11 Traceback (most recent call last): 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_window.py", line 137, in onFileOpen if nodeeditor.fileLoad(file_name): 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_sub_window.py", line 63, in fileLoad self.do_eval_outputs() 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_sub_window.py", line 56, in do_eval_outputs node.eval() 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./core/nodes_default_node.py", line 302, in eval self.markDescendantsDirty() 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_node.py", line 345, in markDescendantsDirty for other_node in self.getChildrenNodes(): 11:13:11 File "/home/mac/.local/share/FreeCAD/Mod/Nodes/./lib/nodeeditor/node_node.py", line 414, in getChildrenNodes`

[code] OS: Debian GNU/Linux 11 (bullseye) (XFCE/lightdm-xsession) Word size of FreeCAD: 64-bit Version: 0.21.0.31238 (Git) Build type: Release Branch: master Hash: 6f0afb4d0b8b7a901a8b5b54e07c25e36e840548 Python 3.9.2, Qt 5.15.2, Coin 4.0.0, Vtk 7.1.1, OCC 7.5.1 Locale: English/United States (en_US) Installed mods:

j8sr0230 commented 1 year ago

Thanks for your feedback. I am really sorry about that, but it is not a bug. My latest update brings significant improvement regarding the Array Broadcastig API of the node editor. Unfortunately I had to adapt many nodes for this purpose. Whenever the node interface (e.g. sockets) has changed, a preheat compatibility is not given... However, your data is not lost! I could send you an image of the Workbench preversion, which you then only have to copy into your FreeCAD user directory, to run the old node editor. This way you could create snapshots of your node graphs. Alternatively, you could also fork the previous version from my repository... Sorry for the circumstances! By the way, does the saving and loading of graphs work for you now?