How to set in a panel ThemeGradientColors.show_grad using python

Hi,

I want add the option to enable or disable the gradient in 3dView to a panel to avoid open User preferences each time.

I have seen that the property is: ThemeGradientColors.show_grad=True/False

I have tried in the following context, but I cannot get this property.

bpy.context.user_preferences.themes[0].view_3d.???

Any idea

bpy.context.user_preferences.themes[0].view_3d.space.gradients.show_grad

From python console works, but I have one question more…How can I add this checkbox to a panel?

…something like this:

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


        row = layout.row()
        row.prop(context.space_data, "show_only_render", text="Hide controllers")
row.prop(context.user_preferences.themes[0].view_3d.space,"gradients.show_grad", text="Gradient") ?????


Dang close


row.prop(context.user_preferences.themes[0].view_3d.space.gradients, "show_grad", text="Gradient")

Thanks! :slight_smile: