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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-04-05 20:59:20 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-04-05 20:59:20 +0300
commitfc8bcd26c0be15cb9ace6f6289f0275547d73c94 (patch)
treecce531e417a7c2dd2a7f8cbb1125e1a8669b44af /source/blender/depsgraph/intern/eval
parent4de704a6df773035e651efdc4ca379295741724f (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/depsgraph/intern/eval')
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index 91170abed0b..c38393e9284 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@ -872,7 +872,9 @@ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, const IDNode
* TODO: Investigate modes besides edit-mode. */
if (check_datablock_expanded(id_cow) && !id_node->is_cow_explicitly_tagged) {
const ID_Type id_type = GS(id_orig->name);
- if (OB_DATA_SUPPORT_EDITMODE(id_type) && BKE_object_data_is_in_editmode(id_orig)) {
+ /* Pass nullptr as the object is only needed for Curves which do not have edit mode pointers.
+ */
+ if (OB_DATA_SUPPORT_EDITMODE(id_type) && BKE_object_data_is_in_editmode(nullptr, id_orig)) {
/* Make sure pointers in the edit mode data are updated in the copy.
* This allows depsgraph to pick up changes made in another context after it has been
* evaluated. Consider the following scenario: