I’m wondering how to disable, for instance, a checkbox (bpy.props.BoolProperty) in a custom panel coded in Python. To provide a minimal example, lets consider the following Add-On:
bl_info = { "name": "Testing environment",
"author": "Pieter Barendrecht",
"version": (1, 0),
"blender": (2, 5, 0),
"location": "",
"description": "Minimal example to test some layout properties.",
"warning": "Completely useless for other purposes!",
"wiki_url": "",
"tracker_url": "",
"category": "Mesh"}
import bpy
class TestPanel(bpy.types.Panel):
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "physics"
bl_label = "Test 123"
bpy.types.Scene.TestCheckbox = bpy.props.BoolProperty(
name = "Some Boolean property",
description = "Enable me! Enable me!",
default = False)
def draw(self, context):
Column = self.layout.column(align = True)
Column.prop(context.scene, "TestCheckbox")
def register():
bpy.utils.register_class(TestPanel)
if __name__ == "__main__" :
register()
How can I disable the TestCheckbox component in this panel (or make it inactive, that would also be acceptable)? Disabling an entire column at once can be done using
Column.enabled = False
which really disables the column, whereas using
Column.active = False
just results in a greyed-out column.