[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37966] branches/soc-2011-pepper/source/ blender/editors: Some tweaks to naming of channels in animation editors - thanks Matt

Joshua Leung aligorith at gmail.com
Thu Jun 30 03:07:04 CEST 2011


Revision: 37966
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37966
Author:   aligorith
Date:     2011-06-30 01:07:03 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
Some tweaks to naming of channels in animation editors - thanks Matt
* F-Curves no longer show the name of the datablock of the property
they affect if this is an ID-block. For example, transform curves for
a cube won't get the "... (Cube)" suffix anymore. In these cases, it's
relatively clear that these belong to the parent datablock, so doing
this should be fine (and reduces clutter).

However, for non-id data (i.e. subsurf modifier settings) or bones,
this info still gets shown. In these cases, there is some ambiguity.

* "ActiveAct: <...>" is no longer shown for NLA action channels (i.e.
just the name of the action gets shown). This should make it easier to
see at a glance what action is being used.

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/editors/animation/anim_ipo_utils.c
    branches/soc-2011-pepper/source/blender/editors/space_nla/nla_draw.c

Modified: branches/soc-2011-pepper/source/blender/editors/animation/anim_ipo_utils.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/animation/anim_ipo_utils.c	2011-06-30 00:58:40 UTC (rev 37965)
+++ branches/soc-2011-pepper/source/blender/editors/animation/anim_ipo_utils.c	2011-06-30 01:07:03 UTC (rev 37966)
@@ -100,6 +100,8 @@
 			 *	- as base, we use a custom name from the structs if one is available 
 			 *	- however, if we're showing subdata of bones (probably there will be other exceptions later)
 			 *	  need to include that info too since it gets confusing otherwise
+			 *	- if a pointer just refers to the ID-block, then don't repeat this info
+			 *	  since this just introduces clutter
 			 */
 			if (strstr(fcu->rna_path, "bones") && strstr(fcu->rna_path, "constraints")) {
 				/* perform string 'chopping' to get "Bone Name : Constraint Name" */
@@ -114,7 +116,7 @@
 				if (pchanName) MEM_freeN(pchanName);
 				if (constName) MEM_freeN(constName);
 			}
-			else {
+			else if (ptr.data != ptr.id.data) {
 				PropertyRNA *nameprop= RNA_struct_name_property(ptr.type);
 				if (nameprop) {
 					/* this gets a string which will need to be freed */
@@ -145,7 +147,11 @@
 			
 			/* putting this all together into the buffer */
 			// XXX we need to check for invalid names...
-			BLI_snprintf(name, 256, "%s%s (%s)", arrayname, propname, structname); 
+			// XXX the name length limit needs to be passed in or as some define
+			if (structname)
+				BLI_snprintf(name, 256, "%s%s (%s)", arrayname, propname, structname); 
+			else
+				BLI_snprintf(name, 256, "%s%s", arrayname, propname); 
 			
 			/* free temp name if nameprop is set */
 			if (free_structname)

Modified: branches/soc-2011-pepper/source/blender/editors/space_nla/nla_draw.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/space_nla/nla_draw.c	2011-06-30 00:58:40 UTC (rev 37965)
+++ branches/soc-2011-pepper/source/blender/editors/space_nla/nla_draw.c	2011-06-30 01:07:03 UTC (rev 37966)
@@ -723,7 +723,7 @@
 					special = ICON_ACTION;
 					
 					if (act)
-						sprintf(name, "ActAction: <%s>", act->id.name+2);
+						sprintf(name, "%s", act->id.name+2);
 					else
 						sprintf(name, "<No Action>");
 						




More information about the Bf-blender-cvs mailing list