How can I put a custom property into my pie menu? 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")
It appears you are right clicking view source in the custom property in the UI.  Copy data_path will give you the path,  eg. ["prop"] where the property name is prop.  In the material properties panel the rna_item will be the active material, in the object, the context.object, in the data context.object.data, in the scene context.scene etc.

The code you are seeing is setup to handle the different object types that can have a custom property.  escape_identifier most likely handles garbage property names.

The pie menu template.  A custom property "prop" has been added to the scene.  The 'rna_item' equates to context.scene, the key to "prop":

class VIEW3D_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label = "Select Mode"

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

        pie = layout.menu_pie()
        pie.prop(context.scene, '["prop"]')
        # operator_enum will just spread all available options
        # for the type enum of the operator on the pie
        pie.operator_enum("mesh.select_mode", "type")