0
$\begingroup$

I'm writing a new add-on for the masking. I tried hard to find how to update/redraw the Image Editor or Movieclip Editor, but I didn't find helpful information. I share my test code below. If you try the code, you might detect the selecting state (of the Mask Points) doesn't update or redraw. If you find anything useful, please share with me. Thank you for your help.

NOTE::In the scripting workspace, switch the 3D viewport to the Image Editor or Movieclip in the Mask mode. You might need to change the index of areas[index] to make it work.

import bpy
area = bpy.context.screen.areas[5]
region = bpy.context.screen.areas[5].regions[5]
space = area.spaces.active
spline = space.mask.layers.active.splines.active
for id, p in enumerate(spline.points):
    p.select = True
space.mask.update_tag()

for area in bpy.context.screen.areas:
    if area.ui_type == "IMAGE_EDITOR":
        for region in area.regions:
            region.tag_redraw()
        
for area in bpy.context.window.screen.areas:
    if area.type == 'IMAGE_EDITOR':
        area.tag_redraw()
    
for area in bpy.context.screen.areas:
    if area.ui_type == "CLIP_EDITOR":
        for region in area.regions:
        region.tag_redraw()
        
for area in bpy.context.window.screen.areas:
    if area.type == 'CLIP_EDITOR':
        area.tag_redraw()
$\endgroup$

0

You must log in to answer this question.