diff options
Diffstat (limited to 'doc/python_api/examples/gpu.types.GPUOffScreen.py')
-rw-r--r-- | doc/python_api/examples/gpu.types.GPUOffScreen.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/python_api/examples/gpu.types.GPUOffScreen.py b/doc/python_api/examples/gpu.types.GPUOffScreen.py index b7f11b94a11..4f601ee7ef1 100644 --- a/doc/python_api/examples/gpu.types.GPUOffScreen.py +++ b/doc/python_api/examples/gpu.types.GPUOffScreen.py @@ -241,8 +241,11 @@ class VIEW3D_OT_draw_offscreen(bpy.types.Operator): def register(): - if hasattr(bpy.types, "VIEW3D_OT_draw_offscreen"): - del VIEW3D_OT_draw_offscreen.global_shader + try: + cls = getattr(bpy.types, "VIEW3D_OT_draw_offscreen") + del cls.global_shader + except: + pass shader = gpu.types.GPUShader(g_imageVertSrc, g_imageFragSrc) VIEW3D_OT_draw_offscreen.global_shader = shader |