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-07-15 06:09:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-07-15 06:09:06 +0300
commit061d76f55cb172f9cbe133ba6a0f92ca5feb6b88 (patch)
tree24357febb8898ac85a7d89e3b6a365aab69eb374 /source/blender/editors/object
parentd493fc43bd4aac7f2e0e448957f3ab1412d9691d (diff)
Revert "Cleanup: remove public unused function."
This reverts commit 03c8b048a166584a72ceff08432401cd7047648c. This commit re-introduced T76837. While there is a comment explaining why this function is needed, the naming of the poll function does make this confusing. The API could be changed to avoid confusion here.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_edit.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 49d80bc15ee..04113f70e52 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1463,6 +1463,13 @@ static const EnumPropertyItem *object_mode_set_itemsf(bContext *C,
return item;
}
+static bool object_mode_set_poll(bContext *C)
+{
+ /* Needed as #ED_operator_object_active_editable doesn't call use 'active_object'. */
+ Object *ob = CTX_data_active_object(C);
+ return ED_operator_object_active_editable_ex(C, ob);
+}
+
static int object_mode_set_exec(bContext *C, wmOperator *op)
{
const bool use_submode = STREQ(op->idname, "OBJECT_OT_mode_set_with_submode");
@@ -1567,7 +1574,7 @@ void OBJECT_OT_mode_set(wmOperatorType *ot)
/* api callbacks */
ot->exec = object_mode_set_exec;
- ot->poll = ED_operator_object_active_editable;
+ ot->poll = object_mode_set_poll;
/* flags */
ot->flag = 0; /* no register/undo here, leave it to operators being called */