[Bf-blender-cvs] [6aeb1f7] master: Fix: "pchan_name" field in SDNA for names of bone targets for drivers was too short

Joshua Leung noreply at git.blender.org
Sat Mar 19 05:48:50 CET 2016


Commit: 6aeb1f7f5609dc1e82b9b2d915e2ee54b3c467de
Author: Joshua Leung
Date:   Sat Mar 19 17:48:29 2016 +1300
Branches: master
https://developer.blender.org/rB6aeb1f7f5609dc1e82b9b2d915e2ee54b3c467de

Fix: "pchan_name" field in SDNA for names of bone targets for drivers was too short

When all the names in Blender were updated to go from having 32 characters to 64,
the "pchan_name" field in the DriverTarget struct was missed. This meant that if you
had a bone with a suitably long name, it would have been impossible to use values from this
bone in a driver.

The only reason this probably hasn't been discovered yet is because the standard/old depsgraph
doesn't work that well for bones in the same armatures, so setups where this may have
occurred are not that common.

To prevent this problem from happening in future, I've added the standard "MAX_ID_NAME-2"
comment to the comments on each line likely to be impacted by such changes, making it
easier for whoever does a search and replace in future :)

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

M	source/blender/makesdna/DNA_anim_types.h

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

diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index 590179e..e41ca93 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -54,7 +54,7 @@ typedef struct FModifier {
 	
 	void *data;			/* pointer to modifier data */
 	
-	char name[64];		/* user-defined description for the modifier */
+	char name[64];		/* user-defined description for the modifier - MAX_ID_NAME-2 */
 	short type;			/* type of f-curve modifier */
 	short flag;			/* settings for the modifier */
 	
@@ -271,7 +271,7 @@ typedef struct DriverTarget {
 	
 	char *rna_path;			/* RNA path defining the setting to use (for DVAR_TYPE_SINGLE_PROP) */
 	
-	char pchan_name[32];	/* name of the posebone to use (for vars where DTAR_FLAG_STRUCT_REF is used) */
+	char pchan_name[64];	/* name of the posebone to use (for vars where DTAR_FLAG_STRUCT_REF is used) - MAX_ID_NAME-2 */
 	short transChan;		/* transform channel index (for DVAR_TYPE_TRANSFORM_CHAN)*/
 	
 	short flag;				/* flags for the validity of the target (NOTE: these get reset every time the types change) */
@@ -328,7 +328,7 @@ typedef enum eDriverTarget_TransformChannels {
 typedef struct DriverVar {
 	struct DriverVar *next, *prev;
 
-	char name[64];              /* name of the variable to use in py-expression (must be valid python identifier) */
+	char name[64];              /* name of the variable to use in py-expression (must be valid python identifier) - MAX_ID_NAME-2 */
 
 	DriverTarget targets[8];    /* MAX_DRIVER_TARGETS, target slots */
 	short num_targets;          /* number of targets actually used by this variable */
@@ -568,7 +568,7 @@ typedef struct NlaStrip {
 	ListBase fcurves;           /* F-Curves for controlling this strip's influence and timing */    // TODO: move out?
 	ListBase modifiers;         /* F-Curve modifiers to be applied to the entire strip's referenced F-Curves */
 
-	char name[64];              /* User-Visible Identifier for Strip */
+	char name[64];              /* User-Visible Identifier for Strip - MAX_ID_NAME-2 */
 
 	float influence;            /* Influence of strip */
 	float strip_time;           /* Current 'time' within action being used (automatically evaluated, but can be overridden) */
@@ -678,7 +678,7 @@ typedef struct NlaTrack {
 	int flag;				/* settings for this track */
 	int index;				/* index of the track in the stack (NOTE: not really useful, but we need a pad var anyways!) */
 	
-	char name[64];			/* short user-description of this track */
+	char name[64];			/* short user-description of this track - MAX_ID_NAME-2 */
 } NlaTrack;
 
 /* settings for track */
@@ -714,7 +714,7 @@ typedef struct KS_Path {
 	struct KS_Path *next, *prev;
 	
 	ID *id;					/* ID block that keyframes are for */
-	char group[64];			/* name of the group to add to */
+	char group[64];			/* name of the group to add to - MAX_ID_NAME-2 */
 	
 	int idtype;				/* ID-type that path can be used on */
 	
@@ -765,10 +765,10 @@ typedef struct KeyingSet {
 	
 	ListBase paths;			/* (KS_Path) paths to keyframe to */
 	
-	char idname[64];		/* unique name (for search, etc.) */
-	char name[64];			/* user-viewable name for KeyingSet (for menus, etc.) */
+	char idname[64];		/* unique name (for search, etc.) - MAX_ID_NAME-2  */
+	char name[64];			/* user-viewable name for KeyingSet (for menus, etc.) - MAX_ID_NAME-2 */
 	char description[240];	/* (RNA_DYN_DESCR_MAX) short help text. */
-	char typeinfo[64];		/* name of the typeinfo data used for the relative paths */
+	char typeinfo[64];		/* name of the typeinfo data used for the relative paths - MAX_ID_NAME-2 */
 	
 	int active_path;		/* index of the active path */




More information about the Bf-blender-cvs mailing list