[Bf-blender-cvs] [2d3d6eb7b2a] sculpt-dev: Merge remote-tracking branch 'origin/temp_bmesh_multires' into sculpt-dev

Joseph Eagar noreply at git.blender.org
Sat Sep 18 08:32:30 CEST 2021


Commit: 2d3d6eb7b2a9be40aa5f383a1ff57ef37debc197
Author: Joseph Eagar
Date:   Fri Sep 17 23:32:08 2021 -0700
Branches: sculpt-dev
https://developer.blender.org/rB2d3d6eb7b2a9be40aa5f383a1ff57ef37debc197

Merge remote-tracking branch 'origin/temp_bmesh_multires' into sculpt-dev

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



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

diff --cc release/scripts/startup/bl_ui/properties_paint_common.py
index 63032b64c63,bc76f338c38..bf29c3f8159
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@@ -756,20 -827,17 +829,28 @@@ def brush_settings(layout, context, bru
              col.prop(brush, "use_multiplane_scrape_dynamic")
              col.prop(brush, "show_multiplane_scrape_planes_preview")
  
 +        elif sculpt_tool == 'SCENE_PROJECT':
 +            col = layout.column()
 +            col.prop(brush, "scene_project_direction_type")
 +
 +        elif sculpt_tool == 'ARRAY':
 +            col = layout.column()
 +            col.prop(brush, "array_deform_type")
 +            col.prop(brush, "array_count")
 +            col.prop(brush, "use_array_lock_orientation")
 +            col.prop(brush, "use_array_fill_holes")
 +
          elif sculpt_tool == 'SMOOTH':
              col = layout.column()
+             col.prop(brush, "boundary_smooth_factor")
+ 
+             col.prop(brush, "use_weighted_smooth")
+             col.prop(brush, "preserve_faceset_boundary")
+             if brush.preserve_faceset_boundary:
+                 col.prop(brush, "autosmooth_fset_slide")
+ 
              col.prop(brush, "smooth_deform_type")
+ 
              if brush.smooth_deform_type == 'SURFACE':
                  col.prop(brush, "surface_smooth_shape_preservation")
                  col.prop(brush, "surface_smooth_current_vertex")
diff --cc release/scripts/startup/bl_ui/space_view3d_toolbar.py
index f9f5aa00f29,7f9918fd9b9..92a0c69f00c
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@@ -866,9 -940,8 +941,10 @@@ class VIEW3D_PT_sculpt_options(Panel, V
          col = layout.column(heading="Display", align=True)
          col.prop(sculpt, "show_low_resolution")
          col.prop(sculpt, "use_sculpt_delay_updates")
+         col.prop(sculpt, "use_fast_draw")
          col.prop(sculpt, "use_deform_only")
 +        col.prop(sculpt, "show_sculpt_pivot")
 +        col.prop(sculpt, "smooth_strength_factor")
  
          col.separator()
  
diff --cc source/blender/blenkernel/BKE_paint.h
index 11bf40dfa55,22362b34548..c207c816515
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@@ -32,6 -34,7 +34,8 @@@
  extern "C" {
  #endif
  
++struct SculptCustomLayer;
+ struct MDynTopoVert;
  struct BMFace;
  struct BMesh;
  struct BlendDataReader;
@@@ -440,62 -458,8 +468,61 @@@ typedef struct SculptBoundary 
      float rotation_axis[3];
      float pivot_position[3];
    } twist;
 +
 +  /* Cicrle Deform type. */
 +  struct {
 +    float (*origin)[3];
 +    float *radius;
 +  } circle;
  } SculptBoundary;
  
 +/* Array Brush. */
 +typedef struct SculptArrayCopy {
 +  int index;
 +  int symm_pass;
 +  float mat[4][4];
 +  float imat[4][4];
 +  float origin[3];
 +} SculptArrayCopy;
 +
 +typedef struct ScultpArrayPathPoint {
 +  float length;
 +  float strength;
 +  float co[3];
 +  float orco[3];
 +  float direction[3];
 +} ScultpArrayPathPoint;
 +
 +typedef struct SculptArray {
 +  SculptArrayCopy *copies[PAINT_SYMM_AREAS];
 +  int num_copies;
 +
- 
 +  struct {
-     ScultpArrayPathPoint * points;
++    ScultpArrayPathPoint *points;
 +    int tot_points;
 +    int capacity;
 +    float total_length;
 +  } path;
-   
++
 +  int mode;
 +  float normal[3];
 +  float direction[3];
 +  float radial_angle;
 +  float initial_radial_angle;
 +
 +  bool source_mat_valid;
 +  float source_origin[3];
 +  float source_mat[4][4];
 +  float source_imat[4][4];
 +  float (*orco)[3];
 +
 +  int *copy_index;
 +  int *symmetry_pass;
 +
 +  float *smooth_strength;
 +
 +} SculptArray;
 +
  typedef struct SculptFakeNeighbors {
    bool use_fake_neighbors;
  
@@@ -572,10 -548,6 +611,10 @@@ typedef struct SculptSession 
    bool show_mask;
    bool show_face_sets;
  
 +  /* Setting this to true allows a PBVH rebuild when evaluating the object even if the stroke or
-   * filter caches are active. */
++   * filter caches are active. */
 +  bool needs_pbvh_rebuild;
 +
    /* Painting on deformed mesh */
    bool deform_modifiers_active; /* Object is deformed with some modifiers. */
    float (*orig_cos)[3];         /* Coords of un-deformed mesh. */
@@@ -616,14 -587,12 +655,17 @@@
    struct RegionView3D *rv3d;
    struct View3D *v3d;
    struct Scene *scene;
+   int cd_origvcol_offset;
+   int cd_origco_offset;
+   int cd_origno_offset;
  
 +  /* Face Sets by topology. */
 +  int face_set_last_created;
-   int face_set_last_poly;
-   int face_set_last_edge;
++  SculptFaceRef face_set_last_poly;
++  SculptEdgeRef face_set_last_edge;
 +
    /* Dynamic mesh preview */
-   int *preview_vert_index_list;
+   SculptVertRef *preview_vert_index_list;
    int preview_vert_index_count;
  
    /* Pose Brush Preview */
@@@ -637,9 -606,6 +679,9 @@@
    /* This is freed with the PBVH, so it is always in sync with the mesh. */
    SculptPersistentBase *persistent_base;
  
- 
-   float (*limit_surface)[3];
++  // float (*limit_surface)[3];
++  struct SculptCustomLayer *limit_surface;
 +
    SculptVertexInfo vertex_info;
    SculptFakeNeighbors fake_neighbors;
  
diff --cc source/blender/blenkernel/BKE_pbvh.h
index 6e91b331ce4,663e7f8d7f7..0e1c440c5c7
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@@ -31,8 -35,80 +35,80 @@@
  extern "C" {
  #endif
  
+ // experimental feature to detect quad diagonals and mark (but not dissolve) them
+ //#define SCULPT_DIAGONAL_EDGE_MARKS
+ 
+ typedef struct SculptVertRef {
+   intptr_t i;
+ } SculptVertRef;
+ 
+ typedef struct SculptEdgeRef {
+   intptr_t i;
+ } SculptEdgeRef;
+ 
+ typedef struct SculptFaceRef {
+   intptr_t i;
+ } SculptFaceRef;
+ 
++#define SCULPT_REF_NONE ((intptr_t)-1)
++
+ #if 0
+ typedef struct SculptLoopRef {
+   intptr_t i;
+ } SculptLoopRef;
+ #endif
+ 
+ BLI_INLINE SculptVertRef BKE_pbvh_make_vref(intptr_t i)
+ {
+   SculptVertRef ret = {i};
+   return ret;
+ }
+ 
+ BLI_INLINE SculptEdgeRef BKE_pbvh_make_eref(intptr_t i)
+ {
+   SculptEdgeRef ret = {i};
+   return ret;
+ }
+ 
+ BLI_INLINE SculptFaceRef BKE_pbvh_make_fref(intptr_t i)
+ {
+   SculptFaceRef ret = {i};
+   return ret;
+ }
+ 
 -#define SCULPT_REF_NONE ((intptr_t)-1)
 -
+ #ifdef DEFRAGMENT_MEMORY
+ #  include "BLI_smallhash.h"
+ #endif
+ 
+ typedef struct PBVHTri {
+   int v[3];       // references into PBVHTriBuf->verts
+   intptr_t l[3];  // loops
+   int eflag;      // bitmask of which edges in the tri are real edges in the mesh
+ 
+   float no[3];
+   SculptFaceRef f;
+ } PBVHTri;
+ 
+ typedef struct PBVHTriBuf {
+   PBVHTri *tris;
+   SculptVertRef *verts;
+   int *edges;
+   int totvert, totedge, tottri;
+   int verts_size, edges_size, tris_size;
+ 
+   SmallHash vertmap;  // maps vertex ptrs to indices within verts
+ 
+   // private field
+   intptr_t *loops;
+   int totloop, mat_nr;
+   float min[3], max[3];
+ } PBVHTriBuf;
+ 
  struct BMLog;
  struct BMesh;
+ struct BMVert;
+ struct BMEdge;
+ struct BMFace;
  struct CCGElem;
  struct CCGKey;
  struct CustomData;
@@@ -41,6 -118,6 +118,7 @@@ struct GPU_PBVH_Buffers
  struct IsectRayPrecalc;
  struct MLoop;
  struct MLoopTri;
++struct MDynTopoVert;
  struct MPoly;
  struct MVert;
  struct Mesh;
@@@ -159,14 -353,14 +354,16 @@@ bool BKE_pbvh_node_raycast(PBVH *pbvh
                             const float ray_start[3],
                             const float ray_normal[3],
                             struct IsectRayPrecalc *isect_precalc,
 +                           int *hit_count,
                             float *depth,
 +                           float *back_depth,
-                            int *active_vertex_index,
-                            int *active_face_grid_index,
-                            float *face_normal);
+                            SculptVertRef *active_vertex_index,
+                            SculptFaceRef *active_face_grid_index,
+                            float *face_normal,
+                            int stroke_id);
  
- bool BKE_pbvh_bmesh_node_raycast_detail(PBVHNode *node,
+ bool BKE_pbvh_bmesh_node_raycast_detail(PBVH *pbvh,
+                                         PBVHNode *node,
                                          const float ray_start[3],
                                          struct IsectRayPrecalc *isect_precalc,
                                          float *depth,
@@@ -462,6 -726,14 +729,18 @@@ void pbvh_vertex_iter_init(PBVH *pbvh, 
    } \
    ((void)0)
  
+ #define BKE_pbvh_vertex_index_to_table(pbvh, v) \
+   (BKE_pbvh_type(pbvh) == PBVH_BMESH && v.i != -1 ? BM_elem_index_get((BMVert *)(v.i)) : (v.i))
+ SculptVertRef BKE_pbvh_table_index_to_vertex(PBVH *pbvh, int idx);
+ 
++#define BKE_pbvh_edge_index_to_table(pbvh, v) \
++  (BKE_pbvh_type(pbvh) == PBVH_BMESH && v.i != -1 ? BM_elem_index_get((BMEdge *)(v.i)) : (v.i))
++SculptEdgeRef BKE_pbvh_table_index_to_edge(PBVH *pbvh, int idx);
++
+ #define BKE_pbvh_face_index_to_table(pbvh, v) \
+   (BKE_pbvh_type(pbvh) == PBVH_BMESH && v.i != -1 ? BM_elem_index_get((BMFace *)(v.i)) : (v.i))
+ SculptFaceRef BKE_pbvh_table_index_to_face(PBVH *pbvh, int idx);
+ 
  void BKE_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count);
  void BKE_pbvh_node_free_proxies(PBVHNode *node);
  PBVHProxyNode *BKE_pbvh_node_add_proxy(PBVH *pbvh, PBVHNode *node);
diff --cc source/blender/blenkernel/intern/brush.c
index 0f3442ca0a9,78fc0b54f5f..72e1a1fcce3
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@@ -221,7 -218,7 +222,7 @@@ static void brush_foreach_id(ID *id, Li
    BKE_texture_mtex_foreach_id(data, &brush->mask_mtex);
  }
  
--static void brush_blend_write(BlendWriter *writer, ID *id, const void *id_address)
++ATTR_NO_OPT static void brush_blend_write(BlendWriter *writer, ID *id, const void *id_address)
  {
    Brush *brush = (Brush *)id;
  
@@@ -272,35 -263,13 +273,39 @@@
    if (brush->gradient) {
      BLO_write_struct(writer, ColorBand, brush->gradient);
    }
+ 
+   if (brush->channels) {
+     BKE_brush_channelset_write(writer, brush->channels);
+   }
  }
  
 -ATTR_NO_OPT static

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list