1
$\begingroup$

I've designed a modal operator that changes the geometry of a mesh when the user clicks and drags the mouse. I'm able to see the geometry update in the viewport I'm dragging in by tagging a redraw with

    def modal(self, context, event):
        context.area.tag_redraw()

However, this does not affect other viewports so I cannot see the updated geometry in any other viewport until I finish my operator and mouseover the other viewport. Is there any way to tell Blender to updates those viewports right away?

$\endgroup$
1
  • 1
    $\begingroup$ may find a Mesh.update() has the same effect. $\endgroup$
    – batFINGER
    Feb 9, 2021 at 15:42

1 Answer 1

3
$\begingroup$

You can iterate through all areas of the screen and tag them:

def modal(self, context, event):
    for area in context.screen.areas: 
        if area.type == 'VIEW_3D':
            area.tag_redraw()
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .