[Bf-committers] Bake Buggy (plus fix/patch)
Jonathan Thambidurai
bf-committers@blender.org
Thu, 19 Feb 2004 13:14:16 -0500
--=-ve31aHIqAX/A+Hr/46nj
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Thu, 2004-02-19 at 12:58, Jonathan Thambidurai wrote:
>
> As mentioned before, the patch is attached.
Oops, forgot to attach the patch. Here it is.
--Jonathan Thambidurai
--=-ve31aHIqAX/A+Hr/46nj
Content-Disposition: attachment; filename=bake-fix2.patch
Content-Type: text/x-patch; name=bake-fix2.patch; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: 7bit
--- ../../blender2.32-unchanged/blender-2.32/source/blender/src/editaction.c 2004-01-13 09:50:43.000000000 -0500
+++ source/blender/src/editaction.c 2004-02-19 12:34:31.000000000 -0500
@@ -196,30 +196,33 @@
clear_object_constraint_status(armob);
where_is_armature_time(armob, curframe);
- /* For each channel: set avail keys with current values */
- for (pchan=armob->pose->chanbase.first; pchan; pchan=pchan->next){
-
- /* Copy the constraints from the armature (if any) */
+ /* For each channel: set quats and locs if channel is a bone */
+ for (pchan=armob->pose->chanbase.first; pchan; pchan=pchan->next){
bone = get_named_bone(arm, pchan->name);
if (bone){
+ float tmp_quat[4], tmp_loc[3];
+ QUATCOPY(tmp_quat, pchan->quat);
+ VECCOPY (tmp_loc , pchan->loc);
+
+ Mat4ToQuat(pchan->obmat, pchan->quat);
+ VECCOPY (pchan->loc, pchan->obmat[3] );
+
+ set_action_key_time (result, pchan, AC_QUAT_X, 1, curframe);
+ set_action_key_time (result, pchan, AC_QUAT_Y, 1, curframe);
+ set_action_key_time (result, pchan, AC_QUAT_Z, 1, curframe);
+ set_action_key_time (result, pchan, AC_QUAT_W, 1, curframe);
+ set_action_key_time (result, pchan, AC_LOC_X, 1, curframe);
+ set_action_key_time (result, pchan, AC_LOC_Y, 1, curframe);
+ set_action_key_time (result, pchan, AC_LOC_Z, 1, curframe);
- Mat4ToQuat(pchan->obmat, pchan->quat);
- Mat4ToSize(pchan->obmat, pchan->size);
- VECCOPY(pchan->loc, pchan->obmat[3]);
-
- /* Apply to keys */
- set_action_key_time (result, pchan, AC_QUAT_X, 1, curframe);
- set_action_key_time (result, pchan, AC_QUAT_Y, 1, curframe);
- set_action_key_time (result, pchan, AC_QUAT_Z, 1, curframe);
- set_action_key_time (result, pchan, AC_QUAT_W, 1, curframe);
- set_action_key_time (result, pchan, AC_LOC_X, 1, curframe);
- set_action_key_time (result, pchan, AC_LOC_Y, 1, curframe);
- set_action_key_time (result, pchan, AC_LOC_Z, 1, curframe);
+ QUATCOPY(pchan->quat, tmp_quat);
+ VECCOPY (pchan->loc , tmp_loc );
}
}
}
+
/* Make another pass to ensure all keyframes are set to linear interpolation mode */
for (achan = result->chanbase.first; achan; achan=achan->next){
IpoCurve* icu;
--=-ve31aHIqAX/A+Hr/46nj--