mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +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
|
# force update this object's font size for viewport display
|
||||||
DecoratorData.data.pop(context.object.name, None)
|
DecoratorData.data.pop(context.object.name, None)
|
||||||
|
tool.Blender.update_viewport()
|
||||||
# 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
|
|
||||||
|
|
||||||
|
|
||||||
class EditAssignedProduct(bpy.types.Operator, Operator):
|
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 apply_bmesh(cls, mesh, bm): pass
|
||||||
def get_bmesh_for_mesh(cls, mesh, clean=False): pass
|
def get_bmesh_for_mesh(cls, mesh, clean=False): pass
|
||||||
def get_viewport_context(cls): pass
|
def get_viewport_context(cls): pass
|
||||||
|
def update_viewport(cls): pass
|
||||||
|
|
||||||
|
|
||||||
@interface
|
@interface
|
||||||
|
|||||||
@@ -144,3 +144,11 @@ class Blender:
|
|||||||
area = next(area for area in bpy.context.screen.areas if area.type == "VIEW_3D")
|
area = next(area for area in bpy.context.screen.areas if area.type == "VIEW_3D")
|
||||||
context_override = {"area": area}
|
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