mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
typing
This commit is contained in:
@@ -425,7 +425,7 @@ class SelectClash(bpy.types.Operator):
|
||||
if not clash:
|
||||
return {"FINISHED"}
|
||||
|
||||
products = []
|
||||
products: list[ifcopenshell.entity_instance] = []
|
||||
|
||||
for global_id in (clash["a_global_id"], clash["b_global_id"]):
|
||||
try:
|
||||
|
||||
@@ -23,6 +23,7 @@ import bonsai.bim.helper
|
||||
from bpy.types import Panel
|
||||
from bonsai.bim.module.clash.data import ClashData
|
||||
from typing import TYPE_CHECKING
|
||||
from typing_extensions import assert_never
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from bonsai.bim.module.clash.prop import BIMClashProperties, ClashSet, SmartClashGroup, Clash
|
||||
@@ -80,6 +81,8 @@ class BIM_PT_ifcclash(Panel):
|
||||
row.prop(clash_set, "clearance")
|
||||
row = layout.row()
|
||||
row.prop(clash_set, "check_all")
|
||||
else:
|
||||
assert_never(clash_set.mode)
|
||||
|
||||
def draw_clash_set_group(group: tool.Clash.ClashSourceGroup) -> None:
|
||||
row = layout.row(align=True)
|
||||
|
||||
@@ -132,14 +132,10 @@ class Clash(bonsai.core.tool.Clash):
|
||||
@classmethod
|
||||
def look_at(cls, target: Vector, location: Vector) -> None:
|
||||
camera_location = location
|
||||
area = tool.Blender.get_view3d_area()
|
||||
region = next(region for region in area.regions if region.type == "WINDOW")
|
||||
space = next(space for space in area.spaces if space.type == "VIEW_3D")
|
||||
override = {"area": area, "region": region, "space_data": space}
|
||||
assert isinstance(space, bpy.types.SpaceView3D)
|
||||
assert space.region_3d
|
||||
space = tool.Blender.get_view3d_space()
|
||||
assert space and space.region_3d
|
||||
space.region_3d.view_location = target
|
||||
space.region_3d.view_rotation = Vector((camera_location - target)).to_track_quat("Z", "Y")
|
||||
space.region_3d.view_rotation = (camera_location - target).to_track_quat("Z", "Y")
|
||||
space.region_3d.view_distance = (camera_location - target).length
|
||||
space.shading.show_xray = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user