[Bf-blender-cvs] [73accfeccaa] sculpt-dev: Merge

Joseph Eagar noreply at git.blender.org
Mon Jan 31 18:39:43 CET 2022


Commit: 73accfeccaac7ea08c584325d257fba52baa865c
Author: Joseph Eagar
Date:   Mon Jan 31 09:23:44 2022 -0800
Branches: sculpt-dev
https://developer.blender.org/rB73accfeccaac7ea08c584325d257fba52baa865c

Merge

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

M	source/blender/blenkernel/BKE_paint.h
M	source/blender/bmesh/intern/bmesh_mesh_convert.cc
M	source/blender/draw/CMakeLists.txt
M	source/blender/draw/intern/draw_cache_impl_mesh.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/sculpt_paint/paint_utils.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/sculpt_intern.h
M	source/blender/editors/sculpt_paint/sculpt_transform.c
M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M	source/blender/gpu/CMakeLists.txt
M	source/blender/gpu/GPU_shader.h
M	source/blender/io/alembic/intern/abc_reader_mesh.cc
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/nodes/geometry/nodes/node_geo_triangulate.cc

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

diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 272c1e7d786..275c66d552f 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -859,6 +859,10 @@ typedef struct SculptSession {
   float pivot_rot[4];
   float pivot_scale[3];
 
+  float prev_pivot_pos[3];
+  float prev_pivot_rot[4];
+  float prev_pivot_scale[3];
+
   float init_pivot_pos[3];
   float init_pivot_rot[4];
   float init_pivot_scale[3];
diff --git a/source/blender/bmesh/intern/bmesh_mesh_convert.cc b/source/blender/bmesh/intern/bmesh_mesh_convert.cc
index b9e2b0fe74d..351ac615d2a 100644
--- a/source/blender/bmesh/intern/bmesh_mesh_convert.cc
+++ b/source/blender/bmesh/intern/bmesh_mesh_convert.cc
@@ -589,8 +589,6 @@ void BM_mesh_bm_from_me(Object *ob,
     cd_shape_key_offset[i] = bm->vdata.layers[idx].offset;
   }
 
-  vtable = static_cast<BMVert**>(MEM_mallocN(sizeof(BMVert **) * me->totvert, __func__));
-
   Span<MVert> mvert{me->mvert, me->totvert};
   Array<BMVert *> vtable(me->totvert);
   for (const int i : mvert.index_range()) {
diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt
index af4f61fd47e..f4e57d9521b 100644
--- a/source/blender/draw/CMakeLists.txt
+++ b/source/blender/draw/CMakeLists.txt
@@ -212,7 +212,6 @@ set(SRC
   intern/draw_manager_profiling.h
   intern/draw_manager_testing.h
   intern/draw_manager_text.h
-  intern/draw_shader_shared.h
   intern/draw_shader.h
   intern/draw_shader_shared.h
   intern/draw_subdivision.h
@@ -383,6 +382,7 @@ set(GLSL_SRC
   intern/shaders/common_hair_refine_comp.glsl
   intern/shaders/common_math_lib.glsl
   intern/shaders/common_math_geom_lib.glsl
+  intern/shaders/common_view_clipping_lib.glsl
   intern/shaders/common_view_lib.glsl
   intern/shaders/common_fxaa_lib.glsl
   intern/shaders/common_smaa_lib.glsl
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index f4937c563a5..ff63828a371 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -474,11 +474,11 @@ static void mesh_cd_calc_active_mask_uv_layer(const Object *object,
   }
 }
 
-static bool mesh_cd_calc_active_vcol_layer(Mesh *me, DRW_MeshAttributes *attrs_used)
+static bool mesh_cd_calc_active_vcol_layer(Object *ob, Mesh *me, DRW_MeshAttributes *attrs_used)
 {
   CustomDataLayer *layer = BKE_id_attributes_active_get((ID *)me);
 
-  const Mesh *me_final = editmesh_final_or_this(me);
+  const Mesh *me_final = editmesh_final_or_this(ob, me);
   const CustomData *cd_vdata = mesh_cd_vdata_get_from_mesh(me_final);
   const CustomData *cd_ldata = mesh_cd_ldata_get_from_mesh(me_final);
 
@@ -1251,7 +1251,7 @@ static void sculpt_request_active_vcol(MeshBatchCache *cache, Object *object, Me
   const CustomData *cd_vdata = mesh_cd_vdata_get_from_mesh(me_final);
   const CustomData *cd_ldata = mesh_cd_ldata_get_from_mesh(me_final);
 
-  if (mesh_cd_calc_active_vcol_layer(me, &attrs_needed)) {
+  if (mesh_cd_calc_active_vcol_layer(object, me, &attrs_needed)) {
     int active = mesh_cd_get_active_color_i(me_final, cd_vdata, cd_ldata);
     int render = mesh_cd_get_render_color_i(me_final, cd_vdata, cd_ldata);
 
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 60399c9b160..e24b26410c2 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -4467,7 +4467,6 @@ static void project_paint_begin(const bContext *C,
   /* At the moment this is just ps->arena_mt[0], but use this to show were not multi-threading. */
   MemArena *arena;
 
-  Object *ob = CTX_data_active_object(C);
   bool use_brush_channels = paint_use_channels(C);
 
   const int diameter = 2 * BKE_brush_size_get(ps->scene, ps->brush, use_brush_channels);
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 77c76f0898f..41db362dd4c 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -679,8 +679,6 @@ static int curvemapping_preset_get_path(
 
 static int curvemapping_preset_exec(bContext *C, wmOperator *op)
 {
-  Brush *br = BKE_paint_brush(BKE_paint_get_active_from_context(C));
-
   PointerRNA ctx_ptr;
   RNA_pointer_create(NULL, &RNA_Context, C, &ctx_ptr);
 
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 48b01a86225..7607b500dc6 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1483,7 +1483,7 @@ static void smooth_brush_toggle_on(const bContext *C, Paint *paint, StrokeCache
 {
   Scene *scene = CTX_data_scene(C);
   Brush *brush = paint->brush;
-  int cur_brush_size = BKE_brush_size_get(scene, brush);
+  int cur_brush_size = BKE_brush_size_get(scene, brush, false);
 
   BLI_strncpy(
       cache->saved_active_brush_name, brush->id.name + 2, sizeof(cache->saved_active_brush_name));
@@ -1492,8 +1492,8 @@ static void smooth_brush_toggle_on(const bContext *C, Paint *paint, StrokeCache
   brush = BKE_paint_toolslots_brush_get(paint, WPAINT_TOOL_BLUR);
   if (brush) {
     BKE_paint_brush_set(paint, brush);
-    cache->saved_smooth_size = BKE_brush_size_get(scene, brush);
-    BKE_brush_size_set(scene, brush, cur_brush_size);
+    cache->saved_smooth_size = BKE_brush_size_get(scene, brush, false);
+    BKE_brush_size_set(scene, brush, cur_brush_size, false);
     BKE_curvemapping_init(brush->curve);
   }
 }
@@ -1507,7 +1507,7 @@ static void smooth_brush_toggle_off(const bContext *C, Paint *paint, StrokeCache
   BLI_assert(brush == cache->brush);
 
   /* Try to switch back to the saved/previous brush. */
-  BKE_brush_size_set(scene, brush, cache->saved_smooth_size);
+  BKE_brush_size_set(scene, brush, cache->saved_smooth_size, false);
   brush = (Brush *)BKE_libblock_find_name(bmain, ID_BR, cache->saved_active_brush_name);
   if (brush) {
     BKE_paint_brush_set(paint, brush);
@@ -1521,10 +1521,6 @@ static void vwpaint_update_cache_invariants(
   StrokeCache *cache;
   Scene *scene = CTX_data_scene(C);
   UnifiedPaintSettings *ups = &CTX_data_tool_settings(C)->unified_paint_settings;
-<<<<<<< HEAD
-  Brush *brush = vp->paint.brush;
-=======
->>>>>>> master
   ViewContext *vc = paint_stroke_view_context(op->customdata);
   Object *ob = CTX_data_active_object(C);
   float mat[3][3];
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 8de9fa3763b..797feedfc27 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -29,27 +29,46 @@
 #include "DNA_meshdata_types.h"
 #include "DNA_vec_types.h"
 
-#include "BKE_paint.h"
-#include "BKE_pbvh.h"
 #include "BLI_bitmap.h"
 #include "BLI_compiler_compat.h"
 #include "BLI_gsqueue.h"
 #include "BLI_threads.h"
 
+#include "ED_view3d.h"
+
+#include "BKE_attribute.h"
+#include "BKE_brush_engine.h"
+#include "BKE_paint.h"
+#include "BKE_pbvh.h"
+
+#include "bmesh.h"
+
 struct AutomaskingCache;
 struct KeyBlock;
 struct Object;
 struct SculptUndoNode;
 struct bContext;
+struct BrushChannelSet;
+struct TaskParallelTLS;
 
 enum ePaintSymmetryFlags;
 
+/*
+maximum symmetry passes returned by SCULPT_get_symmetry_pass.
+enough for about ~30 radial symmetry passes, which seems like plenty
+
+used by various code that needs to statically store per-pass state.
+*/
+#define SCULPT_MAX_SYMMETRY_PASSES 255
+
 /* Updates */
 
 /* -------------------------------------------------------------------- */
 /** \name Sculpt Types
  * \{ */
 
+enum { SCULPT_SHARP_SIMPLE, SCULPT_SHARP_PLANE };
+
 typedef enum SculptUpdateType {
   SCULPT_UPDATE_COORDS = 1 << 0,
   SCULPT_UPDATE_MASK = 1 << 1,
@@ -59,46 +78,104 @@ typedef enum SculptUpdateType {
 
 typedef struct SculptCursorGeometryInfo {
   float location[3];
+  float back_location[3];
   float normal[3];
   float active_vertex_co[3];
 } SculptCursorGeometryInfo;
 
-#define SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY 256
+struct _SculptNeighborRef {
+  SculptVertRef vertex;
+  SculptEdgeRef edge;
+};
+
+#define SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY 12
 
 typedef struct SculptVertexNeighborIter {
   /* Storage */
-  int *neighbors;
+  struct _SculptNeighborRef *neighbors;
+  int *neighbor_indices;
+
   int size;
   int capacity;
-  int neighbors_fixed[SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY];
+  struct _SculptNeighborRef neighbors_fixed[SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY];
+  int neighbor_indices_fixed[SCULPT_VERTEX_NEIGHBOR_FIXED_CAPACITY];
 
   /* Internal iterator. */
   int num_duplicates;
   int i;
 
   /* Public */
+  SculptVertRef vertex;
+  SculptEdgeRef edge;
   int index;
+  bool has_edge;  // does this iteration step have an edge, fake neighbors do not
   bool is_duplicate;
+  bool no_free;
 } SculptVertexNeighborIter;
 
+/* this is a bitmask */
+typedef enum SculptCornerType {
+  SCULPT_CORNER_NONE = 0,
+  SCULPT_CORNER_MESH = 1 << 0,
+  SCULPT_CORNER_FACE_SET = 1 << 1,
+  SCULPT_CORNER_SEAM = 1 << 2,
+  SCULPT_CORNER_SHARP = 1 << 3,
+  SCULPT_CORNER_UV = 1 << 4,
+} SculptCornerType;
+
+typedef enum SculptBoundaryType {
+  SCULPT_BOUNDARY_MESH = 1 << 0,
+  SCULPT_BOUNDARY_FACE_SET = 1 << 1,
+  SCULPT_BOUNDARY_SEAM = 1 << 2,
+  SCULPT_BOUNDARY_SHARP = 1 << 3,
+  SCULPT_BOUNDARY_UV = 1 << 4,
+  SCULPT_BOUNDARY_ALL = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4),
+  SCULPT_BOUNDARY_DEFAULT = (1 << 0) | (1 << 3) | (1 << 4)  // mesh and sharp
+} SculptBoundaryType;
+
+typedef struct SculptFaceSetIsland {
+  SculptFaceRef *faces;
+  int totface;
+} SculptFaceSetIsland;
+
+typedef struct SculptFaceSetIslands {
+  SculptFaceSetIsland *islands;
+  int totisland;
+} SculptFaceSetIslands;
+
 /* Sculpt Original Data */
 typedef struct {
   struct BMLog *bm_log;
 
   struct SculptUndoNode *unode;
+  int datatype;
   float (*coords)[3];
   float (*normals)[3];
   const float *vmasks;
   float (*colors)[4];
+  float _no[3];
 
   /* Original 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list