From fefda94153c57d19730cd009cf0e29ad26c2542f Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 28 Jul 2023 17:42:41 +1000 Subject: [PATCH] Revert "Example of UI if we sentence-cased IFC classes. Good or bad? Please comment at https://community.osarch.org/discussion/comment/16493" This reverts commit 53bd4bf5ea91d18b678a1aeab4a02cc67b994dac. --- src/blenderbim/blenderbim/bim/helper.py | 6 ------ src/blenderbim/blenderbim/bim/module/root/data.py | 8 +++----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/helper.py b/src/blenderbim/blenderbim/bim/helper.py index b062aeb552..5b73dadd2a 100644 --- a/src/blenderbim/blenderbim/bim/helper.py +++ b/src/blenderbim/blenderbim/bim/helper.py @@ -17,7 +17,6 @@ # along with BlenderBIM Add-on. If not, see . # from datetime import date -import re import bpy import json import math @@ -32,11 +31,6 @@ import blenderbim.tool as tool from blenderbim.bim.ifc import IfcStore -def uncamel(s): - s = re.sub('([a-z0-9])([A-Z])', r'\1 \2', s[3:] if s.startswith("Ifc") else s) - return re.sub('([A-Z])([A-Z][a-z])', r'\1 \2', s) - - def draw_attributes(props, layout, copy_operator=None, popup_active_attribute=None): """you can set attribute active in popup with `active_attribute` meaning you will be able to type into attribute's field without having to click diff --git a/src/blenderbim/blenderbim/bim/module/root/data.py b/src/blenderbim/blenderbim/bim/module/root/data.py index 07b107d51e..1efb72b543 100644 --- a/src/blenderbim/blenderbim/bim/module/root/data.py +++ b/src/blenderbim/blenderbim/bim/module/root/data.py @@ -21,7 +21,6 @@ import bpy import ifcopenshell.util.element from ifcopenshell.util.doc import get_entity_doc, get_predefined_type_doc, get_class_suggestions import blenderbim.tool as tool -import blenderbim.bim.helper from blenderbim.bim.ifc import IfcStore @@ -71,7 +70,7 @@ class IfcClassData: "IfcAnnotation", "IfcRelSpaceBoundary", ] - return [(e, blenderbim.bim.helper.uncamel(e), (get_entity_doc(version, e) or {}).get("description", "")) for e in products] + return [(e, e, (get_entity_doc(version, e) or {}).get("description", "")) for e in products] @classmethod def ifc_classes(cls): @@ -89,7 +88,7 @@ class IfcClassData: # Yeah, weird isn't it. names.remove("IfcOpeningStandardCase") version = tool.Ifc.get_schema() - return [(c, blenderbim.bim.helper.uncamel(c), (get_entity_doc(version, c) or {}).get("description", "")) for c in sorted(names)] + return [(c, c, (get_entity_doc(version, c) or {}).get("description", "")) for c in sorted(names)] @classmethod def ifc_predefined_types(cls): @@ -158,10 +157,9 @@ class IfcClassData: if not element: return name = element.is_a() - name = blenderbim.bim.helper.uncamel(name) predefined_type = ifcopenshell.util.element.get_predefined_type(element) if predefined_type: - name += f" [{predefined_type}]" + name += f"[{predefined_type}]" return name @classmethod