-
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
Separate UI and processing v2, Simple approach #279
Comments
This is a new issue since the old one got longer than needed and contained many other things. #152 wasn't moving forward. |
does process only get called by sverchok if state==ready ? |
That is my idea, this would happen for separate graphs on a layout, process would only be called if a graph changes. Separate layouts and unconnected graphs in on layout are done independently already today in preparation for this kind of behaviour. >>> ng.get_update_lists()
([['Random Vector', 'Vectors in', 'Vector Math', 'Viewer Draw'],
['Integer', 'List Range Int', 'function', 'Debug print']], {}) |
Doing the simple one would solve many problems and work of restructuring could begin like that, I think I will make branch to test that approach. |
to test simple solution? |
Yes. |
yes, it must be grounded and rethinked some times before implementation. |
Yeah, something went wrong with that sync, I am working on something nice, will sync again in a while. There isn't much to see here yet. |
Lot of work left to make this work well.
|
We can implement something like a for and do while loops with similar techniques as these. And many other things. |
@nortikin |
I starting to think that packing the recursive parts into a node group is pretty good way to deal with these scenarios. |
Exciting developments @ly29. I'm getting flashes of PureData and Buze (Buzz clone) |
@zeffii |
Cool. Open Floodgates.
The |
The general idea plan right now for this branch:
@zeffii
Of course that is the proper way, and actually only sane way, of creating node groups, building them by hand has serious limitations.
My plan is to let them live in frame while being edited, but let them live permanently in the hidden Sverchok tree type shown above, so we can have node groups without them being visible but still use all current nodes (with conversion as shown above). The group input and output grows and shrink according to need, but only linked socket are propagated to the node group/iteration node. And only when it is "linked", might change that terminology and how it works a bit. |
the only correct response is an animated gif: http://i.imgur.com/1KsMK.gif |
A do while loop or more advanced scenarios also fit into this scenarios. There is not theoretical limit for node groups depth or recursion, practical limits of course exist. |
Svelegant, I should say. |
I think this basic approach has some things going for it.
|
So the question is, should I work on this or does it seem useless? Doing this make sverchok turing complete, recursion etc is possible. If we decide to do this we should.
So yes or no? If yes I think we can convert everything quite quickly and then explore further techniques, even if in the long term it isn't enough it will make the next step easier. So I say yes. |
Can it be manipulated to use the builtin grouping feature? |
until then I guess sticking those parts in a Frame is an OK visual solution |
As far I understand that part of pynodes isn't ready yet, if we build ourselves we make an incentive for the blender developers to do that I think, it should also be quite easy to convert our node groups to proper node groups when the time comes. There are some details to work out of course but I think it is quite doable. |
Also it is a good time implement reroute support etc that involves changing a lot of nodes. |
do any nodes get excluded from this? |
it wouldn't surprise me if this produces undefined behaviour in SN.. But you might have to do a bunch of nodes so we can see through |
the 3dview props node should work without any changes. Types of nodes when it comes to update.
I'm all for doing a bunch for nodes and finding out what needs to change, the most important part is that the node tree and blender doesn't control processing but only the ui part. |
should we create own classes for this processing? |
There are still some styles issues to be worked out but I will explain, soon. |
@zeffii |
I'm quite happy to modify my nodes, and if that goes well start picking off the others..some of which i've never looked at the source for. |
So I will write up some notes and convert a few more nodes, then we can do the conversion quite easily I think. |
in separate branch |
If you guys need help I also can rewrite nodes. This topic sounds like necessary to me. |
Some updates.
Some further changes are coming, I'm doing a full write up of how to write a well behaved node. Also propose to call this version 0.5 |
yes, but what we have to change? update function? @classmethod
def updateNode(cls, self):
update_node will do what you write to do with nodes. |
Very confused by me. It isn't a class method, but is placed in the SverchCustomTreeNode class as a method, renamed to keep better naming and keep track of changes needed. Since it a method that is somewhat over used today. |
ok, than we should delete all updateNode in nodes? |
@nortikin |
now watching https://docs.python.org/3.3/library/threading.html#module-threading |
Why?
This is is a standard paradigm in all system so I don't is needed to argue why it is a good thing but I will state briefly why it is a problem.
Today processing and some UI handling is contained in node
update()
function. This function is called from two contexts, by blender directly on editor changes and from the Sverchok update system. The intended function of the update function is clearly stated in the documentation:Update on editor changes
. Editor changes in this context is: creating sockets or linking sockets. Moving a node, renaming, selecting a node etc isn't an editor change.However, every time you link a node or create/move/delete a socket a new update event is issued, there isn't any recursion check going on here. Note that this also includes the
def init(self, context):
function, update will be called for each socket you create, it is needed to check for the existence of sockets on every call to update to avoid a cascade off non critical errors.From Centers polygon node for example.
These errors doesn't affect the operation of sverchok but they are annoying.
How
There are a two main alternative approaches in my head:
The simple
We move the processing to a new function in every node which will be called from the sverchok update system.
Pros
Cons
Example code from the in range function which isn't such good example since doesn't need an
update
function.Becomes:
The complete
Compile every node into a something that can be executed and optimized on the way, for example several math nodes could be optimized into one expression, fine tracked control of what needs to be updated is possible.
Pros
Cons
I am sure that the second solution is the right one but I an not certain that I am up to the task of designing it correctly.
The text was updated successfully, but these errors were encountered: