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

Delayed print of disabled nodes #4032

Merged
merged 4 commits into from
Apr 10, 2021
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
24 changes: 23 additions & 1 deletion menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,32 @@ def draw_node_ops(self,layout, context):
layout.operator(update_import, text='update appended/linked', icon='RNA')
layout.separator()

def strformated_tree(nodes):

lookup = sverchok.utils.dummy_nodes.dummy_nodes_dict

lstr = []
for category, nodes_in_category in nodes.items():
lstr.append(category + "\n")
for node_bl_idname in sorted(nodes_in_category):
item = lookup.get(node_bl_idname)
if item:
node_bl_label, dependencies_listed = item
lstr.append(f" {node_bl_label} ({dependencies_listed})\n")

return "".join(lstr)


def make_categories():
original_categories = make_node_cats()

node_cats = juggle_and_join(original_categories)
node_cats = include_submenus(node_cats)
node_categories = []
node_count = 0

nodes_not_enabled = defaultdict(list)

for category, nodes in node_cats.items():
name_big = "SVERCHOK_" + category.replace(' ', '_')
node_items = []
Expand All @@ -472,7 +491,7 @@ def make_categories():
continue
rna = get_node_class_reference(nodetype)
if not rna and not nodetype == 'separator':
logger.info("Node `%s' is not available (probably due to missing dependencies).", nodetype)
nodes_not_enabled[category].append(nodetype)
else:
node_item = SverchNodeItem.new(nodetype)
node_items.append(node_item)
Expand All @@ -484,6 +503,9 @@ def make_categories():
category,
items=node_items))
node_count += len(nodes)

logger.info(f"The following nodes are not enabled (probably due to missing dependancies)\n{strformated_tree(nodes_not_enabled)}")

node_categories.append(SverchNodeCategory("SVERCHOK_MONAD", "Monad", items=sv_group_items))
SverchNodeItem.new('SvMonadInfoNode')
return node_categories, node_count, original_categories
Expand Down