2
$\begingroup$

Below you can see that the Normal size value is 737cm while it is actually only 37cm.

enter image description here
enter image description here

Here is the code - any idea if this is a bug or a mistake I did?

def draw(self, context):
    layout = self.layout

    mesh = context.active_object.data
    scene = context.scene

    pie = layout.menu_pie()      
    pie.prop(scene.tool_settings, "normal_size", text="Size")
$\endgroup$
2
$\begingroup$

Those numbers are really, unless i'm mistaken, the menu indices. The 7 isn't from the normal_size, but from the index of that pie-item. It's drawing the slider rather awkwardly close to the index. Leading me to believe pie menu's weren't intended to be used for drawing sliders, else it would be a common use case, and have a nice obvious solution. Maybe it does? someone will correct me if there is.

In any case it looks like the pie menus could be more thoroughly documented. I don't think it's a bug rather a misunderstanding of how to use it. It seems mostly geared towards toggling and executing operators.

The only way I know how to suppress the index is by making a row out of the slider.

def draw(self, context):
    layout = self.layout

    mesh = context.active_object.data
    scene = context.scene

    pie = layout.menu_pie()

    row = pie.row()
    row.prop(scene.tool_settings, "normal_size")
    pie.prop(mesh, "show_normal_face")
    pie.prop(mesh, "show_normal_loop")
    pie.prop(mesh, "show_normal_vertex")
    pie.prop(mesh, "show_faces")
    pie.prop(mesh, "show_edges")

enter image description here

All kinds of crazy things can be done with piemenus

Columns

def draw(self, context):
    layout = self.layout

    mesh = context.active_object.data
    scene = context.scene

    pie = layout.menu_pie()      
    col = pie.column()
    col.prop(scene.tool_settings, "normal_size")
    col.prop(mesh, "show_normal_face")

enter image description here

Rows

def draw(self, context):
    layout = self.layout

    mesh = context.active_object.data
    scene = context.scene

    pie = layout.menu_pie()      
    row = pie.row()
    row.prop(scene.tool_settings, "normal_size")
    row = pie.row()        
    row.prop(mesh, "show_normal_face")

enter image description here

box

def draw(self, context):
    layout = self.layout

    mesh = context.active_object.data
    scene = context.scene

    pie = layout.menu_pie()

    # option 1
    box = pie.box()
    col = box.column()
    col.prop(scene.tool_settings, "normal_size")
    col.prop(mesh, "show_normal_face")
    col.prop(mesh, "show_normal_loop")
    col.prop(mesh, "show_normal_vertex")

    # option 2
    box = pie.box()
    col = box.column()
    col.prop(mesh, "show_faces")
    col.prop(mesh, "show_edges")

enter image description here

$\endgroup$
  • $\begingroup$ I feel ashamed ... Thank you so much for you help. I got the feeling as well that the Pie menu concept is not yet fully refined to work with the general interface elements! I agree that the however the Pie Menu idea is pretty nice and what you can display in it so you do not have to use the main menu. $\endgroup$ – Claas Kuhnen Jan 6 '16 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.