gpu.types.GPUOffscreen.py example file: Delete the reference of the previous shader.
Strange that the `bpy.utils.register_class` utility does not remove the reference of the class with same name.
This commit is contained in:
parent
d2a491da5f
commit
964bb28e21
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user