From 4165a57a66724b9b0f7e696a9d0ef75ee29a6af8 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 6 Jun 2018 17:17:08 +0200 Subject: Fix broken auto-keying after copy/paste of poses. That bug was also likely affecting other cases - basically it was making auto-keying always key from evaluated ('visual') values, never base, data values... Added a flag, in some cases we do want evaluated values here, obviously. --- source/blender/editors/animation/keyframing.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/animation/keyframing.c') diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 25b3b4f58fa..e6f2f087ede 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -616,12 +616,14 @@ static short new_key_needed(FCurve *fcu, float cFrame, float nValue) /* ------------------ RNA Data-Access Functions ------------------ */ /* Try to read value using RNA-properties obtained already */ -static float setting_get_rna_value(Depsgraph *depsgraph, PointerRNA *ptr, PropertyRNA *prop, int index) +static float setting_get_rna_value(Depsgraph *depsgraph, PointerRNA *ptr, PropertyRNA *prop, int index, const bool get_evaluated) { - PointerRNA ptr_eval; + PointerRNA ptr_eval = *ptr; float value = 0.0f; - DEG_get_evaluated_rna_pointer(depsgraph, ptr, &ptr_eval); + if (get_evaluated) { + DEG_get_evaluated_rna_pointer(depsgraph, ptr, &ptr_eval); + } switch (RNA_property_type(prop)) { case PROP_BOOLEAN: @@ -847,7 +849,7 @@ static float visualkey_get_value(Depsgraph *depsgraph, PointerRNA *ptr, Property } } else { - return setting_get_rna_value(depsgraph, ptr, prop, array_index); + return setting_get_rna_value(depsgraph, ptr, prop, array_index, true); } /* Rot/Scale code are common! */ @@ -885,7 +887,7 @@ static float visualkey_get_value(Depsgraph *depsgraph, PointerRNA *ptr, Property } /* as the function hasn't returned yet, read value from system in the default way */ - return setting_get_rna_value(depsgraph, ptr, prop, array_index); + return setting_get_rna_value(depsgraph, ptr, prop, array_index, true); } /* ------------------------- Insert Key API ------------------------- */ @@ -970,7 +972,7 @@ bool insert_keyframe_direct(Depsgraph *depsgraph, ReportList *reports, PointerRN } else { /* read value from system */ - curval = setting_get_rna_value(depsgraph, &ptr, prop, fcu->array_index); + curval = setting_get_rna_value(depsgraph, &ptr, prop, fcu->array_index, false); } /* only insert keyframes where they are needed */ -- cgit v1.2.3