Pie menu with row.operator instead of pie.operator

Hey guys,

I have a question, on pie menus, when using pie.operator, the pie works normally, you can draw really fast in a direction and that works well.
If you use, row.operator, you need to be exactly on the button to activate it.
The direction doesn’t work anymore.

Is there a way to fix that or is it a bug?

Thank you for your help.

Cédric

From what I understand, you are trying to do some custom layout inside a pie menu, instead of just providing a list of items? That’s not going to work, it’s undefined then which item corresponds to which area of the pie.

Maybe there can be some better heuristic, but I would not expect this to be supported now.

To give you more information, if I use this code

pie.operator("view3d.snap_cursor_to_selected", text="Cursor to selected")

I can launch the operator fast with pie menus by dragging the mouse in a direction.

If I use this code

col = pie.column(align=True)
row = col.row(align=True)
row.operator("view3d.snap_cursor_to_selected", text="Cursor to selected")

I have to be exactly on the button to have it to work.

So, maybe like you said since I don’t use pie.operator, the code don’t know which button is in which direction.

Just for info, I have 1 reasons to do this.

I added custom icons to my addon and it seems on 2.79, if we use custom icons and pie.operator and there is a report message, the pie wait for the report to disapeer.

if I use row.operator, it works fine.
I have the same issue with the screencast key addon, the pie wait and blender freeze.

I worked fine before 2.79.

So, my only way is to use row. operator, but I lose the fast workflow of the pie menus.

It sounds like a bug with report messages then, so you can make a bug report for that.

Yes, I’ll do that, I need to make an addon as example to show the issue.

One approach that might work would be for the pie menu to automatically select the first operator in the first row or column of a slice, if you didn’t point inside the rectangle of any of the other items.

The OPEN LOOK user interface developed at Sun had menu buttons (buttons in a panel that pop up a menu, or the buttons within a menu that pop up submenus) that supported the notion of a “default item” that you could change by control-left-clicking on the desired default item. Clicking on the menu button with the left mouse button was a shortcut to select the default item from that button’s menu. The default item has an oval ring around it.

I think something like that would be a good way for pie menus to let the user select any of the multiple items in the same slice to act as the “default” item you get when you gesture into the slice quickly.

Demo of OPEN LOOK menus and setting default menu items from “All The Widgets”, starting at 32:44.

You can also see some NeWS pie menus for window management and emacs color and font selection at 25:46.

(Sorry, youtube links with time codes don’t seem to work here, so you’ll have to slide to the right time yourself. “All The Widgets” is a 2 hour 15 minute historical tour-de-force of all kinds of widgets on many different platforms, recorded in 1990 for ACM CHI 1990 by Brad Myers.)

Brad Myers: This was made in 1990, sponsored by the ACM CHI 1990 conference, to tell the history of widgets up until then. Previously published as: Brad A. Myers. All the Widgets. 2 hour, 15 min videotape. Technical Video Program of the SIGCHI’90 conference, Seattle, WA. April 1-4, 1990. SIGGRAPH Video Review, Issue 57. ISBN 0-89791-930-0.