This commit is contained in:
Andrej730
2024-12-23 11:35:48 +05:00
parent 6dfb25862c
commit 170b6fc67e
5 changed files with 38 additions and 104 deletions
@@ -1521,17 +1521,20 @@ class LoadLinkedProject(bpy.types.Operator):
)
self.meshes = {}
self.blender_mats = {}
blender_mats = {}
blender_mats: dict[tuple[float, float, float, float], bpy.types.Material] = {}
default_mat = np.array([[1, 1, 1, 1]], dtype=np.float32)
chunked_guids = []
chunked_guid_ids = []
chunked_verts = []
chunked_faces = []
chunked_materials = []
chunked_material_ids = []
chunked_guids: list[str] = []
chunked_guid_ids: list[int] = []
chunked_verts: list[np.ndarray] = []
chunked_faces: list[np.ndarray] = []
# List of material colors.
chunked_materials: list[np.ndarray] = []
# List of material indices for each face.
chunked_material_ids: list[np.ndarray] = []
material_offset = 0
chunk_size = 10000
# Vertex offset.
offset = 0
ci = 0
@@ -1771,7 +1774,15 @@ class LoadLinkedProject(bpy.types.Operator):
self.collection.objects.link(obj)
def create_object(self, verts, faces, materials: list[bpy.types.Material], material_ids, guids, guid_ids):
def create_object(
self,
verts: np.ndarray,
faces: np.ndarray,
materials: list[bpy.types.Material],
material_ids: np.ndarray,
guids: list[str],
guid_ids: list[int],
) -> None:
num_vertices = len(verts) // 3
if not num_vertices:
return
+6 -3
View File
@@ -272,10 +272,10 @@ AttributeDataType = Literal["string", "integer", "float", "boolean", "enum", "fi
class Attribute(PropertyGroup):
tooltip = "`Right Click > IFC Description` to read the attribute description and online documentation"
name: StringProperty(name="Name")
name: StringProperty(name="Name") # type: ignore [reportRedeclaration]
display_name: StringProperty(name="Display Name", get=get_display_name)
description: StringProperty(name="Description")
ifc_class: StringProperty(name="Ifc Class")
description: StringProperty(name="Description") # type: ignore [reportRedeclaration]
ifc_class: StringProperty(name="Ifc Class") # type: ignore [reportRedeclaration]
data_type: EnumProperty( # type: ignore [reportRedeclaration]
name="Data Type",
items=[(i, i, "") for i in get_args(AttributeDataType)],
@@ -316,6 +316,9 @@ class Attribute(PropertyGroup):
metadata: StringProperty(name="Metadata", description="For storing some additional information about the attribute")
if TYPE_CHECKING:
name: str
description: str
ifc_class: str
data_type: AttributeDataType
def get_value(self) -> Union[str, float, int, bool, None]: