[Bf-blender-cvs] [627edd1efab] temp_bmesh_multires: Merge branch 'master' into temp_bmesh_multires

Joseph Eagar noreply at git.blender.org
Thu Sep 16 22:44:34 CEST 2021


Commit: 627edd1efabb0baaed3127bd127215ffb0ddfbac
Author: Joseph Eagar
Date:   Thu Sep 16 13:44:21 2021 -0700
Branches: temp_bmesh_multires
https://developer.blender.org/rB627edd1efabb0baaed3127bd127215ffb0ddfbac

Merge branch 'master' into temp_bmesh_multires

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



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

diff --cc extern/quadriflow/src/loader.cpp
index aa27066e6e4,a1596eeff9a..1aa50a40fc3
--- a/extern/quadriflow/src/loader.cpp
+++ b/extern/quadriflow/src/loader.cpp
@@@ -10,6 -10,6 +10,7 @@@
  
  #include <fstream>
  #include <unordered_map>
++#include <functional>
  
  namespace qflow {
  
@@@ -69,7 -69,7 +70,7 @@@ void load(const char* filename, MatrixX
  	};
  
  	/// Hash function for obj_vertex
- 	struct obj_vertexHash : std::unary_function<obj_vertex, size_t> {
 -	struct obj_vertexHash {
++	struct obj_vertexHash : std::function<size_t(obj_vertex)> {
  		std::size_t operator()(const obj_vertex &v) const {
  			size_t hash = std::hash<uint32_t>()(v.p);
  			hash = hash * 37 + std::hash<uint32_t>()(v.uv);
diff --cc source/blender/blenloader/intern/versioning_300.c
index 862b5bdb318,538634f4c9e..2ac98a11e18
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@@ -1112,103 -1229,50 +1230,137 @@@ void blo_do_versions_300(FileData *fd, 
      }
    }
  
 +  if (!MAIN_VERSION_ATLEAST(bmain, 300, 21)) {
 +    LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
 +      /* try to detect beta testers' files by seeing
 +        if autosmooth_fset_slide is 0; this will
 +        not work once it is added to DNA defaults
 +        (right now it's being set in BKE_brush_sculpt_reset).*/
 +      if (br->autosmooth_fset_slide == 0.0f) {
 +        Brush defbrush = *br;
 +
 +        BKE_brush_sculpt_reset(&defbrush);
 +        br->dyntopo = defbrush.dyntopo;
 +
 +        br->flag2 |= defbrush.flag2 & (BRUSH_SMOOTH_PRESERVE_FACE_SETS |
 +                                       BRUSH_SMOOTH_USE_AREA_WEIGHT | BRUSH_CURVATURE_RAKE);
 +
 +        br->autosmooth_fset_slide = defbrush.autosmooth_fset_slide;
 +        br->boundary_smooth_factor = defbrush.boundary_smooth_factor;
 +        br->autosmooth_spacing = defbrush.autosmooth_spacing;
 +        br->autosmooth_radius_factor = defbrush.autosmooth_radius_factor;
 +        br->topology_rake_radius_factor = defbrush.topology_rake_radius_factor;
 +        br->topology_rake_projection = defbrush.topology_rake_projection;
 +        br->topology_rake_spacing = defbrush.topology_rake_spacing;
 +
 +        if (br->autosmooth_projection == 0.0f) {
 +          br->autosmooth_projection = defbrush.autosmooth_projection;
 +        }
 +      }
 +
 +      if (br->sculpt_tool == SCULPT_TOOL_VCOL_BOUNDARY) {
 +        if (br->vcol_boundary_exponent == 0.0f) {
 +          br->vcol_boundary_exponent = 1.0f;
 +        }
 +      }
 +      else if (br->sculpt_tool == SCULPT_TOOL_SIMPLIFY) {
 +        br->dyntopo.inherit = DYNTOPO_INHERIT_BITMASK &
 +                              ~(DYNTOPO_INHERIT_ALL | DYNTOPO_SUBDIVIDE | DYNTOPO_COLLAPSE);
 +        br->dyntopo.flag |= DYNTOPO_COLLAPSE | DYNTOPO_SUBDIVIDE | DYNTOPO_CLEANUP;
 +      }
 +    }
 +
 +    Scene *scene;
 +    for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
 +      ToolSettings *ts = scene->toolsettings;
 +
 +      if (ts->sculpt) {
 +        ts->sculpt->flags |= SCULPT_DYNTOPO_CLEANUP;
 +      }
 +    }
 +
 +    LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
 +      ToolSettings *ts = scene->toolsettings;
 +      if (ts && ts->sculpt) {
 +        ts->sculpt->detail_range = 0.4f;
 +      }
 +    }
 +  }
 +
 +  if (!MAIN_VERSION_ATLEAST(bmain, 300, 22)) {
 +    LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
 +      ToolSettings *ts = scene->toolsettings;
 +
 +      if (ts) {
 +        ts->unified_paint_settings.flag |= UNIFIED_PAINT_FLAG_HARD_EDGE_MODE;
 +      }
 +    }
 +  }
 +
 +  if (!MAIN_VERSION_ATLEAST(bmain, 300, 22)) {
 +    LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
 +      ToolSettings *ts = scene->toolsettings;
 +
 +      if (ts) {
 +        ts->unified_paint_settings.flag |= UNIFIED_PAINT_FLAG_HARD_EDGE_MODE;
 +      }
 +    }
 +  }
 +
 +  if (!MAIN_VERSION_ATLEAST(bmain, 300, 23)) {
 +    LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
 +      ToolSettings *ts = scene->toolsettings;
 +
 +      if (ts && ts->sculpt) {
 +        ts->sculpt->flags |= SCULPT_DYNTOPO_ENABLED;
 +      }
 +    }
 +  }
 +
+   if (!MAIN_VERSION_ATLEAST(bmain, 300, 22)) {
+     LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
+       if (ntree->type == NTREE_GEOMETRY) {
+         version_geometry_nodes_change_legacy_names(ntree);
+       }
+     }
+     if (!DNA_struct_elem_find(
+             fd->filesdna, "LineartGpencilModifierData", "bool", "use_crease_on_smooth")) {
+       LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+         if (ob->type == OB_GPENCIL) {
+           LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) {
+             if (md->type == eGpencilModifierType_Lineart) {
+               LineartGpencilModifierData *lmd = (LineartGpencilModifierData *)md;
+               lmd->calculation_flags |= LRT_USE_CREASE_ON_SMOOTH_SURFACES;
+             }
+           }
+         }
+       }
+     }
 -  }
 -
 -  /**
 -   * Versioning code until next subversion bump goes here.
 -   *
 -   * \note Be sure to check when bumping the version:
 -   * - "versioning_userdef.c", #blo_do_versions_userdef
 -   * - "versioning_userdef.c", #do_versions_theme
 -   *
 -   * \note Keep this message at the bottom of the function.
 -   */
 -  {
 -    /* Keep this block, even when empty. */
+ 
+     for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+       LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+         LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
+           if (sl->spacetype == SPACE_FILE) {
+             SpaceFile *sfile = (SpaceFile *)sl;
+             if (sfile->asset_params) {
+               sfile->asset_params->base_params.recursion_level = FILE_SELECT_MAX_RECURSIONS;
+             }
+           }
+         }
+       }
+     }
+   }
++
 +  /**
 +   * Versioning code until next subversion bump goes here.
 +   *
 +   * \note Be sure to check when bumping the version:
 +   * - "versioning_userdef.c", #blo_do_versions_userdef
 +   * - "versioning_userdef.c", #do_versions_theme
 +   *
 +   * \note Keep this message at the bottom of the function.
 +   */
 +  {
 +    /* Keep this block, even when empty. */
 +  }
  }
diff --cc source/blender/editors/sculpt_paint/paint_mask.c
index 53d85b33a5b,4a8dcd7a934..9a5d4de3ebd
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@@ -1305,31 -1294,15 +1305,32 @@@ static void sculpt_gesture_apply_trim(S
  
    MEM_freeN(looptris);
  
 -  Mesh *result = BKE_mesh_from_bmesh_nomain(bm,
 -                                            (&(struct BMeshToMeshParams){
 -                                                .calc_object_remap = false,
 -                                            }),
 -                                            sculpt_mesh);
 -  BM_mesh_free(bm);
 -  BKE_mesh_normals_tag_dirty(result);
 -  BKE_mesh_nomain_to_mesh(
 -      result, sgcontext->vc.obact->data, sgcontext->vc.obact, &CD_MASK_MESH, true);
 +  if (sgcontext->ss && sgcontext->ss->bm) {  // rebuild pbvh
 +    BKE_pbvh_free(sgcontext->ss->pbvh);
 +    sgcontext->ss->pbvh = BKE_pbvh_new();
 +
 +    BKE_pbvh_build_bmesh(sgcontext->ss->pbvh,
 +                         sgcontext->ss->bm,
 +                         sgcontext->ss->bm_smooth_shading,
 +                         sgcontext->ss->bm_log,
 +                         sgcontext->ss->cd_vert_node_offset,
 +                         sgcontext->ss->cd_face_node_offset,
 +                         sgcontext->ss->cd_dyn_vert,
 +                         sgcontext->ss->cd_face_areas,
 +                         sgcontext->ss->fast_draw);
 +  }
 +  else {  // save result to mesh
 +    Mesh *result = BKE_mesh_from_bmesh_nomain(bm,
 +                                              (&(struct BMeshToMeshParams){
 +                                                  .calc_object_remap = false,
 +                                              }),
 +                                              sculpt_mesh);
 +    BM_mesh_free(bm);
 +    result->runtime.cd_dirty_vert |= CD_MASK_NORMAL;
++    BKE_mesh_normals_tag_dirty(result);
 +    BKE_mesh_nomain_to_mesh(
 +        result, sgcontext->vc.obact->data, sgcontext->vc.obact, &CD_MASK_MESH, true);
 +  }
  }
  
  static void sculpt_gesture_trim_begin(bContext *C, SculptGestureContext *sgcontext)
diff --cc source/blender/editors/sculpt_paint/sculpt_brush_machine.c
index 0f3b542f0e0,00000000000..b4771bd783d
mode 100644,000000..100644
--- a/source/blender/editors/sculpt_paint/sculpt_brush_machine.c
+++ b/source/blender/editors/sculpt_paint/sculpt_brush_machine.c
@@@ -1,62 -1,0 +1,316 @@@
- #if 0
++#if 1
 +#  include "MEM_guardedalloc.h"
 +
 +#  include "BLI_alloca.h"
 +#  include "BLI_array.h"
 +#  include "BLI_bitmap.h"
 +#  include "BLI_compiler_attrs.h"
 +#  include "BLI_compiler_compat.h"
 +#  include "BLI_listbase.h"
 +#  include "BLI_math.h"
 +#  include "BLI_memarena.h"
 +
++#  include "DNA_brush_enums.h"
++#  include "DNA_brush_types.h"
++#  include "DNA_color_types.h"
++#  include "DNA_curveprofile_types.h"
 +#  include "DNA_node_types.h"
 +
++#  include "BKE_brush.h"
++#  include "BKE_colorband.h"
++#  include "BKE_colortools.h"
 +#  include "BKE_context.h"
 +#  include "BKE_node.h"
++#  include "BKE_paint.h"
++
++#  include "BKE_curveprofile.h"
++
++#  define MAX_BRUSH_COMMAND_PARAMS 16
++#  define MAX_BRUSH_CHANNEL_CURVES 3
++
++enum {
++  BRUSH_CHANNEL_RADIUS = 1 << 0,
++  BRUSH_CHANNEL_STRENGTH = 1 << 1,
++  BRUSH_CHANNEL_CLOTH_TYPE = 1 << 2,  // int
++  BRUSH_CHANNEL_RADIUS_SCALE = 1 << 3,
++  //  BRUSH_CHANNEL_ITERATIONS = 1 << 3,  // int
++  //  BRUSH_CHANNEL_BOUNDARY_TYPE = 1 << 4,
++  // BRUSH_CHANNEL_AUTOMASKING_TYPE = 1 << 5,
++  CHANNEL_CUSTOM = 1 << 20
++};
++
++typedef struct BrushChannel {
++  int type;
++  char name[32];  // for custom types
++
++  float value;
++  CurveMapping curves[MAX_BRUSH_CHANNEL_CURVES];
++  int flag;
++} BrushChannel;
++
++#  define MAX_BRUSH_ENUM_DEF 32
++
++typedef struct BrushEnumDef {
++  EnumPropertyItem items[MAX_BRUSH_ENUM_DEF];
++} BrushEnumDef;
++
++typedef struct BrushChannelType {
++  char name[32];
++  int c

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list