[Bf-blender-cvs] [29078186f81] sculpt-dev: Merge branch 'master' into sculpt-dev

Pablo Dobarro noreply at git.blender.org
Tue Jan 5 18:12:50 CET 2021


Commit: 29078186f813f98d48b1c516905594048f7b0ccd
Author: Pablo Dobarro
Date:   Tue Jan 5 17:52:46 2021 +0100
Branches: sculpt-dev
https://developer.blender.org/rB29078186f813f98d48b1c516905594048f7b0ccd

Merge branch 'master' into sculpt-dev

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



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

diff --cc source/blender/blenkernel/intern/mesh_fair.cc
index d5c1d21d97a,75dd396d10a..858653eda97
--- a/source/blender/blenkernel/intern/mesh_fair.cc
+++ b/source/blender/blenkernel/intern/mesh_fair.cc
@@@ -420,14 -350,17 +420,13 @@@ class UniformVertexWeight : public Vert
    UniformVertexWeight(FairingContext *fairing_context)
    {
      const int totvert = fairing_context->vertex_count_get();
 +    fairing_context_ = fairing_context;
      vertex_weights_.reserve(totvert);
 +    cached_.reserve(totvert);
      for (int i = 0; i < totvert; i++) {
 -      const int tot_loop = fairing_context->vertex_loop_map_get(i)->count;
 -      if (tot_loop != 0) {
 -        vertex_weights_[i] = 1.0f / tot_loop;
 -      }
 -      else {
 -        vertex_weights_[i] = FLT_MAX;
 -      }
 +      cached_[i] = false;
      }
    }
-   ~UniformVertexWeight() = default;
  
    float weight_at_index(const int index) override
    {
@@@ -457,14 -376,44 +456,13 @@@ class VoronoiVertexWeight : public Vert
   public:
    VoronoiVertexWeight(FairingContext *fairing_context)
    {
 -
      const int totvert = fairing_context->vertex_count_get();
      vertex_weights_.reserve(totvert);
 +    cached_.reserve(totvert);
      for (int i = 0; i < totvert; i++) {
 -
 -      float area = 0.0f;
 -      float a[3];
 -      copy_v3_v3(a, fairing_context->vertex_deformation_co_get(i));
 -      const float acute_threshold = M_PI_2;
 -
 -      MeshElemMap *vlmap_elem = fairing_context->vertex_loop_map_get(i);
 -      for (int l = 0; l < vlmap_elem->count; l++) {
 -        const int l_index = vlmap_elem->indices[l];
 -
 -        float b[3], c[3], d[3];
 -        fairing_context->adjacents_coords_from_loop(l_index, b, c);
 -
 -        if (angle_v3v3v3(c, fairing_context->vertex_deformation_co_get(i), b) < acute_threshold) {
 -          calc_circumcenter(d, a, b, c);
 -        }
 -        else {
 -          add_v3_v3v3(d, b, c);
 -          mul_v3_fl(d, 0.5f);
 -        }
 -
 -        float t[3];
 -        add_v3_v3v3(t, a, b);
 -        mul_v3_fl(t, 0.5f);
 -        area += area_tri_v3(a, t, d);
 -
 -        add_v3_v3v3(t, a, c);
 -        mul_v3_fl(t, 0.5f);
 -        area += area_tri_v3(a, d, t);
 -      }
 -
 -      vertex_weights_[i] = area != 0.0f ? 1.0f / area : 1e12;
 +      cached_[i] = false;
      }
    }
-   ~VoronoiVertexWeight() = default;
  
    float weight_at_index(const int index) override
    {
diff --cc source/blender/blenloader/intern/versioning_290.c
index b583326cd01,de59075559d..80a6eff30a3
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@@ -1491,10 -1490,22 +1491,28 @@@ void blo_do_versions_290(FileData *fd, 
     */
    {
      /* Keep this block, even when empty. */
 +    LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
 +      if (!br->pressure_size_curve || !br->pressure_strength_curve) {
 +        BKE_brush_default_input_curves_set(br);
 +      }
 +    }
++    
+     if (!DNA_struct_find(fd->filesdna, "NodeSetAlpha")) {
+       LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
+         bNodeTree *nodetree = scene->nodetree;
+         if (nodetree == NULL) {
+           continue;
+         }
+ 
+         LISTBASE_FOREACH (bNode *, node, &nodetree->nodes) {
+           if (node->type != CMP_NODE_SETALPHA) {
+             continue;
+           }
+           NodeSetAlpha *storage = MEM_callocN(sizeof(NodeSetAlpha), "NodeSetAlpha");
+           storage->mode = CMP_NODE_SETALPHA_MODE_REPLACE_ALPHA;
+           node->storage = storage;
+         }
+       }
+     }
    }
  }



More information about the Bf-blender-cvs mailing list