I want to know how to disable a row in the layout. For example, the row "row.prop(scene.āframe_startā) , how do i enable or disable it once some event has occurred (like the button being pressed).
Thanks for you help. Is it possible to grey out the label instead of not showing it. I want to use this in a project i am working on and want to show that a input is not longer needed, hence grey out the value and donāt allow edit
Does this same process work for layout.prop as it does for row.label
I defined a variable as you suggested:
bpy.types.Scene.spacingUniform = BoolProperty(name=āspacingFlagā, default = False)
Then used it in the script:
print("context.scene.spacingUniform = ",context.scene.spacingUniform)
row.enabled = context.scene.spacingUniform
layout.prop(myTool,āSpacingā,text=āSpacing between Objectsā)
the value of spacingUniform changes but has no effect on the display.
It does, but what youāve done is disabled the row, not the layout, which are two different things. if it were instead:
row.prop(myTool,"Spacing",text="Spacing between Objects")
ā¦then that row would have been disabled. If it were a box, you would have to disable the box. If it were a column, you would disable the column, etc.
This is an example of the relationships between the layout elements.
row = layout.row() row.prop(myTool,"UniformSpacing",text="Spacing between Objects")
just gives me a check box (which does become enabled/disabled). So how do i create a box with the spacing value that can be enabled/disabled? Sorry to sound so stupid, but iām new to this
Iām sorry, Ithink I misunderstood what youāre trying to do. So you want a checkbox for your spacingUniform property that enable/disables the row? Then going back to this:
I defined a variable as you suggested:
bpy.types.Scene.spacingUniform = BoolProperty(name=āspacingFlagā, default = False)
Then used it in the script:
print("context.scene.spacingUniform = ",context.scene.spacingUniform)
row.enabled = context.scene.spacingUniform
layout.prop(myTool,āSpacingā,text=āSpacing between Objectsā)# is this supposed to be the spacingUniform property?
layout.prop(scene, 'spacingUniform')
ā¦ would create a checkbox that affect the row.enabled. Is that what youāre layout.prop is supposed to be?