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

Add support of socket menus inside node groups #4533

Merged
merged 1 commit into from
Jun 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions core/node_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,25 @@ def poll(cls, context):
"Group trees are using its own update system\n"
"This system supports canceling processing next nodes by pressing escape during group tree editing")

@property
def sv_show_socket_menus(self):
"""It searches root tree and returns its eponymous attribute"""
for area in bpy.context.screen.areas:
# this is not Sverchok editor
if area.ui_type != BlTrees.MAIN_TREE_ID:
continue

# editor does not have any active tree
if not area.spaces[0].node_tree:
continue

# this editor edits another trees, What!?
if self not in (p.node_tree for p in area.spaces[0].path):
continue

return area.spaces[0].path[0].node_tree.sv_show_socket_menus
return False

def upstream_trees(self) -> List['SvGroupTree']:
"""
It will try to return all the tree sub trees (in case if there is group nodes)
Expand Down