Pie Menu Editor 1.18.7

I found what the problem is. If I drag to select the vertex, even if I only pick one, it won’t work. If I just select one vertex, then it’s ok. So I guess I have a workaround. https://blenderartists.org/uploads/default/original/4X/0/3/4/034ff03aaf41f9febf28c5200f75a9472e4925ef.mov

Try this code instead:

bpy.ops.view3d.snap_cursor_to_selected(); bpy.ops.object.mode_set(mode='OBJECT'); bpy.ops.object.origin_set(type='ORIGIN_CURSOR'); bpy.ops.object.mode_set(mode='EDIT')

Rock n’Roll! With your awesome tool, I’ve been able to replicate most of my Maya workflow. Snaps and pivots are my only issues but I got something more efficient with Pie Menus than the normal popup menus.

Yeah, me again. I thought I mastered Pie Menus but apparently not. I’m trying to change the viewing modes in the 3D view using theses commands the I get from the scripting layout but it fails.

bpy.data.screens[“Scripting”].shading.type = ‘WIREFRAME’
bpy.data.screens[“Scripting”].shading.type = ‘SOLID’
bpy.data.screens[“Scripting”].shading.type = ‘MATERIAL’
bpy.data.screens[“Scripting”].shading.type = ‘RENDERED’

When I try then in the console I get this error message: AttributeError: ‘Screen’ object has no attribute ‘shading’

Have you tried to use RMB context menu?

PME will generate this code for solid shading type

C.space_data.shading.type = 'SOLID'

There’s no menu in 2.8 to change the shading mode. Just the interface buttons and the python command they give is what I tried. But the line you gave me works. Thanks again :slight_smile:

43%20AM

I think todays blender bulid mixed up something and my menus are pretty mixed up.

edit:

https://developer.blender.org/rBb89cabb300816427273596736aa45ab9edca76b9

Yes, but RMB context menu should also work for buttons. Just press RMB and select Pie Menu Editor entry.

What do you mean? Please post some screenshots.

Bug report:
https://developer.blender.org/T63912

Fix in progress:
https://developer.blender.org/T63912#666623

Oh! Cool! Now I don’t think I will need to bother you anymore. :slight_smile:

I wrote this a while back to make a single hotkey frame selected objects if selected, or all objects if none are selected. It works, but doesn’t use smooth view in preferences, it just pops immediately.

When I use bpy.ops.view3d.view_selected(use_all_regions=False) from the View menu in 3dview, there are a bunch of bpy.ops.view3d.smoothview() print outs.

Is bpy.ops.view3d.smoothview() something I need to include in the script as well?


if bpy.context.object.mode == 'OBJECT':
	selected = list(bpy.context.selected_objects)
	if len(selected) != 0:
		bpy.ops.view3d.view_selected(use_all_regions=False)

	elif len(selected) == 0:
		bpy.ops.view3d.view_all(center=False)
	

I had the same.
Reordered them and now they are fine again … weird though

No, afaik, this is an internal Blender operator which is used automatically to animate 3d view.

1 Like

Thanks, looks like it will be fixed soon.

Wrap the operator in exec and use the invoke argument.

cmd = "bpy.ops.view3d.view_selected('INVOKE_DEFAULT')"

exec(cmd)
1 Like

Hi, roaoao, it is possible make tool with pme like this? Standart inset but have negative value for thickness, in negative thickness tool change inset to outset and after comand end, it’s select outset region. Just dragging inset region or outset region, like depth not stop dragging when get value 0 and have positive and negative value. With modal operator it’s activate standard insert tool and any hotkey cannot be used.

Its possible use macro for multiple objects? Example, i pick many objects and with hold alt can change many properties to all object. For example, pick many objects and change display as bound or wire for all picket object, with holding alt, macro operator do it for only one object, how to make it for all selected objects?

Here is an example.
Use MouseWheel to change the thickness.

Hold alt? What do you mean?
Can you export and post this macro?

1 Like

Thank you very much! About alt i mean this.

With macro i can change properties for only one object, it possible to change values for multiple selected objects?

Wow, thanks. Didn’t know about this feature.
Here is the code for the pie, menu or popup (Command tab, Blender 2.8+):

macro_name = "My Macro"; ao = C.active_object; ([(setattr(C.view_layer.objects, "active", o), open_menu(macro_name)) for o in C.selected_objects], setattr(C.view_layer.objects, "active", ao)) if E.alt else open_menu(macro_name)

Alt+Click a button to call the macro for all selected objects
Click to call it for the active object only.

Note that you can pass variables to your macro:

open_menu("My Macro", my_var1=111, my_var2=222)
2 Likes