[Bf-blender-cvs] [e0c35f0ac03] temp-sculpt-colors: Fix merge bugs
Joseph Eagar
noreply at git.blender.org
Sat Jan 29 21:54:37 CET 2022
Commit: e0c35f0ac03d79cc19c1166138516888748c8253
Author: Joseph Eagar
Date: Sat Jan 29 12:54:21 2022 -0800
Branches: temp-sculpt-colors
https://developer.blender.org/rBe0c35f0ac03d79cc19c1166138516888748c8253
Fix merge bugs
===================================================================
M source/blender/blenloader/intern/versioning_300.c
M source/blender/draw/intern/draw_cache_impl_mesh.c
M source/blender/editors/sculpt_paint/sculpt.c
M source/blender/editors/sculpt_paint/sculpt_undo.c
===================================================================
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 7734733540d..067ef30152a 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -1964,7 +1964,7 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
- if (!MAIN_VERSION_ATLEAST(bmain, 300, 26)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 302, 0)) {
LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
/* buggy code in wm_toolsystem broke smear in old files,
reset to defaults*/
@@ -2376,7 +2376,7 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
/* rebuild active/render color attribute references*/
- if (!MAIN_VERSION_ATLEAST(bmain, 301, 5)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 302, 0)) {
LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) {
for (int step = 0; step < 2; step++) {
CustomDataLayer *actlayer = NULL;
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index bd5db7719f8..7ed18a8968d 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -1248,11 +1248,11 @@ static void sculpt_request_active_vcol(MeshBatchCache *cache, Object *object, Me
DRW_MeshAttributes attrs_needed;
drw_mesh_attributes_clear(&attrs_needed);
- const Mesh *me_final = editmesh_final_or_this(me);
+ const Mesh *me_final = editmesh_final_or_this(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/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 45227b46d5a..22259d467ba 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4718,6 +4718,7 @@ static bool sculpt_needs_connectivity_info(const Sculpt *sd,
(brush->sculpt_tool == SCULPT_TOOL_POSE) ||
(brush->sculpt_tool == SCULPT_TOOL_BOUNDARY) ||
(brush->sculpt_tool == SCULPT_TOOL_SLIDE_RELAX) ||
+ SCULPT_TOOL_NEEDS_COLOR(brush->sculpt_tool) ||
(brush->sculpt_tool == SCULPT_TOOL_CLOTH) || (brush->sculpt_tool == SCULPT_TOOL_SMEAR) ||
(brush->sculpt_tool == SCULPT_TOOL_DRAW_FACE_SETS) ||
(brush->sculpt_tool == SCULPT_TOOL_DISPLACEMENT_SMEAR));
@@ -5077,7 +5078,7 @@ static void sculpt_brush_stroke_init(bContext *C, wmOperator *op)
SculptSession *ss = CTX_data_active_object(C)->sculpt;
Brush *brush = BKE_paint_brush(&sd->paint);
int mode = RNA_enum_get(op->ptr, "mode");
- bool is_smooth, needs_colors;
+ bool need_pmap, needs_colors;
bool need_mask = false;
if (brush->sculpt_tool == SCULPT_TOOL_MASK) {
@@ -5092,7 +5093,7 @@ static void sculpt_brush_stroke_init(bContext *C, wmOperator *op)
view3d_operator_needs_opengl(C);
sculpt_brush_init_tex(scene, sd, ss);
- is_smooth = sculpt_needs_connectivity_info(sd, brush, ss, mode);
+ need_pmap = sculpt_needs_connectivity_info(sd, brush, ss, mode);
needs_colors = SCULPT_TOOL_NEEDS_COLOR(brush->sculpt_tool);
if (needs_colors) {
@@ -5102,7 +5103,7 @@ static void sculpt_brush_stroke_init(bContext *C, wmOperator *op)
/* CTX_data_ensure_evaluated_depsgraph should be used at the end to include the updates of
* earlier steps modifying the data. */
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
- BKE_sculpt_update_object_for_edit(depsgraph, ob, is_smooth, need_mask, needs_colors);
+ BKE_sculpt_update_object_for_edit(depsgraph, ob, need_pmap, need_mask, needs_colors);
}
static void sculpt_restore_mesh(Sculpt *sd, Object *ob)
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 5434577c434..126e8b4a04f 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -1509,6 +1509,10 @@ void SCULPT_undo_push_end_ex(struct Object *ob, const bool use_nested_undo)
static void sculpt_undo_set_active_layer(struct bContext *C, SculptAttrRef *attr)
{
+ if (attr->domain == ATTR_DOMAIN_AUTO) {
+ return;
+ }
+
Object *ob = CTX_data_active_object(C);
Mesh *me = BKE_object_get_original_mesh(ob);
More information about the Bf-blender-cvs
mailing list