INNER CODE UNIT · Python

callMenu

SpectralVectors/RightMouseNavigation · operators.py:97

    def callMenu(self, context):
        wm = context.window_manager
        blender_keyconfig = wm.keyconfigs["Blender"]

        select_mouse = blender_keyconfig.preferences.select_mouse
        space_type = context.space_data.type

        if select_mouse == "LEFT":
            if space_type == "NODE_EDITOR":
                node_tree = context.space_data.node_tree
                if node_tree:
                    if node_tree.nodes.active is not None and node_tree.nodes.active.select:
                        bpy.ops.wm.call_menu(name="NODE_MT_context_menu")
                    else:
                        bpy.ops.wm.search_single_menu("INVOKE_DEFAULT", menu_idname="NODE_MT_add")
            else:
                try:
                    bpy.ops.wm.call_menu(name=self.menu_by_mode[context.mode])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…