nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.23k stars 232 forks source link

ABCnaming.json can't be imported in tests #3746

Open portnov opened 3 years ago

portnov commented 3 years ago
======================================================================
ERROR: test_import_examples (json_import_tests.ExamplesImportTest) (file='ABCnaming.json')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/portnov/.config/blender/2.90/scripts/addons_contrib/sverchok/tests/json_import_tests.py", line 105, in test_import_examples
    raise ImportError(importer.fail_massage)
ImportError: FAIL: Setting node property - 1

@nortikin

Durman commented 3 years ago

Relevant with this element. SNL is exporting ENUM according its logic in load_from_json method. Probably export/import SNL with enums is broken now if it ever worked. 2020-11-29_18-25-04

nortikin commented 3 years ago

so should I remove json?

portnov commented 3 years ago

For now I added it to skip_list to fix tests. If the problem is in export/import mechanism, it should be fixed...

Durman commented 3 years ago

The issue is in importing order. At present import system tries to apply node property and then call node custom import if one had it but SNL node does not have enum property by default so here is the error. It does not break layout because node custom import do everything what should be, in its order. I can't just switch order because some nodes can expect it to be in this order I guess.

Funny the node losing its enum after script reload F8 2020-11-30_08-57-23

zeffii commented 3 years ago

the node losing its enum after script reload F8

yes, that is weird. I would like a sv_reload(self) called by sverchok after a reload f8 on any node in the tree which defines sv_reload(), that way nodes that are a bit more dynamic can keep the reload logic out of the sv_process function.

zeffii commented 3 years ago

snlite also should not be using hash(self) for n_id , would correcting that break some blends?

Durman commented 3 years ago

As far as I know node ids are used mostly in update system. Update system requires node_ids to be persistent during blender execution. During file reloading / opening / importing node_ids can get other values if it neccessary.

zeffii commented 3 years ago

after f8 the node dict remains empty, until the node is told to execute sv_process. The drawfunc is populated immediately if something upstream triggers an update cascade (going through SNLIte)

The logic to recover from losing the nodedict is put inside sv_process (or triggered from within sv_process), if we had a sv_reload emitted by the update system a few other nodes could also use it (like VD node, it stops drawing for the same reason after f8)