Fix #3870. Bug where element filtering wasn't initialised properly when loading a camera for the first time.

Raster_x/y would only be set after the handler triggers. This is no longer necessary with the new explicit width / height properties.
This commit is contained in:
Dion Moult
2023-10-15 22:23:10 +11:00
parent 58be92d3fc
commit 14224ac538
+3 -6
View File
@@ -1661,12 +1661,9 @@ class Drawing(blenderbim.core.tool.Drawing):
@classmethod
def get_elements_in_camera_view(cls, camera, objs):
if bpy.context.scene.render.resolution_x > bpy.context.scene.render.resolution_y:
x = camera.data.ortho_scale / 2
y = (camera.data.BIMCameraProperties.raster_y / camera.data.BIMCameraProperties.raster_x) * x
else:
y = camera.data.ortho_scale / 2
x = (camera.data.BIMCameraProperties.raster_x / camera.data.BIMCameraProperties.raster_y) * y
props = camera.data.BIMCameraProperties
x = props.width
y = props.height
camera_inverse_matrix = camera.matrix_world.inverted()
return set(