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:10:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-06 10:03:28 +0300
commit021bf4c2fea0653a4a4511d6a54a6b130d6c5acc (patch)
tree12a746a5d5ba7de31a462ecc8e144422759b33d0 /source/blender/editors/animation/keyframing.c
parentc7fecab2efd3b28a18b56dbd321616728d8b7cce (diff)
Object Mode: use eval_ctx for keyframe & weight calculation
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r--source/blender/editors/animation/keyframing.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 24f6a2dab2c..6df0a1cd302 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1579,6 +1579,9 @@ void ANIM_OT_keyframe_delete(wmOperatorType *ot)
static int clear_anim_v3d_exec(bContext *C, wmOperator *UNUSED(op))
{
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
+
bool changed = false;
CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
@@ -1595,7 +1598,7 @@ static int clear_anim_v3d_exec(bContext *C, wmOperator *UNUSED(op))
fcn = fcu->next;
/* in pose mode, only delete the F-Curve if it belongs to a selected bone */
- if (ob->mode & OB_MODE_POSE) {
+ if (eval_ctx.object_mode & OB_MODE_POSE) {
if ((fcu->rna_path) && strstr(fcu->rna_path, "pose.bones[")) {
bPoseChannel *pchan;
char *bone_name;
@@ -1658,8 +1661,10 @@ void ANIM_OT_keyframe_clear_v3d(wmOperatorType *ot)
static int delete_key_v3d_exec(bContext *C, wmOperator *op)
{
- Scene *scene = CTX_data_scene(C);
- float cfra = (float)CFRA;
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
+
+ const float cfra = eval_ctx.ctime;
CTX_DATA_BEGIN (C, Object *, ob, selected_objects)
{
@@ -1687,7 +1692,7 @@ static int delete_key_v3d_exec(bContext *C, wmOperator *op)
/* special exception for bones, as this makes this operator more convenient to use
* NOTE: This is only done in pose mode. In object mode, we're dealign with the entire object.
*/
- if ((ob->mode & OB_MODE_POSE) && strstr(fcu->rna_path, "pose.bones[\"")) {
+ if ((eval_ctx.object_mode & OB_MODE_POSE) && strstr(fcu->rna_path, "pose.bones[\"")) {
bPoseChannel *pchan;
char *bone_name;