Panel Property OnChange

I’m trying to create a panel with some float values which, when you change them by sliding continuously, update the model. It doesn’t matter where the panel is, be it the ‘T’ or ‘N’ sidebars or a tab of Properties. The tutorial shows you how to create the panel, and later mentions that the “execute” function does this, yet its example doesn’t demonstrate this with a panel. I’m in the groping in the dark trying to combine it with the first example and still have the panel properties work.

It’s the same thing as when you create e.g. a cylinder or cone, and change the number of segments and rings. You don’t need to click a button after doing so for it to reflect in the model.

Searches for the topic reveal others who’ve asked it bring up oddly inconclusive responses; I don’t see where in add_mesh_torus.py it does such a thing. If it does and someone could point what to copy from it, that might help.

Thanks.

I could be wrong here but do you simply want to use the update function on the float property? So for example if your panel is displaying a float property (the one thing missing from the example tutorial you linked is a property member of the operator such as: https://www.blender.org/api/blender_python_api_2_57_release/bpy.types.Operator.html) you would have the update function force an update of the mesh/redraw/etc.

I see some IntProperty()s there, no mention of the word “Update” (nor on a Google search). Have an example?

https://www.blender.org/api/blender_python_api_current/bpy.props.html#update-example

That’s the ticket.

For posterity, you add “update=<function name>” to the property’s parameters.