Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing old and dummy nodes registering #4157

Merged
merged 11 commits into from
Jun 11, 2021
Merged

Conversation

Durman
Copy link
Collaborator

@Durman Durman commented Jun 9, 2021

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 more but there is 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. If 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.

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

  • Try catch for post load handler?
    - [ ] Think about the load_file_update method
  • Code changes complete.
  • Code documentation complete.
  • Manual testing done.
  • Ready for merge.

Durman added 11 commits June 9, 2021 16:35
…, the module was not registering any old node classes during reload event
…ing event (F8, script.reload), some functions had ridiculous logic, mistakes in function descriptions
…ees before 2018. To keep the code does not have sense because in 2018 backward compatibility with old node trees was broken. Now nodes should have `load_file_update` method if they want to fix something upon loading a file.
…e to do this but it will let to keep our update system simpler.
…r this calls as really fragile solution to update nodes content after loading a file even if it looks like proper approach. It will let to keep our update system simpler and don't think how this should be handled during importing JSON files.
…gister

# Conflicts:
#	core/__init__.py
#	core/handlers.py
#	old_nodes/__init__.py
… handling_nodes.py. During initialization (second time) they was tried to be registered two times
@Durman Durman merged commit 925540f into master Jun 11, 2021
@Durman Durman deleted the fixing_old_nodes_register branch June 11, 2021 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant