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

mixed up category and subcategory names in nodes shift-a menu #5127

Open
Andrej730 opened this issue May 30, 2024 · 0 comments
Open

mixed up category and subcategory names in nodes shift-a menu #5127

Andrej730 opened this issue May 30, 2024 · 0 comments

Comments

@Andrej730
Copy link
Contributor

Andrej730 commented May 30, 2024

Sverchok version used - 242d6f8
Blender 3.6.5

Steps to reproduce

  1. Install the following addon -
    sverchok_subcategory_issue.py.txt

(replace .py.txt extension with .py). The code of the addon is attached at the end of this post.

  1. Create a new sverchok node graph and open shift-a menu.
    In category "Ladybug -> Viz" you can see the nodes from main node category "Viz" and from subcategory and node "LB Out" is not present.
    image

Expected to see just 1 node "LB Out".

Though node is still available through node search:
image

Nodes category and subcategory are registered using

from sverchok.ui.nodeview_space_menu import add_node_menu
# [{'Ladybug': [{'Viz': ['SvLBOut']}, {'Analyze Data': ['SvComfStat']}]}]
print(node_categories)
add_node_menu.append_from_config(node_categories)

sverchok_subcategory_issue.py

bl_info = {
    "name": "Ladybug Tools",
    "author": "Dion Moult",
    "version": (0, 0, 240515),
    "blender": (2, 90, 0),
    "location": "Node Editor",
    "category": "Node",
    "description": "Ladybug, Honeybee, Butterfly, and Dragonfly for Blender",
    "warning": "",
    "wiki_url": "https://wiki.osarch.org/",
    "tracker_url": "https://github.com/ladybug-tools/ladybug-blender",
}

import bpy
from sverchok.ui.nodeview_space_menu import add_node_menu
from sverchok.node_tree import SverchCustomTreeNode


class SvComfStat(bpy.types.Node, SverchCustomTreeNode):
    bl_idname = "SvComfStat"
    bl_label = "LB Comfort Statistics"

class SvLBOut(bpy.types.Node, SverchCustomTreeNode):
    bl_idname = "SvLBOut"
    bl_label = "LB Out"


classes = [SvComfStat, SvLBOut]
node_categories = [
    {
        "Ladybug":
            [
                {"Viz": ["SvLBOut"]},
                {"Analyze Data": ["SvComfStat"]}
            ]
    }
]
add_node_menu.append_from_config(node_categories)


def register():
    add_node_menu.register()
    for cl in classes:
        bpy.utils.register_class(cl)


def unregister():
    for cl in classes:
        bpy.utils.unregister_class(cl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant