From 598dfd75e77acd8536f8824aca590b723a51a32c Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 22 Apr 2025 17:25:34 +0500 Subject: [PATCH] bim.override_origin_set - use operator_enum for menu --- src/bonsai/bonsai/bim/module/geometry/ui.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/geometry/ui.py b/src/bonsai/bonsai/bim/module/geometry/ui.py index 113a8fada9..f15e885fbf 100644 --- a/src/bonsai/bonsai/bim/module/geometry/ui.py +++ b/src/bonsai/bonsai/bim/module/geometry/ui.py @@ -97,21 +97,9 @@ class BIM_MT_object_set_origin(Menu): bl_label = "IFC Set Origin" def draw(self, context): - self.layout.operator("bim.override_origin_set", icon="PLUGIN", text="IFC Geometry to Origin").origin_type = ( - "GEOMETRY_ORIGIN" - ) - self.layout.operator("bim.override_origin_set", icon="PLUGIN", text="IFC Origin to Geometry").origin_type = ( - "ORIGIN_GEOMETRY" - ) - self.layout.operator("bim.override_origin_set", icon="PLUGIN", text="IFC Origin to 3D Cursor").origin_type = ( - "ORIGIN_CURSOR" - ) - self.layout.operator( - "bim.override_origin_set", icon="PLUGIN", text="IFC Origin to Center of Mass (Surface)" - ).origin_type = "ORIGIN_CENTER_OF_MASS" - self.layout.operator( - "bim.override_origin_set", icon="PLUGIN", text="IFC Origin to Center of Mass (Volume)" - ).origin_type = "ORIGIN_CENTER_OF_VOLUME" + assert self.layout + self.layout.label(text="IFC Set Origin", icon_value=bonsai.bim.icons["IFC"].icon_id) + self.layout.operator_enum("bim.override_origin_set", property="origin_type") def outliner_menu(self, context):