2

We can use properties provided by bpy.types.Panel.layout.prop(..., toggle=True), that provides a toggle like behaviour it.

but, how to bring this toggling behaviour for buttons? There's no toggle functionality for, bpy.types.Panel.layout.row().operator(...).

mathmaniage
  • 595
  • 2
  • 6
  • 23

1 Answers1

3

An operator is not a property.

Setting the toggle behaviour for a Boolean property's layout, changes the markup to a button look, rather than a checkbox As with the checkbox it changes when setting from True to False or vice versa.

An operator layout is rendered as a button which calls the operator, rather than setting a property.

Code can be attached for when a boolean property is updated. See example here https://blender.stackexchange.com/a/147144/15543

batFINGER
  • 84,216
  • 10
  • 108
  • 233