I write my Blender addon. And I need to redraw the panel and all panels below it in one of operator execute. So I can write
def redraw_panel():
try:
bpy.utils.unregister_class(PanelClass1)
bpy.utils.unregister_class(PanelClass2)
bpy.utils.unregister_class(PanelClass3)
except:
pass
bpy.utils.register_class(PanelClass1)
bpy.utils.register_class(PanelClass2)
bpy.utils.register_class(PanelClass3)
But so I have problems adding new panels below (I need to write register and unregister for them in above function).
Is there any other way in Blender api to redraw UI and panels in Blender?
if PanelClass1.is_registered:https://blender.stackexchange.com/a/202896/15543 Above pretty much depends on all being in sync. A tag redraw egcontext.area.tag_redraw()is a common way to tag UI for redraw, although it is often not necessary https://blender.stackexchange.com/a/182852/15543 Assume you made some changes to panel class definition before calling op above? – batFINGER Jun 17 '21 at 17:03context.area.tag_redraw()in my panel draw method? – Multifora Jun 17 '21 at 17:21