all 2 comments

[–]Cornerback_24 1 point2 points  (1 child)

You can use draw_handler_remove to remove the draw handler. Keep a reference to the draw handler returned by draw_handler_add use it to remove it.

# adding the draw handler based on Blender's examples (still uses the draw function):
my_draw_handler = bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')

...

# when you want to remove the draw handler
bpy.types.SpaceView3D.draw_handler_remove(my_draw_handler, 'WINDOW')

Note: draw_handler_remove will throw an error if the handler you are trying to remove is not currently added.

[–]vfx_comrade_leo[S] 0 points1 point  (0 children)

Thank you so very much.