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.
This commit is contained in:
Dalai Felinto 2018-12-06 22:04:12 -02:00
parent d40bffa17f
commit 3cce7b7ab9
Notes: blender-bot 2023-02-14 06:47:29 +01:00
Referenced by issue #58325, Local view Bug
2 changed files with 3 additions and 3 deletions

View File

@ -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,

View File

@ -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;
}
}