-
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
"Bevel a Curve (Surface)" node et al #4268
Conversation
if not any(socket.is_linked for socket in self.outputs): | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this check now. It makes update system more complex. It can be even less efficient because some nodes update even when there are no output links but update system have to update them anyway. Update system does not know whether the node has this check or no.
sverchok/core/main_tree_handler.py
Lines 391 to 396 in 3d76f45
# this is only because some nodes calculated data only if certain output socket is connected | |
# ideally we would not like ot make previous node outdated, but it requires changes in many nodes | |
if not has_old_from_socket_links: | |
link.from_node.is_input_changed = True | |
else: | |
link.to_node.is_input_changed = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid I don't understand.
If the node does not have connected outputs, why spend time doing complex calculations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nodes does not have such optimization. How update system should understand whether a node has this check or not to update the node properly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand, the only case when the node has to be updated without having connected outputs - is the case when it has "side effects", such as drawing in the viewport or generating objects in scene. We have only few of such node classes.
So, such nodes could have special class property (has_side_effects = True
), so that update system could recognize them and trigger their update even when they do not have connected outputs.
For other nodes, update should not be triggered when they do not have connected outputs.
If we will have such logic in update system, we can remove the check from the nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But for now, do I correctly understand that the update system triggers process()
of the node even if does not have connected outputs?
In this case nodes which do complex calculations have to do the check themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the process
is called even there are no output connection of a node. I guess there are case when such update are expected for example SNL node could do something without passing any result to next nodes.
The thing is that such checks do not let make optimization in update system and adding this checks in new nodes make future improvements in this direction harder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But without this check node trees which include complex nodes do excessive computations. And at least for some nodes it means a lot of time.
Preflight checklist
Put an x letter in each brackets when you're done this item: