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>2018-02-06 09:53:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-06 10:03:29 +0300
commit2a184f3d2b6cc180fedd0c93c266d847f7d27936 (patch)
tree5d7472cb10888e6e18dd64bbcdb3c078ac325ca0 /source/blender/editors/object/object_shapekey.c
parent906ed54d286d0dd6686aac997883e7dfa4bba792 (diff)
Object Mode: use eval_ctx for paint & object
Diffstat (limited to 'source/blender/editors/object/object_shapekey.c')
-rw-r--r--source/blender/editors/object/object_shapekey.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c
index 1f80cb5f0bc..005ae64e413 100644
--- a/source/blender/editors/object/object_shapekey.c
+++ b/source/blender/editors/object/object_shapekey.c
@@ -225,18 +225,22 @@ static bool object_shape_key_mirror(bContext *C, Object *ob,
static int shape_key_mode_poll(bContext *C)
{
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
- return (ob && !ID_IS_LINKED(ob) && data && !ID_IS_LINKED(data) && ob->mode != OB_MODE_EDIT);
+ return (ob && !ID_IS_LINKED(ob) && data && !ID_IS_LINKED(data) && (eval_ctx.object_mode != OB_MODE_EDIT));
}
static int shape_key_mode_exists_poll(bContext *C)
{
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
/* same as shape_key_mode_poll */
- return (ob && !ID_IS_LINKED(ob) && data && !ID_IS_LINKED(data) && ob->mode != OB_MODE_EDIT) &&
+ return (ob && !ID_IS_LINKED(ob) && data && !ID_IS_LINKED(data) && (eval_ctx.object_mode != OB_MODE_EDIT)) &&
/* check a keyblock exists */
(BKE_keyblock_from_object(ob) != NULL);
}
@@ -244,12 +248,14 @@ static int shape_key_mode_exists_poll(bContext *C)
static int shape_key_move_poll(bContext *C)
{
/* Same as shape_key_mode_exists_poll above, but ensure we have at least two shapes! */
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
Object *ob = ED_object_context(C);
ID *data = (ob) ? ob->data : NULL;
Key *key = BKE_key_from_object(ob);
return (ob && !ID_IS_LINKED(ob) && data && !ID_IS_LINKED(data) &&
- ob->mode != OB_MODE_EDIT && key && key->totkey > 1);
+ (eval_ctx.object_mode != OB_MODE_EDIT) && key && key->totkey > 1);
}
static int shape_key_poll(bContext *C)