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:
authorCampbell Barton <ideasman42@gmail.com>2020-02-04 10:26:57 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-02-04 10:41:04 +0300
commit0964ae5266541f09a1d54d8941393bada97d08a2 (patch)
tree7ccecb3f1a756562627985c91cb0795b065be8a9 /source/blender/editors/lattice
parentd09646a40b1928308025d8ceb2c2d505651fc9a4 (diff)
Fix T73234: Undo/redo with local collection crashes
Resolves crashes when edit-mode undo data wasn't included because it wasn't visible, also resolves T73416.
Diffstat (limited to 'source/blender/editors/lattice')
-rw-r--r--source/blender/editors/lattice/editlattice_undo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/lattice/editlattice_undo.c b/source/blender/editors/lattice/editlattice_undo.c
index ed2560698b6..f90b70c492f 100644
--- a/source/blender/editors/lattice/editlattice_undo.c
+++ b/source/blender/editors/lattice/editlattice_undo.c
@@ -146,7 +146,8 @@ static int validate_undoLatt(void *data, void *edata)
static Object *editlatt_object_from_context(bContext *C)
{
- Object *obedit = CTX_data_edit_object(C);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
+ Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
if (obedit && obedit->type == OB_LATTICE) {
Lattice *lt = obedit->data;
if (lt->editlatt != NULL) {
@@ -189,8 +190,7 @@ static bool lattice_undosys_step_encode(struct bContext *C, Main *bmain, UndoSte
* outside of this list will be moved out of edit-mode when reading back undo steps. */
ViewLayer *view_layer = CTX_data_view_layer(C);
uint objects_len = 0;
- Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(
- view_layer, NULL, &objects_len);
+ Object **objects = ED_undo_editmode_objects_from_view_layer(view_layer, &objects_len);
us->elems = MEM_callocN(sizeof(*us->elems) * objects_len, __func__);
us->elems_len = objects_len;