Thanks, that worked !
Do you know If I could use the same code to enable and disable something like a “object naming box”, such as:
panel('OBJECT_PT_context_object', frame=False, header=False, expand=None, area='PROPERTIES')
Thanks, that worked !
Do you know If I could use the same code to enable and disable something like a “object naming box”, such as:
panel('OBJECT_PT_context_object', frame=False, header=False, expand=None, area='PROPERTIES')
In the MACHIN3tools free addon there is a smart face function. When you select a face and press 4 (default key) it will duplicate face to new object, select that face and go to face mode. But it works only with faces unfortunately.
What do you think about creating a separate topic in which we can share our PME menus in .json files?
I’m sure many of you have some brilliant PME scripts that let many of us improve and speed up Blender workflow even more. For my part I can provide all my menus but some of them require other addons (paid and free).
@roaoao. Here’s a trivial feature request but would be cool if you could implement it: Show stats about menus, like how many in total, how many of each type, how many in each context (3d view, UV editor, etc)
@Pinhead, @anphung, I didn’t find any good way to get new object name. You can use something like this:
obj_names = {o.name for o in D.objects}
# add object
new_obj_names = {o.name for o in D.objects} - obj_names
new_obj = D.objects[new_obj_names.pop()]
new_obj.select_set(True) # select new object
C.view_layer.objects.active = new_obj # activate new object
In your code:
bpy.ops.mesh.duplicate_move(MESH_OT_duplicate={"mode":1}, TRANSFORM_OT_translate={"value":(0, 0, 0), "orient_type":'GLOBAL', "orient_matrix":((0, 0, 0), (0, 0, 0), (0, 0, 0)), "orient_matrix_type":'GLOBAL', "constraint_axis":(False, False, False), "mirror":False, "use_proportional_edit":False, "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "use_proportional_connected":False, "use_proportional_projected":False, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "gpencil_strokes":False, "cursor_transform":False, "texture_space":False, "remove_on_cancel":False, "release_confirm":False, "use_accurate":False}); obj_names = {o.name for o in D.objects}; bpy.ops.mesh.separate(type='SELECTED'); bpy.ops.object.mode_set(mode='OBJECT'); bpy.ops.object.select_all(action='DESELECT'); new_obj_names = {o.name for o in D.objects} - obj_names; new_obj = D.objects[new_obj_names.pop()]; new_obj.select_set(True); C.view_layer.objects.active = new_obj
Try to use disabled sub-layout in panel()
function like this:
panel(..., layout=sub)
Works great for me! Thank You roaoao! You are the MAN!
I think it’s better to use some custom script/menu for this. Here is an example:
Total number of menus (Custom
tab):
L.row().label(text="Total: %d" % len(prefs().pie_menus))
Menu types (Custom
tab):
menus = prefs().pie_menus; data = dict(); [data.__setitem__(menu.mode, data.setdefault(menu.mode, 0) + 1) for menu in menus]; uil = bpy.types.UILayout; col = L.column(align=True); sorted_data = sorted([(uil.enum_item_name(menus[0], "mode", mode), mode, number) for mode, number in data.items()]); [col.label(text="%s: %d" % (mode_name, number), icon_value=uil.enum_item_icon(menus[0], "mode", mode)) for mode_name, mode, number in sorted_data]
Context (Custom
tab):
data = dict(); [data.__setitem__(keymap, data.setdefault(keymap, 0) + 1) for menu in prefs().pie_menus for keymap in menu.parse_keymap()]; col = L.column(align=True); [col.label(text="%s: %d" % (keymap, number)) for keymap, number in sorted(data.items())]
Hotkey (Custom
tab):
menus = prefs().pie_menus; data = dict(); [data.__setitem__(menu.key, data.setdefault(menu.key, 0) + 1) for menu in menus if menu.key != 'NONE']; uil = bpy.types.UILayout; col = L.column(align=True); sorted_data = sorted([(uil.enum_item_name(menus[0], "key", key), number) for key, number in data.items()]); [col.label(text="%s: %d" % (key, number)) for key, number in sorted_data]
With the latest blender 2.81 build (blender-2.81-b962aca8003d-windows64) PME cousing crashes when using pie menus from other addons. For example when i tru top use pie menu from MACHINEtools every time blender crashes with:
Error : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF73B973CD8
Module : H:\Blender\Blender2.81\blender.exe
When i disable PME is working all ok.
In previous build (blender-2.81-9609840b5ea1-windows64) there is no crashes
When using this script in2.8, I get this error:
Traceback (most recent call last):
File “C:\Users********\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\pie_menu_editor\ui_utils.py”, line 176, in execute_script
exec(marshal.load(f), exec_globals)
File “C:\Users*\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\pie_menu_editor\scripts\command_area_join.py", line 37, in
join_area()
File "C:\Users*\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\pie_menu_editor\scripts\command_area_join.py”, line 33, in join_area
max_x=rect[2], max_y=rect[3]):
File “D:\blender-2.81-c8df6f2cf9df-windows64\2.81\scripts\modules\bpy\ops.py”, line 199, in call
ret = op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
TypeError: Converting py args to operator properties: : keyword “min_x” unrecognized
In 2.79 I just had ‘bpy.ops.area.joinarea()’ and it worked.
Thanks, will release new version with the fix today.
I’m also having trouble with the Properties and Outliner scripts. They open fine, but when I run the command again they won’t close and instead give me this error
Traceback (most recent call last):
File "C:\Users\************\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\pie_menu_editor\extra_operators.py", line 670, in execute
max_x=a.x + a.width + 2, max_y=a.y + a.height - 2)
File "D:\blender-2.81-c8df6f2cf9df-windows64\2.81\scripts\modules\bpy\ops.py", line 201, in __call__
ret = op_call(self.idname_py(), None, kw)
TypeError: Converting py args to operator properties: : keyword "min_x" unrecognized
location: <unknown location>:-1
Yes, the same error. New API changes in Blender 2.81
So that’s two bugfixes with one stone, great!
Looking forward to the new build.
Any word on updated Panel Group functionality? With the changes to the interface, it’s become harder to place extra buttons in the headers etc.
This is what I used to have
It is possible to have button in topbar with:
bpy.ops.pme.timeout(override_context('VIEW_3D'), cmd='bpy.ops.wm.tool_set_by_id(name="builtin_brush.Smooth"))')
sculpt smooth brush that be work in edit mode?
Been away from Blender for a bit. Are interactive panels working correctly? The red buttons seem to have disappeared (from menus).
Not in 1.16.2 version. Will try to find a way to reimplement them in the next version.
Macros for Copy/ Cut & Paste mesh components made using roaoao’s code.