[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55104] trunk/blender/source/blender/ editors/animation: Improving warnings when keyframing fails for IKEY over a button

Joshua Leung aligorith at gmail.com
Fri Mar 8 03:15:09 CET 2013


Revision: 55104
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55104
Author:   aligorith
Date:     2013-03-08 02:15:08 +0000 (Fri, 08 Mar 2013)
Log Message:
-----------
Improving warnings when keyframing fails for IKEY over a button

Now, instead of silently failing, an error message saying that the property
cannot be animated is displayed

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/keyframing.c
    trunk/blender/source/blender/editors/animation/keyingsets.c

Modified: trunk/blender/source/blender/editors/animation/keyframing.c
===================================================================
--- trunk/blender/source/blender/editors/animation/keyframing.c	2013-03-07 23:28:23 UTC (rev 55103)
+++ trunk/blender/source/blender/editors/animation/keyframing.c	2013-03-08 02:15:08 UTC (rev 55104)
@@ -1623,17 +1623,21 @@
 			success += insert_keyframe_direct(op->reports, ptr, prop, fcu, cfra, 0);
 		}
 		else {
-			if (G.debug & G_DEBUG)
-				printf("Button Insert-Key: no path to property\n");
-			BKE_report(op->reports, RPT_WARNING, "Failed to resolve path to property, try using a keying set instead");
+			BKE_report(op->reports, RPT_WARNING, 
+			           "Failed to resolve path to property, try manually specifying this using a Keying Set instead");
 		}
 	}
-	else if (G.debug & G_DEBUG) {
-		printf("ptr.data = %p, prop = %p,", (void *)ptr.data, (void *)prop);
-		if (prop)
-			printf("animatable = %d\n", RNA_property_animateable(&ptr, prop));
-		else
-			printf("animatable = NULL\n");
+	else {
+		if (prop && !RNA_property_animateable(&ptr, prop)) {
+			BKE_reportf(op->reports, RPT_WARNING, 
+			           "\"%s\" property cannot be animated",
+			           RNA_property_identifier(prop));
+		}
+		else {
+			BKE_reportf(op->reports, RPT_WARNING,
+			            "Button doesn't appear to have any property information attached (ptr.data = %p, prop = %p)",
+						(void *)ptr.data, (void *)prop);
+		}
 	}
 	
 	if (success) {

Modified: trunk/blender/source/blender/editors/animation/keyingsets.c
===================================================================
--- trunk/blender/source/blender/editors/animation/keyingsets.c	2013-03-07 23:28:23 UTC (rev 55103)
+++ trunk/blender/source/blender/editors/animation/keyingsets.c	2013-03-08 02:15:08 UTC (rev 55104)
@@ -879,7 +879,7 @@
 		if (ksi == NULL)
 			return MODIFYKEY_MISSING_TYPEINFO;
 		/* TODO: check for missing callbacks! */
-
+		
 		/* check if it can be used in the current context */
 		if (ksi->poll(ksi, C)) {
 			/* if a list of data sources are provided, run a special iterator over them,




More information about the Bf-blender-cvs mailing list