This commit is contained in:
Andrej730
2024-05-31 18:02:20 +05:00
parent c05abc4d5b
commit 162e66b775
5 changed files with 47 additions and 27 deletions
+3 -3
View File
@@ -1703,18 +1703,18 @@ class IfcImporter:
self.type_collection.children.link(aggregate["collection"])
continue
def create_materials(self):
def create_materials(self) -> None:
for material in self.file.by_type("IfcMaterial"):
self.create_material(material)
def create_material(self, material):
def create_material(self, material: ifcopenshell.entity_instance) -> bpy.types.Material:
blender_material = bpy.data.materials.new(material.Name)
self.link_element(material, blender_material)
self.material_creator.materials[material.id()] = blender_material
blender_material.use_fake_user = True
return blender_material
def create_styles(self):
def create_styles(self) -> None:
parsed_styles = set()
for material_definition_representation in self.file.by_type("IfcMaterialDefinitionRepresentation"):
@@ -40,6 +40,7 @@ from mathutils import Vector, Matrix
from time import time
from blenderbim.bim.ifc import IfcStore
from ifcopenshell.util.shape_builder import ShapeBuilder
from typing import Any
class Operator:
@@ -729,7 +730,7 @@ class OverrideOutlinerDelete(bpy.types.Operator):
IfcStore.add_transaction_operation(self)
return {"FINISHED"}
def get_collection_objects_and_children(self, collection):
def get_collection_objects_and_children(self, collection: bpy.types.Collection) -> dict[str, Any]:
objects = set()
children = set()
queue = [collection]
@@ -21,6 +21,7 @@ import bmesh
import json
import ifcopenshell.api
import ifcopenshell.util.element
import blenderbim.core.tool
import blenderbim.tool as tool
import blenderbim.bim
import addon_utils