From 0f00e2198fca2d55711b1e14315d17555a3abd71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Tue, 5 Apr 2022 19:59:20 +0200 Subject: Curves: fix edit mode detection This adds missing cases to detect edit mode for Curves objects. Unlike other object types, Curves do not have specific edit data, rather we edit the original data directly, and rely on `Object.mode`. For this, `BKE_object_data_is_in_editmode` had to be modified to take a pointer to the object. This affects two places: the outliner and the dependency graph. For the former place, the object pointer is readily available, and we can use it. For the latter, the object pointer is not available, however since it is used to update edit mode pointers, and since Curves do not have such data, we can safely pass null to the function here. This also fixes the assertion failure that happens when closing a file in edit mode. Differential Revision: https://developer.blender.org/D14330 --- source/blender/editors/space_outliner/outliner_draw.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc index d204e12b41d..02afd182d0b 100644 --- a/source/blender/editors/space_outliner/outliner_draw.cc +++ b/source/blender/editors/space_outliner/outliner_draw.cc @@ -120,7 +120,7 @@ static bool is_object_data_in_editmode(const ID *id, const Object *obact) } return ((obact && (obact->mode & OB_MODE_EDIT)) && (id && OB_DATA_SUPPORT_EDITMODE(id_type)) && - (GS(((ID *)obact->data)->name) == id_type) && BKE_object_data_is_in_editmode(id)); + (GS(((ID *)obact->data)->name) == id_type) && BKE_object_data_is_in_editmode(obact, id)); } /** \} */ -- cgit v1.2.3