[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55069] trunk/blender/source/blender/ editors/animation/anim_channels_defines.c: Experimental Feature: Ctrl-Click on the "name" of a broken F-Curve now allows

Joshua Leung aligorith at gmail.com
Wed Mar 6 02:44:13 CET 2013


Revision: 55069
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55069
Author:   aligorith
Date:     2013-03-06 01:44:12 +0000 (Wed, 06 Mar 2013)
Log Message:
-----------
Experimental Feature: Ctrl-Click on the "name" of a broken F-Curve now allows
you to fix the RNA Path in-place

For F-Curves that are disabled or marked as having errors because their paths
are invalid (indicated with a red line underneath their names), it is now
possible to use the Ctrl-Click renaming functionality to bring up a textbox for
fixing the offending RNA Path "in place" (i.e. in the channels list) without
having to bring up the properties region first.

This makes it easier to fix the paths if you know what you're doing. However,
caution is still advised for most people. In particular, be aware that this uses
a separate "RNA Array Index" for indexing into array properties (i.e. location,
rotation, color) which will not be shown here, and can only be edited from the
panel (or datablocks editor/scripts).

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

Modified: trunk/blender/source/blender/editors/animation/anim_channels_defines.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_channels_defines.c	2013-03-06 00:56:58 UTC (rev 55068)
+++ trunk/blender/source/blender/editors/animation/anim_channels_defines.c	2013-03-06 01:44:12 UTC (rev 55069)
@@ -893,6 +893,23 @@
 	getname_anim_fcurve(name, ale->id, ale->data);
 }
 
+/* "name" property for fcurve entries */
+static short acf_fcurve_name_prop(bAnimListElem *ale, PointerRNA *ptr, PropertyRNA **prop)
+{
+	FCurve *fcu = (FCurve *)ale->data;
+	
+	/* Ctrl-Click Usability Convenience Hack: 
+	 * For disabled F-Curves, allow access to the RNA Path 
+	 * as our "name" so that user can perform quick fixes
+	 */
+	if (fcu->flag & FCURVE_DISABLED) {
+		RNA_pointer_create(ale->id, &RNA_FCurve, ale->data, ptr);
+		*prop = RNA_struct_find_property(ptr, "data_path");
+	}
+	
+	return (*prop != NULL);
+}
+
 /* check if some setting exists for this channel */
 static short acf_fcurve_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
 {
@@ -964,7 +981,7 @@
 	acf_generic_group_offset,       /* offset */
 
 	acf_fcurve_name,                /* name */
-	NULL,                           /* name prop */
+	acf_fcurve_name_prop,           /* name prop */
 	NULL,                           /* icon */
 
 	acf_fcurve_setting_valid,       /* has setting */




More information about the Bf-blender-cvs mailing list