[Bf-blender-cvs] [1d80f1a2b57] sculpt-dev: Merge branch 'master' into sculpt-dev

Joseph Eagar noreply at git.blender.org
Wed Oct 20 18:20:43 CEST 2021


Commit: 1d80f1a2b578bece05d27a1dc9d19a1392d4de95
Author: Joseph Eagar
Date:   Wed Oct 20 09:20:19 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rB1d80f1a2b578bece05d27a1dc9d19a1392d4de95

Merge branch 'master' into sculpt-dev

Also fixed bug with face set lasso
and face set from mask.

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



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

diff --cc release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 03fb87a1905,3ba848e6caf..bfd3a772815
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@@ -2351,17 -2672,23 +2351,17 @@@ def km_text(params)
  
  def km_sequencercommon(params):
      items = []
 -    keymap = (
 -        "SequencerCommon",
 +    keymap = ("SequencerCommon",
          {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'},
 -        {"items": items},
 -    )
 +        {"items": items},)
  
 -    items.extend([
 -        *_template_space_region_type_toggle(
 -            toolbar_key={"type": 'T', "value": 'PRESS'},
 -            sidebar_key={"type": 'N', "value": 'PRESS'},
 -        ),
 +    items.extend([*_template_space_region_type_toggle(toolbar_key={"type": 'T', "value": 'PRESS'},
 +            sidebar_key={"type": 'N', "value": 'PRESS'},),
          ("wm.context_toggle", {"type": 'O', "value": 'PRESS', "shift": True},
-          {"properties": [("data_path", 'scene.sequence_editor.show_overlay')]}),
+          {"properties": [("data_path", 'scene.sequence_editor.show_overlay_frame')]}),
          ("wm.context_toggle_enum", {"type": 'TAB', "value": 'PRESS', "ctrl": True},
           {"properties": [("data_path", 'space_data.view_type'), ("value_1", 'SEQUENCER'), ("value_2", 'PREVIEW')]}),
 -        ("sequencer.refresh_all", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),
 -    ])
 +        ("sequencer.refresh_all", {"type": 'R', "value": 'PRESS', "ctrl": True}, None),])
  
      if params.select_mouse == 'LEFTMOUSE' and not params.legacy:
          # Quick switch to select tool, since left select can't easily
@@@ -4403,22 -5005,32 +4403,25 @@@ def km_sculpt(params)
  # Mesh edit mode.
  def km_mesh(params):
      items = []
 -    keymap = (
 -        "Mesh",
 +    keymap = ("Mesh",
          {"space_type": 'EMPTY', "region_type": 'WINDOW'},
 -        {"items": items},
 -    )
 +        {"items": items},)
  
 -    items.extend([
 -        # Tools.
 -        op_tool_optional(
 -            ("mesh.loopcut_slide", {"type": 'R', "value": 'PRESS', "ctrl": True},
 +    items.extend([# Tools.
 +        op_tool_optional(("mesh.loopcut_slide", {"type": 'R', "value": 'PRESS', "ctrl": True},
               {"properties": [("TRANSFORM_OT_edge_slide", [("release_confirm", False)],)]}),
              (op_tool_cycle, "builtin.loop_cut"), params),
 -        op_tool_optional(
 -            ("mesh.offset_edge_loops_slide", {"type": 'R', "value": 'PRESS', "shift": True, "ctrl": True},
 +        op_tool_optional(("mesh.offset_edge_loops_slide", {"type": 'R', "value": 'PRESS', "shift": True, "ctrl": True},
               {"properties": [("TRANSFORM_OT_edge_slide", [("release_confirm", False)],)]}),
              (op_tool_cycle, "builtin.offset_edge_loop_cut"), params),
 -        op_tool_optional(
 -            ("mesh.inset", {"type": 'I', "value": 'PRESS'}, None),
 +        op_tool_optional(("mesh.inset", {"type": 'I', "value": 'PRESS'}, None),
              (op_tool_cycle, "builtin.inset_faces"), params),
 -        op_tool_optional(
 -            ("mesh.bevel", {"type": 'B', "value": 'PRESS', "ctrl": True},
 +        op_tool_optional(("mesh.bevel", {"type": 'B', "value": 'PRESS', "ctrl": True},
               {"properties": [("affect", 'EDGES')]}),
              (op_tool_cycle, "builtin.bevel"), params),
+         op_tool_optional(
+             ("transform.shrink_fatten", {"type": 'S', "value": 'PRESS', "alt": True}, None),
+             (op_tool_cycle, "builtin.shrink_fatten"), params),
          ("mesh.bevel", {"type": 'B', "value": 'PRESS', "shift": True, "ctrl": True},
           {"properties": [("affect", 'VERTICES')]}),
          # Selection modes.
diff --cc source/blender/blenkernel/BKE_paint.h
index c09ce15f6ab,6fc5ef4d870..2a974c0841c
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@@ -714,9 -538,8 +714,9 @@@ typedef struct SculptSession 
    float cursor_sampled_normal[3];
    float cursor_view_normal[3];
  
-   /* For Sculpt trimming gesture tools, initial raycast data from the position of the mouse when
+   /* For Sculpt trimming gesture tools, initial ray-cast data from the position of the mouse when
     * the gesture starts (intersection with the surface and if they ray hit the surface or not). */
 +  float gesture_initial_back_location[3];
    float gesture_initial_location[3];
    float gesture_initial_normal[3];
    bool gesture_initial_hit;
diff --cc source/blender/blenkernel/BKE_pbvh.h
index b490ad70e2f,3a0e9d48af7..67281c3cf8b
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@@ -304,39 -124,12 +304,39 @@@ void BKE_pbvh_build_bmesh(PBVH *pbvh
                            bool smooth_shading,
                            struct BMLog *log,
                            const int cd_vert_node_offset,
 -                          const int cd_face_node_offset);
 +                          const int cd_face_node_offset,
 +                          const int cd_sculpt_vert,
 +                          const int cd_face_areas,
 +                          bool fast_draw);
 +void BKE_pbvh_update_offsets(PBVH *pbvh,
 +                             const int cd_vert_node_offset,
 +                             const int cd_face_node_offset,
 +                             const int cd_sculpt_vert,
 +                             const int cd_face_areas);
  void BKE_pbvh_free(PBVH *pbvh);
  
 +void BKE_pbvh_set_bm_log(PBVH *pbvh, struct BMLog *log);
 +
 +/** update original data, only data whose r_** parameters are passed in will be updated*/
 +void BKE_pbvh_bmesh_update_origvert(
 +    PBVH *pbvh, struct BMVert *v, float **r_co, float **r_no, float **r_color, bool log_undo);
 +void BKE_pbvh_update_origcolor_bmesh(PBVH *pbvh, PBVHNode *node);
 +void BKE_pbvh_update_origco_bmesh(PBVH *pbvh, PBVHNode *node);
 +
 +/**
 +checks if original data needs to be updated for v, and if so updates it.  Stroke_id
 +is provided by the sculpt code and is used to detect updates.  The reason we do it
 +inside the verts and not in the nodes is to allow splitting of the pbvh during the stroke.
 +*/
 +bool BKE_pbvh_bmesh_check_origdata(PBVH *pbvh, struct BMVert *v, int stroke_id);
 +
 +/** used so pbvh can differentiate between different strokes,
 +    see BKE_pbvh_bmesh_check_origdata */
 +void BKE_pbvh_set_stroke_id(PBVH *pbvh, int stroke_id);
 +
  /* Hierarchical Search in the BVH, two methods:
-  * - for each hit calling a callback
-  * - gather nodes in an array (easy to multithread) */
+  * - For each hit calling a callback.
+  * - Gather nodes in an array (easy to multi-thread). */
  
  void BKE_pbvh_search_callback(PBVH *pbvh,
                                BKE_pbvh_SearchCallback scb,
diff --cc source/blender/blenloader/intern/versioning_300.c
index ba77950bcb6,6b57bdf9a9c..b82e62acb51
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@@ -47,9 -47,8 +47,10 @@@
  
  #include "BKE_action.h"
  #include "BKE_animsys.h"
+ #include "BKE_armature.h"
  #include "BKE_asset.h"
 +#include "BKE_brush.h"
 +#include "BKE_brush_engine.h"
  #include "BKE_collection.h"
  #include "BKE_deform.h"
  #include "BKE_fcurve.h"
@@@ -1787,249 -1985,5 +2026,232 @@@ void blo_do_versions_300(FileData *fd, 
     */
    {
      /* Keep this block, even when empty. */
- 
-     /* Update the idname for the Assign Material Node to SetMaterial */
-     LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
-       if (ntree->type != NTREE_GEOMETRY) {
-         continue;
-       }
-       LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
-         if (node->type != GEO_NODE_SET_MATERIAL) {
-           continue;
-         }
-         if (strstr(node->idname, "SetMaterial")) {
-           /* Make sure we haven't changed this idname already. */
-           continue;
-         }
-         strcpy(node->idname, "GeometryNodeSetMaterial");
-       }
-     }
    }
 +
 +  if (!MAIN_VERSION_ATLEAST(bmain, 300, 24)) {
 +    LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
 +      // load old brush settings into channels
 +      if (brush->channels) {
 +        BKE_brush_channelset_free(brush->channels);
 +        brush->channels = NULL;
 +      }
 +
 +      BKE_brush_builtin_create(brush, brush->sculpt_tool);
 +      BKE_brush_channelset_compat_load(brush->channels, brush, true);
 +    }
 +  }
 +
 +  if (!MAIN_VERSION_ATLEAST(bmain, 300, 32)) {
 +    LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
 +      BKE_brush_channelset_ui_init(brush, brush->sculpt_tool);
 +
 +      if (ELEM(brush->sculpt_tool, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS) && brush->channels) {
 +        BRUSHSET_SET_BOOL(brush->channels, autosmooth_use_spacing, true);
 +        BRUSHSET_SET_FLOAT(brush->channels, autosmooth_spacing, 7.0f);
 +
 +        BRUSHSET_LOOKUP(brush->channels, radius)->mappings[BRUSH_MAPPING_PRESSURE].flag =
 +            BRUSH_MAPPING_ENABLED;
 +        BRUSHSET_LOOKUP(brush->channels, strength)->mappings[BRUSH_MAPPING_PRESSURE].flag =
 +            BRUSH_MAPPING_ENABLED;
 +
 +        if (brush->sculpt_tool == SCULPT_TOOL_CLAY_STRIPS) {
 +          if (BRUSHSET_GET_FLOAT(brush->channels, tip_roundness, NULL) == 0.0f) {
 +            BRUSHSET_SET_FLOAT(brush->channels, tip_roundness, 0.18f);
 +          }
 +
 +          BRUSHSET_LOOKUP(brush->channels, tip_roundness)->flag |= BRUSH_CHANNEL_SHOW_IN_WORKSPACE;
 +          BRUSHSET_SET_BOOL(brush->channels, use_space_attenuation, false);
 +        }
 +
 +        BRUSHSET_LOOKUP(brush->channels, plane_offset)->flag |= BRUSH_CHANNEL_SHOW_IN_WORKSPACE;
 +
 +        void reset_clay_mappings(BrushChannelSet * chset, bool strips);
 +        reset_clay_mappings(brush->channels, brush->sculpt_tool == SCULPT_TOOL_CLAY_STRIPS);
 +      }
 +    }
 +  }
 +
 +  if (!MAIN_VERSION_ATLEAST(bmain, 300, 33)) {
 +    LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
 +      if (brush->channels && brush->sculpt_tool == SCULPT_TOOL_SMOOTH) {
 +        BRUSHSET_SET_BOOL(brush->channels, dyntopo_disabled, true);
 +        BKE_brush_channelset_ui_

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list