Say I have a property set on a scene, like so:
bpy.types.Scene.is_enabled = bpy.props.BoolProperty(default=False)
Then I've got a panel like the following:
class SomePanel(bpy.types.Panel): bl_idname = "the_panel" bl_label = "Panel with some controls" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "object" def draw(self, context): layout = self.layout scene = context.scene layout.prop(scene, "is_enabled")
Now what I would like to do is to render an operator or some other control in the panel only if the property of scene
is_enabled is set to true?
How can I do that?