Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-06-06 17:14:11 +0300
committerBastien Montagne <bastien@blender.org>2020-06-06 17:18:39 +0300
commitaed11c673efefe509af7abd8cfb8cac000422054 (patch)
treeb1c03ddac35fb9630c1cb902901a6b3ef9e11f48 /source/blender/blenloader
parent03a693922dbc440032dd91e28df26098b7b03530 (diff)
Fix T77456: Broken vertex paint undo on high-poly objects.
This is a critical fix that should also be backported to 2.83.1 Fairly stupid bug in fact, code detecting changes across undo steps was assuming that each BHEAD (a block of data in blendfiles) would not be larger than one memory chunk... Which is the case in alsmost every situation, besides some super-heavy geometries, and other similar things (images would also be affected e.g.).
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index e9e66de1837..cd05db090f8 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1239,6 +1239,10 @@ static int fd_read_from_memfile(FileData *filedata,
static MemFileChunk *chunk = NULL;
size_t chunkoffset, readsize, totread;
+ if (r_is_memchunck_identical != NULL) {
+ *r_is_memchunck_identical = true;
+ }
+
if (size == 0) {
return 0;
}
@@ -1289,13 +1293,13 @@ static int fd_read_from_memfile(FileData *filedata,
filedata->file_offset += readsize;
seek += readsize;
if (r_is_memchunck_identical != NULL) {
- /* `is_identical` of current chunk represent whether it changed compared to previous undo
+ /* `is_identical` of current chunk represents whether it changed compared to previous undo
* step. this is fine in redo case (filedata->undo_direction > 0), but not in undo case,
* where we need an extra flag defined when saving the next (future) step after the one we
* want to restore, as we are supposed to 'come from' that future undo step, and not the
* one before current one. */
- *r_is_memchunck_identical = filedata->undo_direction > 0 ? chunk->is_identical :
- chunk->is_identical_future;
+ *r_is_memchunck_identical &= filedata->undo_direction > 0 ? chunk->is_identical :
+ chunk->is_identical_future;
}
} while (totread < size);