Fix T99464: Curves sculpt add 3D brush symmetry broken
The brush transform was not applied to the view direction.
This commit is contained in:
parent
8ea5a5259d
commit
fae68ec651
Notes:
blender-bot
2023-05-22 12:40:41 +02:00
Referenced by issue #99464, Curves Sculpting: Symmetry + Front Faces Only issue with Add Brush
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue