mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 19:09:07 +00:00
Fix #6452. Fix #6478. Disable camera clipping due to unpredictable Blender behaviour (reported upstream).
https://projects.blender.org/blender/blender/issues/137384
This commit is contained in:
@@ -2169,7 +2169,8 @@ class ActivateDrawingBase:
|
||||
camera_props = camera.data.BIMCameraProperties
|
||||
if camera_props.update_representation(camera):
|
||||
bpy.ops.bim.update_representation(obj=camera.name, ifc_representation_class="")
|
||||
bpy.ops.bim.refresh_clipping_planes("INVOKE_DEFAULT")
|
||||
# See 6452 and 6478.
|
||||
# bpy.ops.bim.refresh_clipping_planes("INVOKE_DEFAULT")
|
||||
|
||||
return {"FINISHED"}
|
||||
|
||||
|
||||
@@ -2349,7 +2349,9 @@ class RefreshClippingPlanes(bpy.types.Operator):
|
||||
data = region.data
|
||||
|
||||
props = tool.Project.get_project_props()
|
||||
if not len(props.clipping_planes) and not self.camera:
|
||||
# See 6452 and 6478.
|
||||
# if not len(props.clipping_planes) and not self.camera:
|
||||
if not len(props.clipping_planes):
|
||||
data.use_clip_planes = False
|
||||
else:
|
||||
with bpy.context.temp_override(area=area, region=region):
|
||||
@@ -2378,13 +2380,14 @@ class RefreshClippingPlanes(bpy.types.Operator):
|
||||
clip_planes.append(clip_plane)
|
||||
bm.free()
|
||||
|
||||
if self.camera:
|
||||
normal = self.camera.matrix_world.col[2].to_3d()
|
||||
normal *= -1
|
||||
center = self.camera.matrix_world.translation
|
||||
distance = -center.dot(normal)
|
||||
clip_plane = (normal.x, normal.y, normal.z, distance)
|
||||
clip_planes.append(clip_plane)
|
||||
# See 6452 and 6478.
|
||||
# if self.camera:
|
||||
# normal = self.camera.matrix_world.col[2].to_3d()
|
||||
# normal *= -1
|
||||
# center = self.camera.matrix_world.translation
|
||||
# distance = -center.dot(normal)
|
||||
# clip_plane = (normal.x, normal.y, normal.z, distance)
|
||||
# clip_planes.append(clip_plane)
|
||||
|
||||
clip_planes = cycle(clip_planes)
|
||||
data.clip_planes = [tuple(next(clip_planes)) for i in range(0, 6)]
|
||||
|
||||
Reference in New Issue
Block a user