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:
authorPhilipp Oeser <info@graphics-engineer.com>2020-08-12 14:20:32 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-08-12 16:28:12 +0300
commit08286ef8ba5c880fd9761b397d00ac81e993a657 (patch)
tree2e13e51b7abc6f88b71380aa41b7e04fc958e40e /source/blender/editors/animation/keyframing.c
parent9280fb19e4ff5038734d9867d152c10d4daf03bb (diff)
Fix T79712: Color Changes do not record in Auto-Key Mode
Caused by rBfffba2b6530. In above commit, the buttons rnaindex [-1 for entire arrays like colors] was not used anymore for the entire function body of `ED_autokeyframe_property` (previously in `ui_but_anim_autokey`). Replacing the index with 0 (in the array case) is indeed necessary for `BKE_fcurve_find_by_rna_context_ui`, prior to rBfffba2b6530 this was taken care of by using `ui_but_get_fcurve` instead [which did this internally]. But using an index of 0 (instead of -1) for the entire function body of `ED_autokeyframe_property` fails for the array part later, namely `insert_keyframe` needs -1 here. Now just replace the index for //finding the FCurve//, but use the original for //inserting the keyframe//. Could be backported to 2.83 LTS. Reviewers: campbellbarton, sybren Subscribers:
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r--source/blender/editors/animation/keyframing.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 8c2f4216aa9..66d4882cf9d 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -3025,8 +3025,11 @@ bool ED_autokeyframe_property(
bool special;
bool changed = false;
+ /* for entire array buttons we check the first component, it's not perfect
+ * but works well enough in typical cases */
+ const int rnaindex_check = (rnaindex == -1) ? 0 : rnaindex;
fcu = BKE_fcurve_find_by_rna_context_ui(
- C, ptr, prop, rnaindex, NULL, &action, &driven, &special);
+ C, ptr, prop, rnaindex_check, NULL, &action, &driven, &special);
if (fcu == NULL) {
return changed;