diff --git a/source/blender/io/grease_pencil/intern/grease_pencil_io.cc b/source/blender/io/grease_pencil/intern/grease_pencil_io.cc index c6d67e5a9bd..5d091e842ae 100644 --- a/source/blender/io/grease_pencil/intern/grease_pencil_io.cc +++ b/source/blender/io/grease_pencil/intern/grease_pencil_io.cc @@ -193,13 +193,11 @@ static IndexMask get_visible_strokes(const Object &object, strokes.curves_range(), GrainSize(512), memory, is_visible_curve); } -static std::optional> compute_drawing_bounds( +static std::optional> compute_screen_space_drawing_bounds( const ARegion ®ion, const RegionView3D &rv3d, const Object &object, - const Object &object_eval, const int layer_index, - const int frame_number, const bke::greasepencil::Drawing &drawing) { using bke::greasepencil::Drawing; @@ -215,11 +213,9 @@ static std::optional> compute_drawing_bounds( const Layer &layer = *grease_pencil.layers()[layer_index]; const float4x4 layer_to_world = layer.to_world_space(object); - const bke::crazyspace::GeometryDeformation deformation = - bke::crazyspace::get_evaluated_grease_pencil_drawing_deformation( - &object_eval, object, layer_index, frame_number); const VArray radii = drawing.radii(); const bke::CurvesGeometry &strokes = drawing.strokes(); + const Span positions = strokes.positions(); IndexMaskMemory curve_mask_memory; const IndexMask curve_mask = get_visible_strokes(object, drawing, curve_mask_memory); @@ -232,8 +228,7 @@ static std::optional> compute_drawing_bounds( } for (const int point_i : points) { - const float3 pos_world = math::transform_point(layer_to_world, - deformation.positions[point_i]); + const float3 pos_world = math::transform_point(layer_to_world, positions[point_i]); float2 screen_co; eV3DProjStatus result = ED_view3d_project_float_global( ®ion, pos_world, screen_co, V3D_PROJ_TEST_NOP); @@ -276,8 +271,8 @@ static std::optional> compute_objects_bounds( continue; } - std::optional> layer_bounds = compute_drawing_bounds( - region, rv3d, *info.object, *object_eval, layer_index, frame_number, *drawing); + std::optional> layer_bounds = compute_screen_space_drawing_bounds( + region, rv3d, *info.object, layer_index, *drawing); full_bounds = bounds::merge(full_bounds, layer_bounds); }