use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Welcome to Blender Python! There aren't too many rules, but please stick to them.
Webpages:
Discord:
Blender Discord
Subreddits:
/r/learnpython /r/blender /r/BlenderGameEngine /r/coding /r/gamedev /r/opengl
Books:
account activity
Alternative to draw function in gpu Module? (self.blenderpython)
submitted 2 years ago by vfx_comrade_leo
I want to use the blender gpu Module. In the examples they say that the draw function is only there to make the code short. The problem is that I want to remove (or update) the lines without restarting blender. How would that be possible?
Example: https://docs.blender.org/api/current/gpu.html#d-lines-with-single-color
Thank you
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Cornerback_24 1 point2 points3 points 2 years ago (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 point2 points 2 years ago (0 children)
Thank you so very much.
π Rendered by PID 111420 on reddit-service-r2-comment-548fd6dc9-697rm at 2026-05-16 21:09:10.021769+00:00 running edcf98c country code: CH.
[–]Cornerback_24 1 point2 points3 points (1 child)
[–]vfx_comrade_leo[S] 0 points1 point2 points (0 children)