diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-04-05 20:59:20 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-04-05 20:59:20 +0300 |
commit | fc8bcd26c0be15cb9ace6f6289f0275547d73c94 (patch) | |
tree | cce531e417a7c2dd2a7f8cbb1125e1a8669b44af /source/blender/makesdna/DNA_object_types.h | |
parent | 4de704a6df773035e651efdc4ca379295741724f (diff) |
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
Diffstat (limited to 'source/blender/makesdna/DNA_object_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 54627e711ff..9ea1e3a9e8d 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -534,7 +534,8 @@ enum { (ELEM(_type, OB_MESH, OB_SURF, OB_CURVES_LEGACY, OB_LATTICE)) /** Matches #OB_TYPE_SUPPORT_EDITMODE. */ -#define OB_DATA_SUPPORT_EDITMODE(_type) (ELEM(_type, ID_ME, ID_CU_LEGACY, ID_MB, ID_LT, ID_AR)) +#define OB_DATA_SUPPORT_EDITMODE(_type) \ + (ELEM(_type, ID_ME, ID_CU_LEGACY, ID_MB, ID_LT, ID_AR, ID_CV)) /* is this ID type used as object data */ #define OB_DATA_SUPPORT_ID(_id_type) \ |