Fix bug where assigning a new container would shift object placements incorrectly due to SI unit conversion

This commit is contained in:
Dion Moult
2021-09-17 17:13:20 +10:00
parent 2b82eaf019
commit 3eb7c7a6a1
3 changed files with 80 additions and 2 deletions
@@ -13,7 +13,6 @@ class Usecase:
self.settings[key] = value
def execute(self):
print('EXECUTING', self.settings["product"])
if not hasattr(self.settings["product"], "ObjectPlacement"):
return
self.unit_scale = ifcopenshell.util.unit.calculate_unit_scale(self.file)
@@ -25,7 +24,6 @@ class Usecase:
children_settings = []
if not self.settings["should_transform_children"]:
print("THIS IS RUNNING")
children_settings = self.get_children_settings(self.settings["product"].ObjectPlacement)
placement_rel_to = self.get_placement_rel_to()
@@ -51,4 +51,5 @@ class Usecase:
self.file,
product=self.settings["product"],
matrix=ifcopenshell.util.placement.get_local_placement(self.settings["product"].ObjectPlacement),
is_si=False,
)