Optimise object placement change checking, so medium sized project exports are 5 seconds faster at minimum, but can be much higher since false positives are culled.

This commit is contained in:
Dion Moult
2021-11-11 17:31:16 +11:00
parent f5f88f4b97
commit 6f55cd5169
8 changed files with 46 additions and 27 deletions
@@ -18,6 +18,7 @@
import bpy
import logging
import numpy as np
import ifcopenshell
import blenderbim.core.tool
import blenderbim.core.style
@@ -223,6 +224,12 @@ class Geometry(blenderbim.core.tool.Geometry):
def link(cls, element, obj):
obj.BIMMeshProperties.ifc_definition_id = element.id()
@classmethod
def record_object_position(cls, obj):
# These are recorded separately because they have different numerical tolerances
obj.BIMObjectProperties.location_checksum = repr(np.array(obj.matrix_world.translation).tobytes())
obj.BIMObjectProperties.rotation_checksum = repr(np.array(obj.matrix_world.to_3x3()).tobytes())
@classmethod
def rename_object(cls, obj, name):
obj.name = name