Fixing old and dummy nodes registering #4157
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addressed problem description
Fixes #4133
Closes #4148
Solution is to register all old and dummy nodes for now if there is at least one node with unregistered class in a loaded file.
Also after reloading Sverchok (F8) all old and dummy nodes will be registered. It even impossible to check whether there are nodes with unregistered classes because during reloading event it may happened that even normal node classes was not registered yet. Delegate finishing Sverchok initialization to update system (as it is before this PR) I consider as wrong solution. Update system should either update node trees or finish Sverchok initialization after reload event (according its name, the first would be more expected I think).
There is no
upgrade nodes
module any morebut there isIf you want to update a node content do this in the process method. It does not look like appropriate place but this will let to keep our update system simpler and this will work for both loading a new file and importing a JSON.load_file_update
optional method for nodes. I did not finish with its implementation yet (I secretly wish not implement it at all). Probably it should be called not only when file is loded but also when trees are imported via JSON format.Trees will be properly updated after reload event even if first tree update was not properly throttled.
Found a lot of strange things in refactored modules.
Preflight checklist
- [ ] Think about theload_file_update
method