diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-19 13:03:02 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-19 13:05:17 +0300 |
commit | b352d2705d1f4849022aa3d93d0d1a8881862d7b (patch) | |
tree | a11785c4d2cc5fa677a0fc1e884194aa2d303727 /source/blender/blenkernel/intern | |
parent | caa7101df545bf5f3827fd26216b7e6d83e2f452 (diff) |
Depsgraph: Fix crash with copy-on-write enabled
Was caused by ec0756af6c7, once again, we can't pass view layer,
need to pass index.
The sad part is that currently we don't have quick way to look up
view layer by index. Can do similar thing as we do for bones and
bases.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index d043fcc9d1c..c8612c1d55c 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -445,9 +445,14 @@ void BKE_object_data_select_update(Depsgraph *UNUSED(depsgraph), } void BKE_object_eval_flush_base_flags(Depsgraph *UNUSED(depsgraph), - ViewLayer *view_layer, - Object *object, int base_index, bool is_from_set) + Scene *scene, const int view_layer_index, + Object *object, int base_index, + const bool is_from_set) { + /* TODO(sergey): Avoid list lookup. */ + BLI_assert(view_layer_index >= 0); + ViewLayer *view_layer = BLI_findlink(&scene->view_layers, view_layer_index); + BLI_assert(view_layer != NULL); BLI_assert(view_layer->object_bases_array != NULL); BLI_assert(base_index >= 0); BLI_assert(base_index < MEM_allocN_len(view_layer->object_bases_array) / sizeof(Base *)); |