Customize Menu Editor

Creates a user-customizable menu

Build your easy-to-use and accessible menu by userself.

Download

gumroad

Blender Market

BOOTH

Documents

Customize Menu Editor【Documents】 – 忘却まとめ

Link

How to use

custom_menu_editor_how_to_01
First menu state.

1. Add menu

custom_menu_editor_how_to_02
When you press the + button on the upper left, the " Set Just Before History " button is added.

2. Menu registration

custom_menu_editor_how_to_03

Set Just Before History” by clicking the button, you can register the operation which was executed immediately before the menu.
In the example, I registered after running “Primitive Monkey Add” .

By default, the code type is command , and you can make detailed options of operators and properties into buttons.

3. Edit details


Menu for creating and adjusting menus

To edit detailed settings, enable “ Edit Mode ” and open the detailed setting menu.
You can switch the active menu with the “.” button at the bottom left.
After creating the menu , save the user settings with the " Save " button.

4. Completed menu

Created menu

Export menu as add-on


↑ Exported add-on menu

You can save the created menu as an add-on in a .py file.
It is available as an add-on independent from the Customize Menu Editor add-on.

Option

  • Export as add-on
  • Export to a text block in Blender
  • Copy only menu script to clipboard

Export/Import

import_expot

You can export/import the menu to a text file.
You can back up the menu or move it to another environment.

Available code layout elements

For command operator menu properties, each code must be in a fixed form.
If you register from “Register previous history”, it will be automatically formatted according to the type.

Type Explanation
command The code will be a button that can be executed as an operator. You can change the
operator’s detailed options and properties as it is. When you
register with “Register previous history”, the name for display will be generated based on the code

below. Must be in a form like
bpy.xxx.xxx()
bpy.xxx.xxx.xxx = True
operator Operator can be a button Operator can be
a button without registering detailed options
The name for display is the name of the operator

It must be in the following
format xxx.xxx
Property Create a menu of property
you can set in the menu that can be switched or adjusted

in the form such as the following must
bpy.xxx.xxx
menu You can register the context menu It

must be in the following form
CLASSNAME_MT_xxx
label Create text
separator Insert a blank You
can adjust the size with factor

Layout

You can change the menu display to vertically or horizontally.
If “Follow the layout above” option is off, stop following the previous layout element.

Layout Explanation
text You can change the display name of the menu item,
leaving the text empty will display the icon only
icon You can change the icon of the menu item.
You can set it by selecting the icon built into Blender from the icon setting menu.
row Horizontally
row = layout.row (align = True)
col Vertically
col = layout.column(align=True)
box Enclose in a box
box = layout.box()
split Split into two horizontally
sp = layout.split(align=True,factor=0.9)


Icon setting menu

Layout options

layout_option

Layout Explanation
scale_x / scale_y Change the horizontal/vertical size
alignment Align left/center/right
alert Red warning
emboss Turn off emboss
active Display dark

Tabbed

Tab_menu
You can divide the menu into multiple tabs.
Tabs can be added and renamed by the user.

menu

  • 3D view → Sidebar (N key) → Tools → Customize Menu

You can change the location of the added tabs other than “Tools”.

9 Likes

Can I add python script snippets to a button with your addon?
Like a macro for multiple actions.

As example: select all by type mesh. Unparent keep transformation, switch to edit mode, tris to quad, merge by distance, exit edit mode. Remove all materials set to smooth shading.

That’s something I have in the text editor and run, when I import meshes.

Multiple operations can be performed by combining multiple lines into one line.
However, in the current add-on version, it is not possible to process with indent (for statement, if statement, etc.),
so I will be fixed by update.

Operators that users can create with “commands” use the function (exec()) that executes a character string as source code.
To combine the code on one line, convert the line breaks to " ; ".

Original code (example)

bpy.ops.object.select_all(action='DESELECT')
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.mode_set(mode="EDIT")
bpy.ops.mesh.quads_convert_to_tris(quad_method='BEAUTY',ngon_method='BEAUTY')
bpy.ops.mesh.remove_doubles(threshold=0.01)
bpy.ops.object.mode_set(mode='OBJECT')

Code in one line (example)

bpy.ops.object.select_all(action='DESELECT');bpy.ops.object.select_all(action='SELECT');bpy.ops.object.mode_set(mode="EDIT");bpy.ops.mesh.quads_convert_to_tris(quad_method='BEAUTY',ngon_method='BEAUTY');bpy.ops.mesh.remove_doubles(threshold=0.01);bpy.ops.object.mode_set(mode='OBJECT');


3 Likes

Thanks for the example. Just purchased the tool and it is working great thanks to your example.
But I can’t find the save button to export my command button as a addon to share with a coworker.

Export it as an add-on by clicking the here.
Commands are exported with the menu.

  • menu icon in the upper right → “Export Menu as Addon”

That’s odd.
image

1 Like

I’ve just looked into the cause and found an issue where the menu is not displayed when the “Auto Save Preference” option is enabled.
We will fix this problem as soon as possible.

ver1.1.0 has been released.
Fixed an issue where the export menu was not displayed when the “Auto Save Preference” option was enabled.
Other updates will be translated later.

Customize Menu Editor ver1.1.0 - Japanese

2 Likes

ver1.1.0 / ver1.1.1 Updated

Macro creation, layout of more complicated menus, improvement of edit menu

Added macro create function

You can collect the history of a series of operations into one and execute it as a batch process.
Each macro can be a menu button.

When adding a menu as an add-on, if the menu button of the macro exists in the menu, the macro is automatically included in the add-on.

How to use

  1. Add a macro item with the + button on the upper right
  2. Press the button at the bottom left to start recording history
  3. Do something and make a history
  4. Press the stop button to finish recording
  5. A history list is created
  6. You can execute the macro created with the button

function

  • Recording
  • Run button for each line
  • Run button display mode
  • Add macro as button to menu
  • Export to file/read exported file

important point

  • An error will occur in the history of scale, rotation, etc. during the execution of “extrusion”
    • Run extrusion and transform separately to create history
    • Seems like a Blender bug
  • In the case of bpy.data.xxx[‘xxxx’] and so on, since the specified data is targeted, that data will be fixed and will be changed even if the active selection is switched.

Command related improvements

By grouping multiple lines of code into one line, you can execute multiple operations at once.
You can now execute multiple lines with indents, and you can do things like if and for statements.
To combine the code on one line , convert the line breaks to “;” .

“Paste code from clipboard” function

Paste the clipboard code.
If there is a line break, the line break is automatically converted to’;’.
You can easily execute it as a button by copying and pasting various Python scripts introduced on the net.

[Sample] Delete all unused materials

■ Original code

for mat in bpy.data.materials:
    if not mat.users:
        bpy.data.materials.remove(mat)

■ Code summarized in one line

for mat in bpy.data.materials:; if not mat.users:; bpy.data.materials.remove(mat)

important point

  • Function code is not available
    • Example: There is a line like def xxx():
  • Do not add the first indent

■ Example of initial indentation and failure

    for mat in bpy.data.materials:
        if not mat.users:
            bpy.data.materials.remove(mat)

“Copy code to clipboard” function

Copy the code to the clipboard.
If there is a’;’, it will be automatically converted to a line break.
This is convenient when you want to get the code converted into one line as the code before formatting.

“Add’INVOKE_DEFAULT’” function

Add’INVOKE_DEFAULT’ to the operator options.
An operator who makes adjustments and then confirms the operation can be started from the adjustment stage (such as a transform).
If the operator does not work well, adding’INVOKE_DEFAULT’ may work.
Example: Modal operator, animation render, etc.

Menu improvements

You can now stack multiple layout elements.
You can create more complicated menus by enclosing them in a box and arranging them side by side in row, or by col in a row side by side.

Editing menu improvements

Improved menu selection

The menu selection button is now placed next to the menu item .
Fixed an issue where it was hard to see the active selection if there were rows, cols, etc.

  • The’register previous history’ button has been removed
  • You can execute’Register previous history’ by Ctrl + clicking the menu selection button.

Modified so that the vertical width does not change depending on the type of menu being displayed.

Fixed an issue where the menu was misaligned and difficult to see each time it was switched.

Ability to specify layout elements to follow

The “Follow the layout above” option has been changed to specify the hierarchy to follow by a number. You can specify the order above the
deeper layout element to follow .

  • If you specify a number larger than the hierarchy, it will not follow the elements of other layouts.
  • If the number is 0, follow the previous layout element

About old options

To display the “Follow the layout above” option in ver1.0.0, enable Display from Add-on Settings.
Please note that in the future only new options will be used within the add-on.

  • Add-on Settings -> Options -> Show ver1.0.0 ‘Follow the layout above’ option

Added “layout element only” option

You can add only row and col.

Bug fix for add-on function

  • Fixed an issue where an error was output when “” was present in the code with “command” type
  • Fixed an issue where an error was output when a separator was present

Other changes

The extension name of the export of the menu file was changed.
Changed to unify the extension names of the export files of macros and menus.
You can still read files with the previous extensions.

  • old :customizemenu
  • new: cmenu_menu
  • Macro file name: cmenu_macro

Other bug fixes

  • Fixed an issue where the export menu would not appear if the “Autosave Settings” option was enabled

ver1.1.1

  • Fixed a fatal issue where the edit menu could not be displayed without a menu item
  • Fixed an issue where macro line items could not be duplicated when duplicating macro items
  • Added the function to move and switch only the selected state to move menu items
    • Ctrl + click move button
4 Likes

Hi @Bookyakuno ,
A very nice and handy addon, thanks!. But on Blender Market the latest version is 1.1.0 and it shows up in Blender like this :
customize_menu
I believe there is no error to see in the system console.

This is great, I had to learn python to create my first addon which were just buttons and could have been created like this.

Btw, recently I saw this, very similar addon https://twitter.com/jfranmatheu/status/1245346918127087616

1 Like

Oops. I’m sorry,
it seems that did not save the changes added ver1.1.1 file in Blender Market.
I added ver1.1.1 to Blender Market now.
I think that the problem was solved by ver1.1.1.

1 Like

I didn’t know the add-on you introduced.
Everyone thinks the same. :sweat_smile:
Another competing add-on is the ‘pie menu editor’ add-on.
However, I found it difficult to intuitively understand the operation and had an idea about my add-on,
so developed Customize Menu Editor add-on.

1 Like

I made a video explaining how to use and function.

Blender Add-on : Customize Menu Editor [Menu / Macro / Add-on Builder] - YouTube

5 Likes

Alright, I’m sold on another one of your addons - you have a lot. This and pie menu editor from roaoao, I think you can become one with the blender matrix. Hopefully you can keep this friendly with pie menu editor. I love that you can add anything python to a button on the N-bar, this makes organizing a ton of addons easier.

I have a few things I’m curious about.

*Is there a way to add a slider bar on the buttons?

*Would it be possible to grab things from properties or render tab, checkbox for example. The purpose would be it could allow more screen real estate, essentially being able to combine what you want from different tabs.

Thank you for reading this and for your awesome addons.

I bought this for the macros. Looking forward to digging my teeth into it.
Being able to do custom menus like I had them in Max sounds mighty fine to me as well.

Looking forward to seeing this develop.

looking really great, can you add a function to add our own props,

What does the slider bar mean?
For example, properties such as rendering resolution percentage can be registered as a menu.

Properties that remain in the history, can be registered as a menu.

The video shows how to register rendering and Eevee properties as a menu.

3 Likes

User can create batch processing function as macro, and created macro can be registered as menu.

Perfect. Wow this is so powerful, make task macros, create literally any menu option without dealing with much python code. Simply great work, keep making videos and developing this one - this is huge for blender. Thanks for the video