I have defined a scene prop like this:
bpy.types.Scene.my_orientation = bpy.props.EnumProperty(items = (('1',"X+","Change the slope orientation"),
('2',"Y+","Change the slope orientation"),
('3',"X-","Change the slope orientation"),
('4',"Y-","Change the slope orientation")),
name="Orientation",
description="Orientation")
Then, I use the prop in a panel with this code:
row.prop(scene,"my_orientation")
I have done something like this for pie menu using the template provided by Blender:
import bpy
from bpy.types import Menu, Operator
from bpy.props import EnumProperty
class VIEW3D_PIE_template(Menu):
# label is displayed at the center of the pie menu.
bl_label = "my pie"
def draw(self, context):
layout = self.layout
pie = layout.menu_pie()
pie.operator_enum("my_orientation") # <<<< This line is not working, why?????
def register():
bpy.utils.register_class(VIEW3D_PIE_template)
def unregister():
bpy.utils.unregister_class(VIEW3D_PIE_template)
if __name__ == "__main__":
register()
bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")
What is wrong? I have no options in the pie menu