mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 02:27:59 +00:00
typing
This commit is contained in:
@@ -40,11 +40,11 @@ from logging import Logger
|
|||||||
|
|
||||||
|
|
||||||
class IfcExporter:
|
class IfcExporter:
|
||||||
def __init__(self, ifc_export_settings):
|
def __init__(self, ifc_export_settings: IfcExportSettings):
|
||||||
self.ifc_export_settings = ifc_export_settings
|
self.ifc_export_settings = ifc_export_settings
|
||||||
|
|
||||||
def export(self):
|
def export(self):
|
||||||
self.file = IfcStore.get_file()
|
self.file = tool.Ifc.get()
|
||||||
self.set_header()
|
self.set_header()
|
||||||
IfcStore.update_cache()
|
IfcStore.update_cache()
|
||||||
self.sync_all_objects()
|
self.sync_all_objects()
|
||||||
|
|||||||
@@ -28,6 +28,12 @@ if TYPE_CHECKING:
|
|||||||
def edit_object_placement(
|
def edit_object_placement(
|
||||||
ifc: tool.Ifc, geometry: tool.Geometry, surveyor: tool.Surveyor, obj: Optional[bpy.types.Object] = None
|
ifc: tool.Ifc, geometry: tool.Geometry, surveyor: tool.Surveyor, obj: Optional[bpy.types.Object] = None
|
||||||
) -> None:
|
) -> None:
|
||||||
|
"""Sync current object placement.
|
||||||
|
|
||||||
|
- apply and clear object scale;
|
||||||
|
- write current object position to IFC;
|
||||||
|
- update position checksums;
|
||||||
|
"""
|
||||||
element = ifc.get_entity(obj)
|
element = ifc.get_entity(obj)
|
||||||
if not element:
|
if not element:
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -82,7 +82,11 @@ class Geometry(bonsai.core.tool.Geometry):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def clear_scale(cls, obj: bpy.types.Object) -> None:
|
def clear_scale(cls, obj: bpy.types.Object) -> None:
|
||||||
# Note that clearing scale has no impact on cameras.
|
"""Apply and clear object scale.
|
||||||
|
|
||||||
|
If it's a mesh object, scale will be applied to it's mesh.
|
||||||
|
Note that clearing scale has no impact on cameras.
|
||||||
|
"""
|
||||||
if cls.is_scaled(obj):
|
if cls.is_scaled(obj):
|
||||||
if not obj.data:
|
if not obj.data:
|
||||||
location, rotation, _ = obj.matrix_world.decompose()
|
location, rotation, _ = obj.matrix_world.decompose()
|
||||||
|
|||||||
Reference in New Issue
Block a user