mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
Fix manual section/elevation annotation placement in non-plan views
Use get_default_annotation_matrix() for manual SECTION annotations so the object is placed in the camera's annotation plane with the correct rotation, matching how auto-generated section annotations are created. Without this, annotations placed in elevation or section camera views had identity rotation, causing the IFC representation to be in the wrong coordinate system and failing to tessellate. Also guard draw_edit_object_interface against non-IFC active objects to prevent AssertionError during toolbar redraws, and skip IFC item edit mode for ELEVATION/SECTION annotation types on placement.
This commit is contained in:
@@ -1898,7 +1898,10 @@ class AddAnnotation(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
drawing=drawing,
|
drawing=drawing,
|
||||||
object_type=props.object_type,
|
object_type=props.object_type,
|
||||||
relating_type=tool.Ifc.get().by_id(int(props.relating_type_id)) if props.relating_type_id != "0" else None,
|
relating_type=tool.Ifc.get().by_id(int(props.relating_type_id)) if props.relating_type_id != "0" else None,
|
||||||
enable_editing=True,
|
# ELEVATION/SECTION annotations use simple empty/line geometry that
|
||||||
|
# cannot be tessellated by the IFC geometry engine, so skip IFC
|
||||||
|
# item edit mode for these types.
|
||||||
|
enable_editing=object_type not in ("ELEVATION", "SECTION"),
|
||||||
)
|
)
|
||||||
if props.object_type == "IMAGE":
|
if props.object_type == "IMAGE":
|
||||||
bpy.ops.bim.add_reference_image("INVOKE_DEFAULT", existing_object_by_name=obj.name)
|
bpy.ops.bim.add_reference_image("INVOKE_DEFAULT", existing_object_by_name=obj.name)
|
||||||
|
|||||||
@@ -230,7 +230,8 @@ class AnnotationToolUI:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def draw_edit_object_interface(cls, context):
|
def draw_edit_object_interface(cls, context):
|
||||||
if DecoratorData.get_text_data(bpy.context.active_object):
|
obj = bpy.context.active_object
|
||||||
|
if tool.Ifc.get_entity(obj) and DecoratorData.get_text_data(obj):
|
||||||
add_layout_hotkey_operator(cls.layout, "Edit Text", "S_E", "")
|
add_layout_hotkey_operator(cls.layout, "Edit Text", "S_E", "")
|
||||||
if bpy.ops.bim.copy_annotation_to_drawing.poll():
|
if bpy.ops.bim.copy_annotation_to_drawing.poll():
|
||||||
row = cls.layout.row(align=True)
|
row = cls.layout.row(align=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user