ver1.2.0 update
User property, Add menu display location, Avoid macro error
Advanced features have been added to create more flexible menus.
- Add use_property_split to layout options
- Direct input of layout code is possible
- Change the display location of panel menu
- Add “Avoid error” option to macro
- Add user property
- Bug fix for “Export as add-on”
- Added option to automatically convert’bpy.data.xxx[xxx]’ to’bpy.context.xxx’ in history or macro
Link
【Customize Menu Editor ver1.2.0 アップデート】メニュー表示場所の追加・マクロのエラー回避・ユーザープロパティ【Blenderアドオン】 – 忘却まとめ
Edit menu
The display of the edit menu has been improved to make it easier to identify the difference between display switching and type switching.
- You can now choose the type of menu item to add
- “+” button at the upper left corner
- Changed the duplication position of menu items to be below the active item
add use_property_split
Added use_property_split to layout options.
The property label and button are displayed separately.
This is useful when using FloatProperty or when you want to display many properties side by side.
- With use_property_split option, you can set use_property_decorate
- Show the add keyframe button next to the property
Direct layout input
You can directly enter the layout script in the “layout element only” type.
- It should be shaped like layout.xxx
- If you enter multiple lines with “;”, they will be side by side.
- If you want to align vertically, you need to enter the column manually
- For advanced users
Ability to change the display location of the panel menu
Editor type that displays the panel menu- Limited display mode in 3D view You can set the display location in the property editor.
This setting is also reflected when “Export as Add-on” is executed.
Editor type
- 3D View
- Image Editor
- Node Editor
- Dopesheet Editor
- Graph Editor
- Nla Editor
- Clip Editor
- Sequence Editor
- Properties
- Text Editor
Limited type of display mode in 3D view
In 3D view, you can limit the display mode.
- None
- Mesh Edit
- Curve Edit
- Surface Edit
- Text Edit
- Armature Edit
- Metaball Edit
- Lattice Edit
- Pose Mode
- Sculpt Mode
- Weight paint
- Vertex paint
- Image paint
- Particle Mode
- Object Mode
Where the tab is displayed in the Property Editor
In Property Editor, you can set the display location of the tab.
- tool
- render
- output
- view_layer
- scene
- world
- object
- modifier
- particles
- physics
- constraint
- data
- material
- texture
macro
Added “Avoid errors” option
I tried to avoid the error.
- The line that executed and had an error is displayed in red
- If the command encounters an error, slew that line and continue
- If you want to see the error log and debug, turn off this option
- When making an add-on, the lines that are in red due to an error are passed through
Register the macro edit list as a menu
I made a function to add a macro edit list to the menu so that the macro can be easily accessed.
- Register a list of macros as a menu
- Register a list of macro lines as a menu
- This menu cannot be exported by “Export as add-on”.
User property
Users can create properties.
You can perform advanced processing using properties.
For advanced users.
- When exported as an add-on, they are exported together
- User property list can be written to and read from a file
Types available
type |
Explanation |
bool |
Truth |
string |
String |
int |
integer |
float |
Floating point |
The above property types are available.
Other configurable data
type |
Explanation |
var_name |
Variable name of the property used internally |
Unique name |
|
Space cannot be used |
|
default |
Set the initial value of the property |
Used when exported as an add-on |
|
name |
The name of the property |
description |
Property description |
subtype |
You can set the data type of int/float/string |
unit |
Unit of int/float data can be set |
min |
You can set the minimum value of int/float |
max |
You can set the maximum value of int/float |
Usage within add-on
uprop ( "var_name" )
You can use the above code as a property.
- “Command” type, “Layout” type macro
- Returns the value of the user property item for the variable name in var_name
- “Property”
- Display the user property item with the variable name of var_name as a menu
bpy.context.preferences.addons['customize_menu_editor'].preferences.customizemenu_colle_uprop['var_name'].bool
To access from outside the addon, you need to write as above.
- “customize_menu_editor” is the folder name of Customize Menu Editor
- ‘var_name’ is the variable name of the data you want to get
- ‘bool’ is the property type
Export as add-on
You can now export as an add-on from the user settings.
The settings are saved as add-on settings, and you can save input when exporting again.
You can also export and change settings from add-on settings.
- The following settings can now be exported as add-ons
- User property
- Panel menu category
- Panel menu editor type
- Limited display mode in 3D view of panel menu
- Display location in the property editor of the panel menu
- Not only the menu but also many data can be added on, so the name of the function has been changed
- old " Export menu as add-on "
- new " Export as add-on "
Bug fix
- Fixed an issue where add-on export could not be performed on Linux or Mac
Get previous history
- Fixed a problem that the history cannot be acquired normally when there is a space in the object name etc. in the “property” type
- Improved so that the automatically generated button name will be shorter if possible if it has more than 30 characters.
Automatically convert’bpy.data.xxx[xxx]’ to’bpy.context.xxx’
When retrieving history, rewrite the history so that the code always works on active data.
Currently only the following data is supported.
- various objects
- shape_keys
- materials
- particles
The details
- bpy.data.xxx[xxx]~ is specific data in Blender
- bpy.context.xxx~ is the currently active data, and it always changes depending on the user operation.
- If you want your code to always work for certain data, turn this setting off
- You can use this option with “command” type, “property” type macros
Example: Changing material node properties
Even if you register the history of the property change of the material node as it is, it always works only with a specific material.
The options can be rewritten as below to work with the active material.
Original code
“Material.001” “Principled BSDF” node properties menu
bpy.data.materials["Material.001"].node_tree.nodes["Principled BSDF"].inputs[4].default_value
Code modified with option enabled
“Principled BSDF” node properties menu for active material
bpy.context.object.active_material.node_tree.nodes["Principled BSDF"].inputs[4].default_value
Other bug fixes
- Fixed the problem that only the first tab could be deleted with the tab deletion function.