SNLite node depends on context
Created by: portnov
I programmatically load node tree and try to export it. The code is in the "testing" branch: https://github.com/nortikin/sverchok/pull/2011/files#diff-2594045266f6e0898d61c2674cb78b0dR8
Basically what the code does is:
# Link the whole node tree from reference blend file. link=True or False does not matter.
with bpy.data.libraries.load(reference_blend_path, link=True) as (data_src, data_dst):
data_dst.node_groups = ["TestingTree"]
# Obtain linked node tree
tree = bpy.data.node_groups["TestingTree"]
# Export it
export_result = create_dict_of_tree(tree)
Here is the blend file which I am loading: script_uv_ref.blend.gz
And this is what I receive:
ERROR: test_script_uv_export (tree_export_tests.ScriptUvExportTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/portnov/.config/blender/2.79/scripts/addons/sverchok-master/tests/tree_export_tests.py", line 13, in test_script_uv_export
export_result = create_dict_of_tree(self.tree)
File "/home/portnov/.config/blender/2.79/scripts/addons/sverchok-master/utils/sv_IO_panel_tools.py", line 298, in create_dict_of_tree
node.storage_get_data(node_dict)
File "/home/portnov/.config/blender/2.79/scripts/addons/sverchok-master/nodes/generator/script1_lite.py", line 493, in storage_get_data
storage = self.node_dict[hash(self)]['sockets']
KeyError: -9223363294578807616
It looks like self.node_dict
is called depending on current bpy.context
somehow.
Found while testing #2011 .