I have an addon with awkward complicated work flows. My users frequently get frustrated. Until I can fix that fundamental problem, I would like to make a little floating "wizard" which attempts to guide them along by assesing custom blend data related to my addon. I have some loose ideas that I will be trying (outlined below). Any tips or hints greatly appreciated.
The user will have to initiate or stop the "wizard" with an operator, because the wizard will need to access blend data, doing this at Addon registration will not work.
The operator will add a persistent 'scene_update_post' app handler. This persistent function which will asses the custom data and blend file data, and generate some "helpful" instructions whenever the scene updates. These instructions will be stored as text data as a global at the "help.py" module level.
The operator will register a draw callback, which parses and displays the text data generated by the persistent app handler.
When unregistering the addon, it will check for the existence of the app_handler and the draw_callback and unregister them
How to manage Handlers in an add-on?
There will be a "close help" operator which manually removes those handlers.
class MY_ADDON_OT_interactive_help(bpy.types.Operator): ''' add gui help ''' bl_idname='my_addon.start_help' bl_label="Start Helper Wizard" @classmethod def poll(cls, context): if not hasattr(context.scene, 'my_addon_props'): return False return True def execute(self, context): #add a app handler to asses info #add draw callback to display info global help_app_handle help_app_handle = bpy.app.handlers.scene_update_pre.append(my_addon_help_parser) global help_draw_handle help_draw_handle = bpy.types.SpaceView3D.draw_handler_add(my_addon_help_draw, (self, context), 'WINDOW', 'POST_PIXEL') return {'FINISHED'}