sverchok
sverchok copied to clipboard
Topologic is no longer compatible with new version of Sverchok
Problem statement
Topologic is no longer compatible with new version of sverchok. What has changed? I am getting the following error:
from sverchok.core.socket_data import SvGetSocketInfo
ImportError: cannot import name 'SvGetSocketInfo' from 'sverchok.core.socket_data' (/home/sinasta/.config/blender/3.3/scripts/addons/sverchok-master/core/socket_data.py)
Any help on what I need to change in my code to make it compatible with the new version of sverchok?
Steps to reproduce
- Install sverchok
- Install Topologic
- Try to activate Topologic
Expected result
Topologic activated
Actual result
from sverchok.core.socket_data import SvGetSocketInfo ImportError: cannot import name 'SvGetSocketInfo' from 'sverchok.core.socket_data' (/home/sinasta/.config/blender/3.3/scripts/addons/sverchok-master/core/socket_data.py)
Sverchok version
1.1.0 but it seems sverchok versions are not updated correctly with new releases.
This is especially important for installation-related issues. Please specify how do you install Sverchok: from sverchok-master.zip from github, or from release zip file, or from cloned git repo.
use socket.objects_number
instead
layout.label(text=(self.label or text) + f". {self.objects_number or ''}")
Thank you, but now I am getting another error:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.2.0.0_x64__ppwjx1n5r4v9t\Blender\3.2\scripts\modules\addon_utils.py", line 335, in enable
mod = __import__(module_name)
File "C:\Users\wassi\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\topologicsverchok\__init__.py", line 442, in <module>
imported_modules = make_node_list()
File "C:\Users\wassi\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\topologicsverchok\__init__.py", line 437, in make_node_list
module = importlib.import_module(f".{module_name}", base_name)
File "C:\Program Files\WindowsApps\BlenderFoundation.Blender_3.2.0.0_x64__ppwjx1n5r4v9t\Blender\3.2\python\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\wassi\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\topologicsverchok\nodes\Topologic\Run.py", line 5, in <module>
from sverchok.core.update_system import make_tree_from_nodes, do_update
ImportError: cannot import name 'make_tree_from_nodes' from 'sverchok.core.update_system' (C:\Users\wassi\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\sverchok-master\core\update_system.py)
see some of the diff https://github.com/nortikin/sverchok/commit/d6aa48602d8cc06e3017e1b4c7fc12e0ac4be9dd#diff-8ef72808a2c9f6d5f29d22379c6b8e31d525bce292a8b5afff9ed6acfe4e1d7eR90-R94
just out of interest, when was the last time you synchronized with sverchok master?
The file I have is from 30/05/2022
i'm trying to figure out when make_tree_from_nodes
was removed
This is the (old/offending) code. I think it was copied from the Evolver node. What should the code be if we are to use the newest version of sverchok to update the downstream tree of nodes? Thanks
def sv_execute(self, context, node):
node.outputs['Status'].sv_set([True])
tree = node.id_data
update_list = make_tree_from_nodes([node.name], tree)
do_update(update_list, tree.nodes)
look at the updated evolver node https://github.com/nortikin/sverchok/blob/master/nodes/logic/evolver.py
it looks like
- update_list = make_tree_from_nodes([node.name], tree)
- do_update(update_list, tree.nodes)
+ node.process_node(None)
The changes were introduced by this PR #4323.
I think it is simpler to learn how to use new API of update system on Loop nodes. First block finds which nodes should be updated and sorts them in proper execution order. https://github.com/nortikin/sverchok/blob/6af8ca3047157e634de0b70202f158ea52d5a8aa/nodes/logic/loop_out.py#L284-L288
Try cache syntax is not nessasary here if it is appropriate to update all nodes in spite of whether there are nodes with errors or not. https://github.com/nortikin/sverchok/blob/6af8ca3047157e634de0b70202f158ea52d5a8aa/nodes/logic/loop_out.py#L309-L313
If this was not helpful you can show your current code I will help with how to fix it.
this appears to be resolved :)
I am getting an error: AttributeError: 'SverchCustomTree' object has no attribute 'nodes_from'
@wassimj feel free to reopen these issues if i close them prematurely.
maybe @Durman can confirm this, but this does appear to work - I don't know if it's the intended way to use it
from sverchok.core.update_system import SearchTree
(your node)
(your function)
stree = SearchTree(self.id_data)
nodes = stree.nodes_from([self]) # see the definition of this function
print(list(nodes))
I think that update system module is internal to Sverchok's add-ons. It can be reused on your risk without any guarantees that it won't be broken in next releases.
What the Evolver and Loop nodes do is completely separate thing from update system. So if there is need for some stability of such nodes I can suggest to create your own independent execution system.