Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. import bpy
  2. from bpy.types import Menu
  3.  
  4. class VIEW3D_PIE_SV_ops(bpy.types.Operator):
  5.  
  6. bl_idname = "nodes.pie_menu_enum"
  7. bl_label = "Add Quick Node"
  8.  
  9. mode_options = [
  10. ("option1", "option1", "", "CURVE_DATA", 0),
  11. ("option2", "option2", "", "", 1),
  12. ("option3", "option3", "", "", 2)
  13. ]
  14.  
  15. selected_mode = bpy.props.EnumProperty(
  16. items=mode_options,
  17. description="offers....",
  18. default="option1"
  19. )
  20.  
  21. def execute(self, context):
  22. print('added ', self.selected_mode)
  23. return {'FINISHED'}
  24.  
  25.  
  26. class VIEW3D_PIE_template(Menu):
  27. # label is displayed at the center of the pie menu.
  28. bl_label = "Select Mode"
  29.  
  30. def draw(self, context):
  31. layout = self.layout
  32. pie = layout.menu_pie()
  33. pie.operator_enum("nodes.pie_menu_enum", "selected_mode")
  34.  
  35.  
  36. def register():
  37. bpy.utils.register_module(__name__)
  38.  
  39. def unregister():
  40. bpy.utils.unregister_module(__name__)
  41.  
  42. if __name__ == "__main__":
  43. register()
  44.  
  45. bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement