mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Fixed #2900
1) Leaders text decorator wasn't changed after adding support for multiple literals 2) added drawing data update on toggling viewport annotations - so user would see correct values right away; also fixed similar thing on updating product
This commit is contained in:
@@ -803,7 +803,12 @@ class LeaderDecorator(BaseDecorator):
|
||||
region3d = context.region_data
|
||||
dir = Vector((1, 0))
|
||||
pos = location_3d_to_region_2d(region, region3d, self.get_spline_end(obj))
|
||||
self.draw_label(context, obj.BIMTextProperties.value, pos, dir, gap=0, center=False, vcenter=False)
|
||||
|
||||
props = obj.BIMTextProperties
|
||||
text_data = props.get_text_edited_data() if props.is_editing else DecoratorData.get_ifc_text_data(obj)
|
||||
text = text_data["Literals"][0]['CurrentValue']
|
||||
|
||||
self.draw_label(context, text, pos, dir, gap=0, center=False, vcenter=False)
|
||||
|
||||
|
||||
class RadiusDecorator(BaseDecorator):
|
||||
|
||||
@@ -1357,6 +1357,7 @@ class EditAssignedProduct(bpy.types.Operator, Operator):
|
||||
if context.active_object.BIMAssignedProductProperties.relating_product:
|
||||
product = tool.Ifc.get_entity(context.active_object.BIMAssignedProductProperties.relating_product)
|
||||
core.edit_assigned_product(tool.Ifc, tool.Drawing, obj=context.active_object, product=product)
|
||||
tool.Blender.update_viewport()
|
||||
|
||||
|
||||
class EnableEditingAssignedProduct(bpy.types.Operator, Operator):
|
||||
|
||||
@@ -26,6 +26,7 @@ import blenderbim.core.drawing as core
|
||||
import blenderbim.bim.module.drawing.annotation as annotation
|
||||
import blenderbim.bim.module.drawing.decoration as decoration
|
||||
from blenderbim.bim.module.drawing.data import DrawingsData, DecoratorData
|
||||
from blenderbim.bim.module.drawing.data import refresh as refresh_drawing_data
|
||||
from pathlib import Path
|
||||
from blenderbim.bim.prop import Attribute, StrProperty
|
||||
from bpy.types import PropertyGroup
|
||||
@@ -213,6 +214,7 @@ def toggleDecorations(self, context):
|
||||
collection = context.scene.camera.users_collection[0]
|
||||
for obj in collection.objects:
|
||||
tool.Drawing.update_text_value(obj)
|
||||
refresh_drawing_data()
|
||||
decoration.DecorationsHandler.install(context)
|
||||
else:
|
||||
decoration.DecorationsHandler.uninstall()
|
||||
|
||||
Reference in New Issue
Block a user