mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 22:50:21 +00:00
Fix annoying tooltip when using the eyedropper to copy a type
This commit is contained in:
@@ -51,8 +51,6 @@ class AssignType(bpy.types.Operator, Operator):
|
|||||||
)
|
)
|
||||||
for obj in related_objects:
|
for obj in related_objects:
|
||||||
core.assign_type(tool.Ifc, tool.Type, element=tool.Ifc.get_entity(obj), type=type)
|
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):
|
class UnassignType(bpy.types.Operator):
|
||||||
@@ -119,6 +117,7 @@ class EnableEditingType(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
context.active_object.BIMTypeProperties.is_editing_type = True
|
context.active_object.BIMTypeProperties.is_editing_type = True
|
||||||
|
context.active_object.BIMTypeProperties.relating_type_object = None
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
@@ -131,7 +130,6 @@ class DisableEditingType(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
|
obj = bpy.data.objects.get(self.obj) if self.obj else context.active_object
|
||||||
obj.BIMTypeProperties.is_editing_type = False
|
obj.BIMTypeProperties.is_editing_type = False
|
||||||
obj.BIMTypeProperties.relating_type_object = None
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,10 +52,9 @@ def update_relating_type_class(self, context):
|
|||||||
|
|
||||||
|
|
||||||
def update_relating_type_from_object(self, context):
|
def update_relating_type_from_object(self, context):
|
||||||
obj = self.relating_type_object
|
if self.relating_type_object is None:
|
||||||
if obj is None:
|
|
||||||
return
|
return
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(self.relating_type_object)
|
||||||
if not element:
|
if not element:
|
||||||
return
|
return
|
||||||
element_type = ifcopenshell.util.element.get_type(element)
|
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)
|
element_type = ifcopenshell.util.element.get_type(element)
|
||||||
if element_type is None:
|
if element_type is None:
|
||||||
return False
|
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):
|
class BIMTypeProperties(PropertyGroup):
|
||||||
|
|||||||
Reference in New Issue
Block a user