[Bf-blender-cvs] [b5a69061e7d] temp-sculpt-brush-channel: Merge branch 'master' into temp-sculpt-brush-channel

Joseph Eagar noreply at git.blender.org
Sun Oct 23 01:33:59 CEST 2022


Commit: b5a69061e7d464914662ae0dd6fed46a999a56bb
Author: Joseph Eagar
Date:   Sat Oct 22 16:33:25 2022 -0700
Branches: temp-sculpt-brush-channel
https://developer.blender.org/rBb5a69061e7d464914662ae0dd6fed46a999a56bb

Merge branch 'master' into temp-sculpt-brush-channel

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



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

diff --cc source/blender/blenkernel/intern/brush.cc
index 72e4093192f,6f1435e90b8..30c9137629b
--- a/source/blender/blenkernel/intern/brush.cc
+++ b/source/blender/blenkernel/intern/brush.cc
@@@ -60,12 -54,9 +60,12 @@@ static void brush_init_data(ID *id
  
    /* the default alpha falloff curve */
    BKE_brush_curve_preset(brush, CURVE_PRESET_SMOOTH);
 +
 +  brush->channels = BKE_brush_channelset_create();
 +  BKE_brush_channelset_ensure_channels(brush->channels, PAINT_MODE_INVALID, 0);
  }
  
- static void brush_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int flag)
+ static void brush_copy_data(Main * /*bmain*/, ID *id_dst, const ID *id_src, const int flag)
  {
    Brush *brush_dst = (Brush *)id_dst;
    const Brush *brush_src = (const Brush *)id_src;
diff --cc source/blender/blenkernel/intern/scene.cc
index 6bff0e1bea6,bd26075f81f..3870c6a677f
--- a/source/blender/blenkernel/intern/scene.cc
+++ b/source/blender/blenkernel/intern/scene.cc
@@@ -137,9 -162,8 +163,9 @@@ static void scene_init_data(ID *id
                       CURVEMAP_SLOPE_POS_NEG);
  
    scene->toolsettings = DNA_struct_default_alloc(ToolSettings);
 +  BKE_brush_channelset_toolsettings_init(scene->toolsettings);
  
-   scene->toolsettings->autokey_mode = (uchar)U.autokey_mode;
+   scene->toolsettings->autokey_mode = uchar(U.autokey_mode);
  
    /* Grease pencil multi-frame falloff curve. */
    scene->toolsettings->gp_sculpt.cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
diff --cc source/blender/editors/sculpt_paint/sculpt.c
index af0ae2451dc,95192114429..17f564c3051
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@@ -12,18 -12,10 +12,13 @@@
  #include "BLI_dial_2d.h"
  #include "BLI_ghash.h"
  #include "BLI_gsqueue.h"
- #include "BLI_hash.h"
  #include "BLI_math.h"
- #include "BLI_math_color.h"
- #include "BLI_math_color_blend.h"
 +#include "BLI_rand.h"
  #include "BLI_task.h"
  #include "BLI_utildefines.h"
  
- #include "BLT_translation.h"
- 
 +#include "PIL_time.h"
 +
  #include "DNA_brush_types.h"
  #include "DNA_customdata_types.h"
  #include "DNA_mesh_types.h"
@@@ -5197,8 -5213,8 +5261,8 @@@ static void sculpt_restore_mesh(Scene *
  
    /* Restore the mesh before continuing with anchored stroke. */
    if ((brush->flag & BRUSH_ANCHORED) ||
-       ((ELEM(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_ELASTIC_DEFORM)) &&
+       (ELEM(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_ELASTIC_DEFORM) &&
 -       BKE_brush_use_size_pressure(brush)) ||
 +       BKE_brush_use_size_pressure(scene, brush)) ||
        (brush->flag & BRUSH_DRAG_DOT)) {
  
      SculptUndoNode *unode = SCULPT_undo_get_first_node();
diff --cc source/blender/editors/sculpt_paint/sculpt_intern.h
index 36df71bba8d,bf47b64d176..878932bce6d
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@@ -36,8 -35,9 +37,11 @@@ struct Object
  struct SculptUndoNode;
  struct bContext;
  struct PaintModeSettings;
 +struct RNG;
 +struct BrushChannelSet;
+ struct wmKeyConfig;
+ struct wmOperator;
+ struct wmOperatorType;
  
  /* Updates */
  
@@@ -641,10 -645,7 +650,12 @@@ typedef struct StrokeCache 
    rcti previous_r; /* previous redraw rectangle */
    rcti current_r;  /* current redraw rectangle */
  
+   int stroke_id;
++
 +  struct BrushChannelSet *channels;
 +  struct RNG *rng;
 +  float angle, speed;
 +  BrushMappingData mapdata;
  } StrokeCache;
  
  /* -------------------------------------------------------------------- */
diff --cc source/blender/makesdna/DNA_brush_types.h
index 6bc718fe98d,a415122579e..48b41fe7083
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@@ -383,7 -389,10 +390,12 @@@ typedef struct Brush 
    struct BrushGpencilSettings *gpencil_settings;
    struct BrushCurvesSculptSettings *curves_sculpt_settings;
  
+   int automasking_cavity_blur_steps;
+   float automasking_cavity_factor;
+ 
+   struct CurveMapping *automasking_cavity_curve;
++
 +  struct BrushChannelSet *channels;
  } Brush;
  
  /* Struct to hold palette colors for sorting. */
diff --cc source/blender/makesrna/intern/rna_brush.c
index 42dcd60a9ba,35e01be366b..b986b720447
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@@ -765,11 -785,9 +787,11 @@@ static void rna_Brush_set_size(PointerR
    /* scale unprojected radius so it stays consistent with brush size */
    BKE_brush_scale_unprojected_radius(&brush->unprojected_radius, value, brush->size);
    brush->size = value;
 +
 +  BKE_brush_channelset_mark_update(brush->channels, size);
  }
  
- static void rna_Brush_use_gradient_set(PointerRNA *ptr, bool value)
+ static void rna_Brush_use_gradient_set(PointerRNA *ptr, int value)
  {
    Brush *br = (Brush *)ptr->data;
  
diff --cc source/blender/makesrna/intern/rna_path.cc
index 6e08b8837da,e3898bbd682..ec5812cc4c5
--- a/source/blender/makesrna/intern/rna_path.cc
+++ b/source/blender/makesrna/intern/rna_path.cc
@@@ -345,20 -346,19 +346,20 @@@ static bool rna_path_parse_array_index(
   *
   * \return \a true on success, \a false if the path is somehow invalid.
   */
 -static bool rna_path_parse(const PointerRNA *ptr,
 -                           const char *path,
 -                           PointerRNA *r_ptr,
 -                           PropertyRNA **r_prop,
 -                           int *r_index,
 -                           PointerRNA *r_item_ptr,
 -                           ListBase *r_elements,
 -                           const bool eval_pointer)
 +#include "BKE_brush_channel.h"
 +ATTR_NO_OPT static bool rna_path_parse(const PointerRNA *ptr,
 +                                       const char *path,
 +                                       PointerRNA *r_ptr,
 +                                       PropertyRNA **r_prop,
 +                                       int *r_index,
 +                                       PointerRNA *r_item_ptr,
 +                                       ListBase *r_elements,
 +                                       const bool eval_pointer)
  {
-   BLI_assert(r_item_ptr == NULL || !eval_pointer);
+   BLI_assert(r_item_ptr == nullptr || !eval_pointer);
    PropertyRNA *prop;
    PointerRNA curptr, nextptr;
-   PropertyElemRNA *prop_elem = NULL;
+   PropertyElemRNA *prop_elem = nullptr;
    int index = -1;
    char fixedbuf[256];
    int type;



More information about the Bf-blender-cvs mailing list