[Bf-blender-cvs] [e5fcaa293a7] sculpt-dev: sculpt-dev: fix merge errors

Joseph Eagar noreply at git.blender.org
Thu Oct 6 05:02:08 CEST 2022


Commit: e5fcaa293a7346efedce0e4dfdbb6768c7534e43
Author: Joseph Eagar
Date:   Wed Oct 5 20:01:48 2022 -0700
Branches: sculpt-dev
https://developer.blender.org/rBe5fcaa293a7346efedce0e4dfdbb6768c7534e43

sculpt-dev: fix merge errors

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

M	release/scripts/startup/bl_ui/properties_data_mesh.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/blenkernel/BKE_paint.h
M	source/blender/blenkernel/BKE_pbvh.h
M	source/blender/blenkernel/intern/brush_channel_define.h
M	source/blender/blenkernel/intern/brush_engine.c
M	source/blender/blenkernel/intern/brush_engine_presets.c
M	source/blender/blenkernel/intern/paint.cc
M	source/blender/blenkernel/intern/pbvh.c
M	source/blender/blenkernel/intern/pbvh_bmesh.c
M	source/blender/draw/DRW_pbvh.h
M	source/blender/draw/intern/draw_debug.cc
M	source/blender/draw/intern/draw_pbvh.cc
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_cloth.c
M	source/blender/editors/sculpt_paint/sculpt_dyntopo.c
M	source/blender/editors/sculpt_paint/sculpt_face_set.cc
M	source/blender/editors/sculpt_paint/sculpt_filter_color.c
M	source/blender/editors/sculpt_paint/sculpt_filter_mask.c
M	source/blender/editors/sculpt_paint/sculpt_ops.c
M	source/blender/editors/sculpt_paint/sculpt_undo.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index b1025afe7d3..87c565a190d 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -534,8 +534,15 @@ class MESH_UL_attributes(UIList):
         flags = []
         indices = [i for i in range(len(attributes))]
 
+        show_all = _context.tool_settings.save_temp_layers if hasattr(_context, "tool_settings") else False
+
         for item in attributes:
-            flags.append(self.bitflag_filter_item if item.is_internal else 0)
+            if show_all:
+                flags.append(self.bitflag_filter_item)
+            else:
+                flags.append(0)
+
+        print("items!", list(attributes), flags)
 
         return flags, indices
 
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index b00ac1e9629..e430b15709d 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1412,17 +1412,8 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
         col.prop(sculpt, "use_automasking_start_normal", text="Area Normal")
         col.prop(sculpt, "use_automasking_view_normal", text="View Normal")
 
-        UnifiedPaintPanel.channel_unified(layout.column(),
-            context,
-            brush,
-            "show_origco",
-            toolsettings_only=True, ui_editing=False)
-
-        UnifiedPaintPanel.channel_unified(layout.column(),
-            context,
-            brush,
-            "save_temp_layers",
-            toolsettings_only=True, ui_editing=False)
+        layout.prop(context.tool_settings, "show_origco")
+        layout.prop(context.tool_settings, "save_temp_layers")
 
         col.separator()
 
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index a83df6163e5..286b1f17b34 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -444,6 +444,7 @@ typedef struct SculptClothSimulation {
 
   float (*pos)[3];
   float (*init_pos)[3];
+  float (*init_no)[3];
   float (*softbody_pos)[3];
 
   /* Position anchors for deformation brushes. These positions are modified by the brush and the
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h
index 4f0079b1840..8b8a3ac73a1 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -663,6 +663,7 @@ void BKE_pbvh_node_mark_update(PBVHNode *node);
 void BKE_pbvh_node_mark_update_mask(PBVHNode *node);
 void BKE_pbvh_node_mark_update_color(PBVHNode *node);
 void BKE_pbvh_vert_tag_update_normal_visibility(PBVHNode *node);
+void BKE_pbvh_node_mark_update_visibility(PBVHNode *node);
 void BKE_pbvh_node_mark_rebuild_draw(PBVHNode *node);
 void BKE_pbvh_node_mark_redraw(PBVHNode *node);
 void BKE_pbvh_node_mark_normals_update(PBVHNode *node);
diff --git a/source/blender/blenkernel/intern/brush_channel_define.h b/source/blender/blenkernel/intern/brush_channel_define.h
index 2d78d76dbec..c59ecd7454b 100644
--- a/source/blender/blenkernel/intern/brush_channel_define.h
+++ b/source/blender/blenkernel/intern/brush_channel_define.h
@@ -203,8 +203,6 @@ MAKE_ENUM(blend,"Blending Mode","Brush blending mode",IMB_BLEND_MIX,{\
   MAKE_FLOAT(hardness,"Hardness","Brush falloff hardness",0.0f,0.0f,1.0f)
   MAKE_FLOAT(tip_roundness,"Tip Roundness","",1.0f,0.0f,1.0f)
   MAKE_BOOL(accumulate,"Accumulate","",false)
-  MAKE_BOOL_EX(show_origco,"Show OrigCo","",false,BRUSH_CHANNEL_INHERIT)
-  MAKE_BOOL_EX(save_temp_layers,"Save Temp Layers","Developer option; save temporary vertex attributes",false,BRUSH_CHANNEL_INHERIT)
   MAKE_ENUM(direction,"Direction","",0,{\
         {0, "ADD", "ADD", "Add", "Add effect of brush"},
         {1, "SUBTRACT", "REMOVE", "Subtract", "Subtract effect of brush"},
diff --git a/source/blender/blenkernel/intern/brush_engine.c b/source/blender/blenkernel/intern/brush_engine.c
index fd40215ff99..1dc82f44603 100644
--- a/source/blender/blenkernel/intern/brush_engine.c
+++ b/source/blender/blenkernel/intern/brush_engine.c
@@ -2085,7 +2085,7 @@ void BKE_brush_channelset_read(BlendDataReader *reader, BrushChannelSet *chset)
     ch->def = BKE_brush_builtin_channel_def_find(ch->idname);
 
     if (!ch->def) {
-      printf("failed to find brush definition for %s\n", ch->idname);
+      //printf("failed to find brush definition for %s\n", ch->idname);
       ch->def = BKE_brush_default_channel_def();
     }
     else {
diff --git a/source/blender/blenkernel/intern/brush_engine_presets.c b/source/blender/blenkernel/intern/brush_engine_presets.c
index 8f6a7dcf379..48c076b9e7a 100644
--- a/source/blender/blenkernel/intern/brush_engine_presets.c
+++ b/source/blender/blenkernel/intern/brush_engine_presets.c
@@ -1167,8 +1167,6 @@ void BKE_brush_builtin_patch(Brush *brush, int tool)
   }
 
   ADDCH(sharp_mode);
-  ADDCH(show_origco);
-  ADDCH(save_temp_layers);
 
   ADDCH(use_surface_falloff);
 
@@ -2151,9 +2149,6 @@ void BKE_brush_check_toolsettings(Sculpt *sd)
   ADDCH(radius_unit);
   ADDCH(unprojected_radius);
 
-  ADDCH(show_origco);
-  ADDCH(save_temp_layers);
-
   ADDCH(smooth_strength_factor);
   ADDCH(smooth_strength_projection);
 
diff --git a/source/blender/blenkernel/intern/paint.cc b/source/blender/blenkernel/intern/paint.cc
index 34b316514ce..4fd53a341ef 100644
--- a/source/blender/blenkernel/intern/paint.cc
+++ b/source/blender/blenkernel/intern/paint.cc
@@ -1763,8 +1763,8 @@ static void sculpt_update_object(
   ss->building_vp_handle = false;
 
   ss->scene = scene;
-  if (sd->channels) {
-    ss->save_temp_layers = BRUSHSET_GET_INT(sd->channels, save_temp_layers, NULL);
+  if (sd->channels && scene->toolsettings) {
+    ss->save_temp_layers = scene->toolsettings->save_temp_layers;
   }
 
   ss->boundary_symmetry = (int)BKE_get_fset_boundary_symflag(ob);
@@ -3277,8 +3277,9 @@ static bool sculpt_attribute_create(SculptSession *ss,
       BM_data_layer_add_named(ss->bm, cdata, proptype, name);
       int index = CustomData_get_named_layer_index(cdata, proptype, name);
 
-      if (!permanent) {
+      if (!permanent && !ss->save_temp_layers) {
         cdata->layers[index].flag |= CD_FLAG_TEMPORARY | CD_FLAG_NOCOPY;
+        out->params.permanent = true;
       }
 
       out->data = nullptr;
@@ -3309,7 +3310,8 @@ static bool sculpt_attribute_create(SculptSession *ss,
       CustomData_add_layer_named(cdata, proptype, CD_SET_DEFAULT, nullptr, totelem, name);
       int index = CustomData_get_named_layer_index(cdata, proptype, name);
 
-      if (!permanent) {
+      if (!permanent && !ss->save_temp_layers) {
+        out->params.permanent = true;
         cdata->layers[index].flag |= CD_FLAG_TEMPORARY | CD_FLAG_NOCOPY;
       }
 
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 557f267da7c..bbdf4158734 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -649,6 +649,7 @@ static void pbvh_draw_args_init(PBVH *pbvh, PBVH_GPU_Args *args, PBVHNode *node)
   args->flat_vcol_shading = pbvh->flat_vcol_shading;
   args->show_orig = pbvh_show_orig_co;
   args->updategen = node->updategen;
+  args->msculptverts = pbvh->msculptverts;
 
   if (ELEM(pbvh->header.type, PBVH_FACES, PBVH_GRIDS)) {
     args->hide_poly = pbvh->pdata ?
@@ -1589,7 +1590,7 @@ void BKE_pbvh_set_flat_vcol_shading(PBVH *pbvh, bool value)
   pbvh->flat_vcol_shading = value;
 }
 
-void pbvh_free_draw_buffers(PBVH *UNUSED(pbvh), PBVHNode *node)
+ATTR_NO_OPT void pbvh_free_draw_buffers(PBVH *UNUSED(pbvh), PBVHNode *node)
 {
   if (node->draw_batches) {
     DRW_pbvh_node_free(node->draw_batches);
@@ -2033,6 +2034,12 @@ void BKE_pbvh_mark_rebuild_pixels(PBVH *pbvh)
   }
 }
 
+void BKE_pbvh_node_mark_update_visibility(PBVHNode *node)
+{
+  node->flag |= PBVH_UpdateVisibility | PBVH_RebuildDrawBuffers | PBVH_UpdateDrawBuffers |
+                PBVH_UpdateRedraw;
+}
+
 void BKE_pbvh_vert_tag_update_normal_visibility(PBVHNode *node)
 {
   node->flag |= PBVH_UpdateVisibility | PBVH_RebuildDrawBuffers | PBVH_UpdateDrawBuffers |
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index a40b6522e76..d0e45115438 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -240,6 +240,8 @@ static void pbvh_bmesh_node_finalize(PBVH *pbvh,
   PBVHNode *n = &pbvh->nodes[node_index];
   bool has_visible = false;
 
+  n->draw_batches = NULL;
+
   /* Create vert hash sets */
   if (!n->bm_unique_verts) {
     n->bm_unique_verts = BLI_table_gset_new("bm_unique_verts");
@@ -409,6 +411,7 @@ static void pbvh_bmesh_node_split(
   /* Initialize children */
   PBVHNode *c1 = &pbvh->nodes[children], *c2 = &pbvh->nodes[children + 1];
 
+  c1->draw_batches = c2->draw_batches = NULL;
   c1->depth = c2->depth = n->depth + 1;
 
   c1->flag |= PBVH_Leaf;
@@ -509,6 +512,7 @@ static void pbvh_bmesh_node_split(
 
   if (n->draw_batches) {
     DRW_pbvh_node_free(n->draw_batches);
+    n->draw_batches = NULL;
   }
   n->flag &= ~PBVH_Leaf;
 
@@ -3311,6 +3315,7 @@ static void pbvh_bmesh_compact_tree(PBVH *bvh)
           n3->bm_other_verts = BLI_table_gset_new("bm_other_verts");
           n3->bm_faces = BLI_table_gset_new("bm_faces");
           n3->tribuf = NULL;
+          n3->draw_batches = NULL;
         }
         else if ((n1->flag & PBVH_Delete) && (n2->flag & PBVH_Delete)) {
           n->children_offset = 0;
@@ -3322,6 +3327,7 @@ static void pbvh_bmesh_compact_tree(PBVH *bvh)
             n->bm_other_verts = BLI_table_gset_new("bm_other_verts");
             n->bm_faces = BLI_table_gset_new("bm_faces");
             n->tribuf = NULL;
+            n->draw_batches = NULL;
           }
         }
       }
@@ -3692,7 +3698,7 @@ static void pbvh_bmesh_balance_tree(PBVH *pbvh)
   MEM_SAFE_FREE(depthmap);
 }
 
-static void pbvh_bmesh_join_nodes(PBVH *bvh)
+ATTR_NO_OPT static void pbvh_bmesh_join_nodes(PBVH *bvh)
 {
   if (bvh->totnode < 2) {
     r

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list