9

I create a auto setup matcap texture addon and i'd like to know if it should be possible to "require" blender to update N panel. Got a template_preview and it should be great that it refresh automaticaly. If it really not possible, is it possible to get the texture list box or did i have to create my own texture list ?

pistiwique
  • 1,106
  • 9
  • 22

1 Answers1

11

Use Region.tag_redraw on the corresponding region. The region type of the T-Panel is 'TOOLS' and the type of the N-Panel is 'UI'.

I.e.

for region in context.area.regions:
    if region.type == "UI":
        region.tag_redraw()
pink vertex
  • 9,896
  • 1
  • 25
  • 44
  • Thanks a lot for your answer. So, Just need to put "context.'UI'.tag_redraw()" at the end of my execute, Just before "return{'FINISHED'} ? – pistiwique May 11 '15 at 14:34
  • added an example – pink vertex May 15 '15 at 17:36
  • This does not work for me. My code is running in a separate thread so I used for region in bpy.context.area.regions: instead of for region in context.area.regions: but it triggers an error AttributeError: 'NoneType' object has no attribute 'regions' – Alexis.Rolland Sep 18 '21 at 05:26