1
$\begingroup$

I made a reusable overlay handler that just prints some text and then gets removed after n seconds, I need to remove the handler if it exists, I am currently doing this (which is horrible code I know):

name_space = bpy.app.driver_namespace
if name_space.get("overlay") is not None:
    if str(name_space["overlay"].handler).startswith('<capsule object "RNA_HANDLE"'):
        name_space["overlay"].remove_handler()

How do I sensibly find out if the value is "RNA_HANDLE" or "RNA_HANDLE_REMOVED"?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.