I'm playing around with pie menus in blender. I used the default pie menu template and customized it to suit. But now I have four custom properties on a model and I want to edit them with the pie menu. I followed along one of Sebastians Konig's tutorials but he only used very basic tools like smooth shading etc. He simply right clicked > edit source, but doing that on my custom shaders takes me to this:
row.prop(rna_item, '["%s"]' % escape_identifier(key), text="")
And doing that to any of my custom properties leads me to the same place. How can I access the custom properties and put them into my pie menu?
Here is my code:
import bpy
from bpy.types import Menu
# spawn an edit mode selection pie (run while object is in edit mode to get a valid output)
class VIEW3D_PIE_template(Menu):
# label is displayed at the center of the pie menu.
bl_label = "Macbook Controller"
bl_idname = "Object Mode.mc_pie_menu"
def draw(self, context):
layout = self.layout
pie = layout.menu_pie()
# operator_enum will just spread all available options
# for the type enum of the operator on the pie
pie.prop(context.object.data, '["00_iSight Camera Indicator"]', text="iSight Camera Indicator Toggle")
def register():
bpy.utils.register_class(VIEW3D_PIE_template)
wm = bpy.context.window_manager
km = wm.keyconfigs.addon.keymaps.new(name = "Object Mode")
kmi = km.keymap_items.new("wm.call_menu_pie", "E", "PRESS").properties.name = "Object Mode.mc_pie_menu"
def unregister():
bpy.utils.unregister_class(VIEW3D_PIE_template)
if __name__ == "__main__":
register()
#bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")