-
Notifications
You must be signed in to change notification settings - Fork 233
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
Sverchok update system RFC #121
Comments
Another issue is to make the terminolgy consistant. Instead of tree, node group is a better description since it matches blender. |
the first line under the header "update events" doesn't make sense in English reads |
My written English is bad sometimes. Please point out more unclear points. |
Giving feedback maybe less useful because I have little experience with parallelism + graph programs. I'm wondering if with Blender shipping with numpy that it may be in our best interest to migrate all the code that could benefit from that. Also what may be done for processing on multiple cores, when the node tree would allow it.. |
I have probably have less knowledge than you do. |
numpy would speed it up I think. |
@ly29 I hadn't planned on immersing myself in the lower levels of Sverchok, but even that is becoming increasingly interesting. Yeah if the single core issue is still the case, it won't stay that way for very long especially with the possibility of leveraging multicore graphics cards as matrix workers. |
@zeffii I stayed away from until it broke a bit to much for me. |
next topic is the socket data cache... |
is that to check if work needs to be done, by keeping track of which nodes have unchanged socket inputs + outputs? |
That is something that could be done. Right now we just assume all nodes that are linked downstream from a changed input have to be updated on a partial update. |
New development in #152 instead. |
A description about how updates happens in Sverchok since I know people wonder about it. Please ask questions.
Update events
Update can happen in the following ways:
What happens when each event is issued.
Editor changes
The whole node group is evaluated and a list of nodes is created. Then the update function is called on each node in a safe order. The update event from blender is issued to the
class SverchCustomTree(NodeTree):
Since the it is hard to know what has changed between two editor change updates the whole list rebuilt, the socket cache cleared and update is called for the whole node group.
Value change in a node
If a numeric value in for example a float node is changed the following code is run.
Note
These list should be cached but at the moment they are not.Done!Animation update
Animation updates are issued from a frame change handler.
Update buttons
The various update buttons use the following operator.
Note Perhaps we should separate this to have a update All and update current node tree now that we can show more than one node tree at the same time.
Functions
speedUpdate()
speedUpdate is the master update function which calls the update system and dispatches the various calls.
It has several modes.
Note It needs some cleaning to be honest.
makeTreeUpdate2()
If tree_name is passed an update list is created for that node group is stored in a update list cache. Without tree_name all node groups are processed.
Note The name comes since this is rewrite of the original update makeTreeUpdate2() function.
Building update lists
There are some function the can be used to create update lists. The list are flat and for the whole tree.
Make update list
Create an update list for a node group or a specified subset of node group. The node_set options is used by the next partial updates but can also be used for creating animation trees and other partial update trees.
Gives the following list:
7 Vectors in.001
8 Text Output
A short description of the algorithm used:
It does some error checking on the way and the whole system fails without notifying the user. Because there are many fail invalid node trees states created during normal editing. For example every time you drag a noodle from one node to another 2 updates event are issued and one socket is connected and the other is not.
make_tree_from_nodes
Create an update list of nodes affected by a change by a set of nodes.
Future issues.
Some issued for the future.
Node state and Error handling
Node need a way to mark that they are not ready and in such cases they will not be updated. Also they need should be able to be marked as failed. I think 3 node states are needed.
Separating UI and execute
Right now the ui changes and data processing events are not separated. They should be since editor changes might affect the node function and cause incorrect states. Also the other types of events (frame change and value change) do not need the UI update code to run.
I propose the following.
Animation node trees
Detect driven, animated etc nodes and update only update the parts of the node tree that are needed. Low priority.
Cache animation states
Not sure about how to do this. Low priority.
The text was updated successfully, but these errors were encountered: