[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18991] branches/blender2.5/blender/source /blender/editors/animation/anim_ipo_utils.c: F-Curve names: Experimental style 2

Joshua Leung aligorith at gmail.com
Mon Feb 16 10:48:39 CET 2009


Revision: 18991
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18991
Author:   aligorith
Date:     2009-02-16 10:48:38 +0100 (Mon, 16 Feb 2009)

Log Message:
-----------
F-Curve names: Experimental style 2

In this commit, I've experimented with the way in which F-Curve names (seen in DopeSheet/Graph Editor) are put together. 

Now, F-Curve names are assembled in the form:
<array-index> <property-name> (<struct-name>)
i.e.  "X Location (Bone)", "Y Location (Object)"
"Specularity (VeryLongMaterialName)", etc.  

The goal of this experiment was to hopefully make it quicker to do a left-margin scan and identify the defining differences between closely related F-Curves. 
- This has the benefit of no (potential) need for horizontal scrolling back and forth to see and compare the end portions of names, and also to avoid the important parts of the name getting pushed out of the standard viewable area by some owner-struct long names. 
- The downside is the loss of the clear hierarchial layout closely related to the RNA-paths used internally, that was provided by the old method. Also, this method also looks rather awkward on first glance, but if it improves efficiency of use, why not :) 

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/animation/anim_ipo_utils.c

Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_ipo_utils.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_ipo_utils.c	2009-02-16 09:03:32 UTC (rev 18990)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_ipo_utils.c	2009-02-16 09:48:38 UTC (rev 18991)
@@ -120,8 +120,16 @@
 			char *structname=NULL, *propname=NULL, *arrayname=NULL, arrayindbuf[16];
 			PropertyRNA *nameprop;
 			
-			/* for now, name will consist of struct-name + property name + array index:
-			 *	i.e. Bone1.Location.X, or Object.Location.X
+			/* For now, name will consist of 3 parts: struct-name, property name, array index
+			 * There are several options possible:
+			 *	1) <struct-name>.<property-name>.<array-index>
+			 *		i.e. Bone1.Location.X, or Object.Location.X
+			 *	2) <array-index> <property-name> (<struct name>)
+			 *		i.e. X Location (Bone1), or X Location (Object)
+			 *	
+			 * Currently, option 2 is in use, to try and make it easier to quickly identify F-Curves (it does have
+			 * problems with looking rather odd though). Option 1 is better in terms of revealing a consistent sense of 
+			 * hierarchy though, which isn't so clear with option 2.
 			 */
 			
 			/* for structname, we use a custom name if one is available */
@@ -141,9 +149,14 @@
 			/* Array Index - only if applicable */
 			if (RNA_property_array_length(&ptr, prop)) {
 					// XXX the format of these is not final... we don't know how this will go yet
-				static char *vectoritem[4]= {".X", ".Y", ".Z", ".W"};
-				static char *quatitem[4]= {".W", ".X", ".Y", ".Z"};
-				static char *coloritem[4]= {".R", ".G", ".B", ".A"};
+					// format 1 style
+				//static char *vectoritem[4]= {".X", ".Y", ".Z", ".W"};
+				//static char *quatitem[4]= {".W", ".X", ".Y", ".Z"};
+				//static char *coloritem[4]= {".R", ".G", ".B", ".A"};
+					// format 2 style
+				static char *vectoritem[4]= {"X ", "Y ", "Z ", "W "};
+				static char *quatitem[4]= {"W ", "X ", "Y ", "Z "};
+				static char *coloritem[4]= {"R ", "G ", "B ", "A "};
 				
 				int tot= RNA_property_array_length(&ptr, prop);
 				int propsubtype= RNA_property_subtype(&ptr, prop);
@@ -167,8 +180,9 @@
 			}
 			
 			/* putting this all together into the buffer */
-				// XXX we need to check for invalid names...
-			BLI_snprintf(name, 128, "%s.%s%s", structname, propname, arrayname); 
+			// XXX we need to check for invalid names...
+			//BLI_snprintf(name, 128, "%s.%s%s", structname, propname, arrayname);  // format 1
+			BLI_snprintf(name, 128, "%s%s (%s)", arrayname, propname, structname);  // format 2
 			
 			/* free temp name if nameprop is set */
 			if (nameprop)





More information about the Bf-blender-cvs mailing list