diff options
author | Hans Goudey <h.goudey@me.com> | 2022-07-06 19:53:18 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-07-06 19:53:18 +0300 |
commit | fae68ec651c8717da09089cae324d20c76db6318 (patch) | |
tree | e358917b491cd8d7da6f55025be82280645281f7 /source/blender/editors/sculpt_paint | |
parent | 8ea5a5259d2ccd179ee03178b1fe9d5b0250a4e8 (diff) |
Fix T99464: Curves sculpt add 3D brush symmetry broken
The brush transform was not applied to the view direction.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/curves_sculpt_add.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_add.cc b/source/blender/editors/sculpt_paint/curves_sculpt_add.cc index e5e6cfef8ae..401550b3b3a 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_add.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_add.cc @@ -353,17 +353,21 @@ struct AddOperationExecutor { view_ray_start_wo, view_ray_end_wo, true); - const float3 view_direction_su = math::normalize( - transforms_.world_to_surface * view_ray_end_wo - - transforms_.world_to_surface * view_ray_start_wo); + + const float3 view_ray_start_cu = transforms_.world_to_curves * view_ray_start_wo; + const float3 view_ray_end_cu = transforms_.world_to_curves * view_ray_end_wo; const Vector<float4x4> symmetry_brush_transforms = get_symmetry_brush_transforms( eCurvesSymmetryType(curves_id_->symmetry)); for (const float4x4 &brush_transform : symmetry_brush_transforms) { const float4x4 transform = transforms_.curves_to_surface * brush_transform; + const float3 brush_pos_su = transform * brush_3d->position_cu; + const float3 view_direction_su = math::normalize(transform * view_ray_end_cu - + transform * view_ray_start_cu); const float brush_radius_su = transform_brush_radius( transform, brush_3d->position_cu, brush_3d->radius_cu); + this->sample_spherical( rng, r_added_points, brush_pos_su, brush_radius_su, view_direction_su); } |