[Bf-blender-cvs] [5673727] blender-v2.75-release: Fix: Keyframe indicators for NLA Strip properties fails if the AnimData has an active action

Joshua Leung noreply at git.blender.org
Tue Jul 7 15:17:43 CEST 2015


Commit: 5673727088333a0237c56c6d62b6fe5a9238b8e3
Author: Joshua Leung
Date:   Thu Jul 2 13:19:42 2015 +1200
Branches: blender-v2.75-release
https://developer.blender.org/rB5673727088333a0237c56c6d62b6fe5a9238b8e3

Fix: Keyframe indicators for NLA Strip properties fails if the AnimData has an active action

===================================================================

M	source/blender/blenkernel/intern/fcurve.c

===================================================================

diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 6e58513..e073d2c 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -335,6 +335,7 @@ FCurve *rna_get_fcurve_context_ui(bContext *C, PointerRNA *ptr, PropertyRNA *pro
 	/* there must be some RNA-pointer + property combon */
 	if (prop && tptr.id.data && RNA_property_animateable(&tptr, prop)) {
 		AnimData *adt = BKE_animdata_from_id(tptr.id.data);
+		AnimData *adt_initial = adt;
 		int step = C ? 2 : 1;  /* Always 1 in case we have no context (can't check in 'ancestors' of given RNA ptr). */
 		char *path = NULL;
 		
@@ -391,11 +392,15 @@ FCurve *rna_get_fcurve_context_ui(bContext *C, PointerRNA *ptr, PropertyRNA *pro
 			}
 			
 			/* if we still haven't found anything, check whether it's a "special" property */
-			if ((fcu == NULL) && (adt && adt->nla_tracks.first)) {
+			/* NOTE: Need to go back to the original AnimData (vs one further up the chain,
+			 *       that we'd get after the loop above failed), or else this check will not 
+			 *       work for Materials
+			 */
+			if ((fcu == NULL) && (adt_initial && adt_initial->nla_tracks.first)) {
 				NlaTrack *nlt;
 				const char *propname = RNA_property_identifier(prop);
 				
-				for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) {
+				for (nlt = adt_initial->nla_tracks.first; nlt; nlt = nlt->next) {
 					NlaStrip *strip;
 					
 					if (fcu)




More information about the Bf-blender-cvs mailing list