# ignore a BoolProperty from Undo?

i created a custom blender ui. i know that normally we should register multiple panel and sub-panel but i decided to do things differently.

my UI is based on bool properties, like this below

class SCATTER_AddonPref(AddonPreferences):
bl_idname = __name__

scatter_sliders_display          : BoolProperty(name="",description="",default=False)
scatter_sliders_vgroup           : BoolProperty(name="",description="",default=False)
scatter_sliders_curv_is_open     : BoolProperty(name="",description="",default=False)
scatter_proxy_is_open            : BoolProperty(name="",description="",default=False)


and this is how i use it in the ui

layout.prop(addon_prefs,'scatter_camera_is_open',text="bla category",emboss=False,icon='BLENDER')
layout.label(text="blablabla")


i think it is a really nice method. i already saw this used in many many case, but the problem as we saw in the gif is that it leave a trace in the undo history.

so is there's a way to avoid this or am i screwed ? anyhow i could ignore ctrl z with this specific property ? for example, is it possible to create an operator that will toggle thoses addon pref on/off and will not show up in the history at all ?

if i wisely use an operator that dont have 'UNDO' in its bl_option it can work easely.


class SCATTER_OT_panel_toggle(bpy.types.Operator):
bl_idname      = "scatter.test"
bl_label       = ""
bl_description = ""

pref : bpy.props.StringProperty()
def execute(self, context):
pref=self.pref