From 59b2316e82a97cecd55a8089cc3fa89003cdbb12 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 24 Jan 2014 16:10:26 +1300 Subject: Code Cleanup / Preemptive Bug Fixing: "action" parameter may get set when it shouldn't be Logically, it makes sense that this parameter only gets used to describe the action that the F-Curve actually belongs to (if it belongs to one). Otherwise, it should not be set at all. --- source/blender/blenkernel/intern/fcurve.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 81321b9dbc2..b46958a0308 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -322,6 +322,7 @@ FCurve *rna_get_fcurve_context_ui(bContext *C, PointerRNA *ptr, PropertyRNA *pro if (animdata) *animdata = NULL; *r_driven = false; + if (action) *action = NULL; /* there must be some RNA-pointer + property combon */ if (prop && tptr.id.data && RNA_property_animateable(&tptr, prop)) { @@ -344,8 +345,12 @@ FCurve *rna_get_fcurve_context_ui(bContext *C, PointerRNA *ptr, PropertyRNA *pro if (path) { /* animation takes priority over drivers */ - if (adt->action && adt->action->curves.first) + if (adt->action && adt->action->curves.first) { fcu = list_find_fcurve(&adt->action->curves, path, rnaindex); + + if (fcu && action) + *action = adt->action; + } /* if not animated, check if driven */ if (!fcu && (adt->drivers.first)) { -- cgit v1.2.3