[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34725] trunk/blender/source/blender: Bugfix [#25990] backward compatibility with ShapeKey Actions :: 2.49

Joshua Leung aligorith at gmail.com
Wed Feb 9 01:51:31 CET 2011


Revision: 34725
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34725
Author:   aligorith
Date:     2011-02-09 00:51:30 +0000 (Wed, 09 Feb 2011)
Log Message:
-----------
Bugfix [#25990] backward compatibility with ShapeKey Actions :: 2.49
-> 2.50

Actionified ShapeKey IPO-blocks (i.e. "Shape Key Actions") would have
an action channel with the hardcoded name, "Shape", and this action
would be assigned to Object level (although ShapeKey blocks had their
own IPO-block slot, only Objects could have actions, so actionifying
ShapeKey IPO-blocks would wrap a ShapeKey block's IPO's to an Object-
level action).

Hence, the path conversions code would wrongly interpret this action
channel as referring to a Pose Channel instead, thus creating some
invalid paths with a 'pose.bones["Shape"]' prefix wrongly getting
tacked on. To ensure that the converted animation can work out of the
box, a 'data.shape_keys' prefix is now used instead so that these
actions can still be Object-rooted while still being able to correctly
control the Shape Keys. This is because there's no easy way to
identify and then shift such action from Object-level to ShapeKey-
level within the conversion code. The consequence though is that such
converted ShapeKey actions CAN ONLY BE USED THROUGH OBJECT LEVEL (i.e.
via Action NOT ShapeKey editor).

Secondly, the Action/ShapeKey editor version patching code has been
modified so that if a ShapeKey editor view was active when loading an
old 2.4x file, the action gets cleared from the view. This is because
of this didn't make semantic sense: the ShapeKey editor is for
ShapeKey-rooted actions, while the Action Editor is for Object-rooted
actions. The converted files though let Object-level actions be shown
in either one.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/ipo.c
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenkernel/intern/ipo.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/ipo.c	2011-02-09 00:45:16 UTC (rev 34724)
+++ trunk/blender/source/blender/blenkernel/intern/ipo.c	2011-02-09 00:51:30 UTC (rev 34725)
@@ -914,8 +914,17 @@
 		sprintf(buf, "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname);
 	}
 	else if (actname && actname[0]) {
-		/* Pose-Channel */
-		sprintf(buf, "pose.bones[\"%s\"]", actname);
+		if ((blocktype == ID_OB) && strcmp(actname, "Object")==0) {
+			/* Actionified "Object" IPO's... no extra path stuff needed */
+		}
+		else if ((blocktype == ID_KE) && strcmp(actname, "Shape")==0) {
+			/* Actionified "Shape" IPO's - these are forced onto object level via the action container there... */
+			strcpy(buf, "data.shape_keys");
+		}
+		else {
+			/* Pose-Channel */
+			sprintf(buf, "pose.bones[\"%s\"]", actname);
+		}
 	}
 	else if (constname && constname[0]) {
 		/* Constraint in Object */

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2011-02-09 00:45:16 UTC (rev 34724)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2011-02-09 00:51:30 UTC (rev 34725)
@@ -6355,6 +6355,8 @@
 			}
 			case SPACE_ACTION:
 			{
+				SpaceAction *saction= (SpaceAction *)sl;
+				
 				/* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */
 				ar->v2d.tot.xmin= -20.0f;
 				ar->v2d.tot.ymin= (float)(-sa->winy)/3.0f;
@@ -6364,10 +6366,10 @@
 				ar->v2d.cur= ar->v2d.tot;
 				
 				ar->v2d.min[0]= 0.0f;
-				 ar->v2d.min[1]= 0.0f;
+				ar->v2d.min[1]= 0.0f;
 				
 				ar->v2d.max[0]= MAXFRAMEF;
-				 ar->v2d.max[1]= FLT_MAX;
+				ar->v2d.max[1]= FLT_MAX;
 			 	
 				ar->v2d.minzoom= 0.01f;
 				ar->v2d.maxzoom= 50;
@@ -6376,6 +6378,13 @@
 				ar->v2d.keepzoom= V2D_LOCKZOOM_Y;
 				ar->v2d.align= V2D_ALIGN_NO_POS_Y;
 				ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
+				
+				/* for old files with ShapeKey editors open + an action set, clear the action as 
+				 * it doesn't make sense in the new system (i.e. violates concept that ShapeKey edit
+				 * only shows ShapeKey-rooted actions only)
+				 */
+				if (saction->mode == SACTCONT_SHAPEKEY)
+					saction->action = NULL;
 				break;
 			}
 			case SPACE_SEQ:




More information about the Bf-blender-cvs mailing list