@@ -1664,12 +1664,16 @@ def execute(self, context):
16641664 return {"FINISHED" }
16651665
16661666 def toggle_wireframe (self , link : "Link" ) -> None :
1667+ linked_collections = self .get_linked_collections ()
1668+
16671669 link .is_wireframe = not link .is_wireframe
16681670 display_type = "WIRE" if link .is_wireframe else "TEXTURED"
1669- for collection in self . get_linked_collections () :
1671+ for collection in linked_collections :
16701672 objs = filter (lambda obj : "IfcOpeningElement" not in obj .name , collection .all_objects )
16711673 for obj in objs :
16721674 obj .display_type = display_type
1675+ if handle := tool .Project .get_link_empty_handle (link ):
1676+ handle .display_type = display_type
16731677
16741678 def toggle_visibility (self , link : "Link" ) -> None :
16751679 linked_collections = self .get_linked_collections ()
@@ -1746,15 +1750,14 @@ def _execute(self, context):
17461750
17471751 # obj_matrix is typically calculated as:
17481752 # obj_matrix = np.linalg.inv(local_matrix) @ transformation @ global_matrix
1749- # So let's calculate the transformation
1750-
1751- transformed_global_matrix = local_matrix @ np .array (new_obj_matrix )
1752- transformation = transformed_global_matrix @ np .linalg .inv (global_matrix )
1753- if np .allclose (transformation , np .eye (4 )):
1754- link .has_transformation = True
1753+ identity_blender_matrix = np .linalg .inv (local_matrix ) @ global_matrix
1754+ if np .allclose (np .array (new_obj_matrix ), identity_blender_matrix , atol = 1e-5 ):
1755+ link .has_transformation = False
17551756 transformation = "," .join (map (str , np .eye (4 ).reshape (- 1 )))
17561757 else :
1757- link .has_transformation = False
1758+ transformed_global_matrix = local_matrix @ np .array (new_obj_matrix )
1759+ transformation = transformed_global_matrix @ np .linalg .inv (global_matrix )
1760+ link .has_transformation = True
17581761 transformation = "," .join (map (str , transformation .reshape (- 1 )))
17591762
17601763 if tool .Ifc .get ():
0 commit comments