WIP refactor mesh UI into geometry module and minor fixes. See #1222.

This commit is contained in:
Dion Moult
2021-01-06 10:28:22 +11:00
parent c4aecd6e61
commit 8eb9973045
9 changed files with 101 additions and 157 deletions
@@ -3,19 +3,21 @@ from blenderbim.bim.ifc import IfcStore
class Data:
products = {}
representations = {}
@classmethod
def load(cls, product_id):
file = IfcStore.get_file()
if not file:
return
cls.products[product_id] = {"Representations": {}}
cls.products[product_id] = []
product = file.by_id(product_id)
if not product.Representation:
return
for representation in product.Representation.Representations:
c = representation.ContextOfItems
cls.products[product_id]["Representations"][int(representation.id())] = {
rep_id = int(representation.id())
cls.representations[rep_id] = {
"RepresentationIdentifier": representation.RepresentationIdentifier,
"RepresentationType": representation.RepresentationType,
"ContextOfItems": {
@@ -24,3 +26,4 @@ class Data:
"TargetView": c.TargetView if c.is_a("IfcGeometricRepresentationSubContext") else "",
}
}
cls.products[product_id].append(rep_id)