I made a new panel in the N bar that contains a boolean property for which I put an update function, but after adding a debug line at the top of this function I can tell it's never called when I click my checkbox.
It's the first time I'm doing this so I don't know if I'm doing it right but for me so it seems, everything else is working fine...
To avoid more explanations, here is the structure of the key parts of my code:
import bpy
class MyPanel(bpy.types.Panel):
bl_label = "My Panel"
bl_idname = "OBJECT_PT_my_panel"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
def draw(self, context):
my_props = context.scene.my_props
self.layout.prop(my_props, 'my_bool')
def my_func(self, context):
# some stuff that's never done
print("Running update function")
class MyProperties(bpy.types.PropertyGroup):
my_bool = bpy.props.BoolProperty(update=my_func)
def register():
bpy.utils.register_class(MyProperties)
bpy.types.Scene.my_props = bpy.props.PointerProperty(type=MyProperties)
bpy.utils.register_class(MyPanel)
if __name__ == "__main__":
register()