tweaked active operator

This commit is contained in:
Ryan Schultz
2024-10-26 14:22:18 -05:00
parent db075c7160
commit cc90340b3b
+7 -5
View File
@@ -104,8 +104,8 @@ def draw_psetqto_ui(
) -> None:
select_similar_op = context.active_operator
calculated_sum = getattr(select_similar_op, "calculated_sum", 0.0)
active_operator = context.active_operator
filter_keyword = filter_keyword.lower()
box = layout.box()
@@ -201,9 +201,11 @@ def draw_psetqto_ui(
op = row.operator("bim.select_similar", text=nominal_value, icon="NONE", emboss=False)
op.key = '"' + pset["Name"].replace('"', '\\"') + '"."' + prop["Name"].replace('"', '\\"') + '"'
# calculate sum of all selected objects
if select_similar_op:
if op.key == select_similar_op.key and calculated_sum != 0 and isinstance(float(nominal_value), (int, float)):
row.label(text=f"(Sum: {calculated_sum})")
if active_operator:
if active_operator.bl_idname == "BIM_OT_select_similar":
calculated_sum = getattr(active_operator, "calculated_sum", 0.0)
if op.key == active_operator.key and calculated_sum != 0 and isinstance(float(nominal_value), (int, float)):
row.label(text=f"(Sum: {calculated_sum})")
if not has_props_displayed:
row = box.row()
row.scale_y = 0.8