[Bf-blender-cvs] [3cce7b7ab92] blender2.8: Fix T58325: Local view Bug
Dalai Felinto
noreply at git.blender.org
Fri Dec 7 01:06:19 CET 2018
Commit: 3cce7b7ab922392ce50037f5f3efefa8784f03b0
Author: Dalai Felinto
Date: Thu Dec 6 22:04:12 2018 -0200
Branches: blender2.8
https://developer.blender.org/rB3cce7b7ab922392ce50037f5f3efefa8784f03b0
Fix T58325: Local view Bug
Aka all the thousand of reports duplicated here.
I should have seen this coming, since I had to add a hack in the first
place because things were "not working".
I should have figured out earlier that COW handles base in a really
special way, with its own special object_runtime_backup hack.
===================================================================
M source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
M source/blender/editors/space_view3d/view3d_view.c
===================================================================
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index 98e1bf49c5d..f8754c530a0 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@ -812,6 +812,7 @@ static void deg_update_copy_on_write_animation(const Depsgraph *depsgraph,
typedef struct ObjectRuntimeBackup {
Object_Runtime runtime;
short base_flag;
+ unsigned short base_local_view_bits;
} ObjectRuntimeBackup;
/* Make a backup of object's evaluation runtime data, additionally
@@ -835,6 +836,7 @@ static void deg_backup_object_runtime(
}
/* Make a backup of base flags. */
object_runtime_backup->base_flag = object->base_flag;
+ object_runtime_backup->base_local_view_bits = object->base_local_view_bits;
}
static void deg_restore_object_runtime(
@@ -872,6 +874,7 @@ static void deg_restore_object_runtime(
}
}
object->base_flag = object_runtime_backup->base_flag;
+ object->base_local_view_bits = object_runtime_backup->base_local_view_bits;
}
ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph,
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 98ae57e9c42..1cced23b24d 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1188,9 +1188,6 @@ static bool view3d_localview_init(
if (TESTBASE(v3d, base)) {
BKE_object_minmax(base->object, min, max, false);
base->local_view_bits |= local_view_bit;
- /* Technically we should leave for Depsgraph to handle this.
- But it is harmless to do it here, and it seems to be necessary. */
- base->object->base_local_view_bits = base->local_view_bits;
ok = true;
}
}
More information about the Bf-blender-cvs
mailing list