[Bf-blender-cvs] [476b333a3ef] sculpt-dev: Merge branch 'master' into sculpt-dev

Pablo Dobarro noreply at git.blender.org
Mon Mar 15 02:19:17 CET 2021


Commit: 476b333a3ef8dff9fa8b5b3b6adff2565c7be840
Author: Pablo Dobarro
Date:   Sun Mar 14 21:14:58 2021 +0100
Branches: sculpt-dev
https://developer.blender.org/rB476b333a3ef8dff9fa8b5b3b6adff2565c7be840

Merge branch 'master' into sculpt-dev

===================================================================



===================================================================

diff --cc source/blender/editors/sculpt_paint/sculpt.c
index fc9450a8a71,964e5bdaa90..5d523852baa
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@@ -4457,10 -3988,8 +4443,9 @@@ static void do_grab_brush_task_cb_ex(vo
    const int thread_id = BLI_task_parallel_thread_id(tls);
  
    const bool grab_silhouette = brush->flag2 & BRUSH_GRAB_SILHOUETTE;
 +  const bool use_geodesic_dists = brush->flag2 & BRUSH_USE_SURFACE_FALLOFF;
  
-   BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
-   {
+   BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) {
      SCULPT_orig_vert_data_update(&orig_data, &vd);
  
      if (!sculpt_brush_test_sq_fn(&test, orig_data.co)) {
@@@ -4581,33 -4090,12 +4566,32 @@@ static void do_elastic_deform_brush_tas
    BKE_kelvinlet_init_params(
        &params, ss->cache->radius, force, 1.0f, brush->elastic_deform_volume_preservation);
  
-   BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
-   {
+   BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) {
      SCULPT_orig_vert_data_update(&orig_data, &vd);
      float final_disp[3];
 +
 +    float orig_co[3];
 +    if (brush->flag2 & BRUSH_USE_SURFACE_FALLOFF) {
 +      const float geodesic_dist =
 +          ss->cache->geodesic_dists[ss->cache->mirror_symmetry_pass][vd.index];
 +
 +      if (geodesic_dist == FLT_MAX) {
 +        continue;
 +      }
 +
 +      float disp[3];
 +      sub_v3_v3v3(disp, orig_data.co, ss->cache->initial_location);
 +      normalize_v3(disp);
 +      mul_v3_fl(disp, geodesic_dist);
 +      add_v3_v3v3(orig_co, ss->cache->initial_location, disp);
 +    }
 +    else {
 +      copy_v3_v3(orig_co, orig_data.co);
 +    }
 +
      switch (brush->elastic_deform_type) {
        case BRUSH_ELASTIC_DEFORM_GRAB:
 -        BKE_kelvinlet_grab(final_disp, &params, orig_data.co, location, grab_delta);
 +        BKE_kelvinlet_grab(final_disp, &params, orig_co, location, grab_delta);
          mul_v3_fl(final_disp, bstrength * 20.0f);
          break;
        case BRUSH_ELASTIC_DEFORM_GRAB_BISCALE: {



More information about the Bf-blender-cvs mailing list