[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36258] trunk/blender: Bugfix [#27090] Available keying set fails in armature pose mode

Joshua Leung aligorith at gmail.com
Thu Apr 21 03:21:30 CEST 2011


Revision: 36258
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36258
Author:   aligorith
Date:     2011-04-21 01:21:28 +0000 (Thu, 21 Apr 2011)
Log Message:
-----------
Bugfix [#27090] Available keying set fails in armature pose mode

A change in the poll callback that Available KeyingSet used to use
restricted its use to Object-mode only, while this could also be
useful in Pose Mode (though it would only affect all channels there).

Made this use a custom poll callback now that tests for whether the
active object has an action. This does mean that if you select a bunch
of objects with animation data, but the active object doesn't have it,
then the keyingset will fail to fire, but that's been marked as a todo
in the code.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/keyingsets_builtins.py
    trunk/blender/source/blender/blenkernel/intern/armature.c

Modified: trunk/blender/release/scripts/startup/keyingsets_builtins.py
===================================================================
--- trunk/blender/release/scripts/startup/keyingsets_builtins.py	2011-04-21 00:28:05 UTC (rev 36257)
+++ trunk/blender/release/scripts/startup/keyingsets_builtins.py	2011-04-21 01:21:28 UTC (rev 36258)
@@ -215,10 +215,14 @@
 class BUILTIN_KSI_Available(bpy.types.KeyingSetInfo):
     bl_label = "Available"
 
-    # poll - use predefined callback for selected objects
-    # TODO: this should really check whether the selected object (or datablock)
-    #         has any animation data defined yet
-    poll = keyingsets_utils.RKS_POLL_selected_objects
+    # poll - selected objects or selected object with animation data
+    def poll(ksi, context):
+        ob = context.active_object
+        if ob:
+            # TODO: this fails if one animation-less object is active, but many others are selected
+            return ob.animation_data and ob.animation_data.action
+        else:
+            return bool(context.selected_objects)
 
     # iterator - use callback for selected bones/objects
     iterator = keyingsets_utils.RKS_ITER_selected_item

Modified: trunk/blender/source/blender/blenkernel/intern/armature.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/armature.c	2011-04-21 00:28:05 UTC (rev 36257)
+++ trunk/blender/source/blender/blenkernel/intern/armature.c	2011-04-21 01:21:28 UTC (rev 36258)
@@ -1226,10 +1226,10 @@
  */
 void armature_mat_pose_to_delta(float delta_mat[][4], float pose_mat[][4], float arm_mat[][4])
 {
-	 float imat[4][4];
- 
-	 invert_m4_m4(imat, arm_mat);
-	 mul_m4_m4m4(delta_mat, pose_mat, imat);
+	float imat[4][4];
+	
+	invert_m4_m4(imat, arm_mat);
+	mul_m4_m4m4(delta_mat, pose_mat, imat);
 }
 
 /* **************** Rotation Mode Conversions ****************************** */




More information about the Bf-blender-cvs mailing list