diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-06 18:17:08 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-06 18:19:13 +0300 |
commit | 4165a57a66724b9b0f7e696a9d0ef75ee29a6af8 (patch) | |
tree | db484cb4bc1fc02c19f37cde1ddf3b6b5d430463 /source | |
parent | f818ff411a03ae1d8e93ac21b7dc790abcd10ee0 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 14 |
1 files changed, 8 insertions, 6 deletions
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 */ |