mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Figured a new way to update viewport to preview changes in ifc text
This commit is contained in:
@@ -1364,11 +1364,7 @@ class DisableEditingText(bpy.types.Operator, Operator):
|
||||
|
||||
# force update this object's font size for viewport display
|
||||
DecoratorData.data.pop(context.object.name, None)
|
||||
|
||||
# TODO: just needed some way to trigger UI update
|
||||
# probably there is more proper way to do it
|
||||
props = context.object.BIMTextProperties
|
||||
props.font_size = props.font_size
|
||||
tool.Blender.update_viewport()
|
||||
|
||||
|
||||
class EditAssignedProduct(bpy.types.Operator, Operator):
|
||||
|
||||
@@ -80,6 +80,7 @@ def set_active_object(cls, obj): pass
|
||||
def apply_bmesh(cls, mesh, bm): pass
|
||||
def get_bmesh_for_mesh(cls, mesh, clean=False): pass
|
||||
def get_viewport_context(cls): pass
|
||||
def update_viewport(cls): pass
|
||||
|
||||
|
||||
@interface
|
||||
|
||||
@@ -143,4 +143,12 @@ class Blender:
|
||||
"""
|
||||
area = next(area for area in bpy.context.screen.areas if area.type == "VIEW_3D")
|
||||
context_override = {"area": area}
|
||||
return context_override
|
||||
return context_override
|
||||
|
||||
@classmethod
|
||||
def update_viewport(cls):
|
||||
# if it stops working in future Blender versions
|
||||
# there is an alternative:
|
||||
# bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
|
||||
|
||||
tool.Blender.get_viewport_context()['area'].tag_redraw()
|
||||
Reference in New Issue
Block a user