Fix annoying tooltip when using the eyedropper to copy a type

This commit is contained in:
Gorgious56
2023-05-24 16:06:33 +02:00
parent 8bb4ab91b8
commit 604dfa8cf4
2 changed files with 4 additions and 7 deletions
@@ -51,8 +51,6 @@ class AssignType(bpy.types.Operator, Operator):
)
for obj in related_objects:
core.assign_type(tool.Ifc, tool.Type, element=tool.Ifc.get_entity(obj), type=type)
oprops = obj.BIMObjectProperties
obj.BIMTypeProperties.relating_type_object = None
class UnassignType(bpy.types.Operator):
@@ -119,6 +117,7 @@ class EnableEditingType(bpy.types.Operator):
def execute(self, context):
context.active_object.BIMTypeProperties.is_editing_type = True
context.active_object.BIMTypeProperties.relating_type_object = None
return {"FINISHED"}
@@ -131,7 +130,6 @@ class DisableEditingType(bpy.types.Operator):
def execute(self, context):
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
obj.BIMTypeProperties.is_editing_type = False
obj.BIMTypeProperties.relating_type_object = None
return {"FINISHED"}
@@ -52,10 +52,9 @@ def update_relating_type_class(self, context):
def update_relating_type_from_object(self, context):
obj = self.relating_type_object
if obj is None:
if self.relating_type_object is None:
return
element = tool.Ifc.get_entity(obj)
element = tool.Ifc.get_entity(self.relating_type_object)
if not element:
return
element_type = ifcopenshell.util.element.get_type(element)
@@ -74,7 +73,7 @@ def is_object_class_applicable(self, obj):
element_type = ifcopenshell.util.element.get_type(element)
if element_type is None:
return False
return str(element_type.is_a()) in [r_t_c[0] for r_t_c in TypeData.data["relating_type_classes"]]
return str(element_type.is_a()) in (r_t_c[0] for r_t_c in TypeData.data["relating_type_classes"])
class BIMTypeProperties(PropertyGroup):