diff options
Diffstat (limited to 'source/blender/src/editaction.c')
-rw-r--r-- | source/blender/src/editaction.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 5fee23cf5dc..79debbc567b 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -196,19 +196,21 @@ bAction* bake_action_with_client (bAction *act, Object *armob, float tolerance) 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], tmp_size[3]; + QUATCOPY(tmp_quat, pchan->quat); + VECCOPY(tmp_loc, pchan->loc); + VECCOPY(tmp_size, pchan->size); Mat4ToQuat(pchan->obmat, pchan->quat); Mat4ToSize(pchan->obmat, pchan->size); VECCOPY(pchan->loc, pchan->obmat[3]); - - /* Apply to keys */ + + /* 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); @@ -216,10 +218,18 @@ bAction* bake_action_with_client (bAction *act, Object *armob, float tolerance) 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); + set_action_key_time (result, pchan, AC_SIZE_X, 1, curframe); + set_action_key_time (result, pchan, AC_SIZE_Y, 1, curframe); + set_action_key_time (result, pchan, AC_SIZE_Z, 1, curframe); + + QUATCOPY(pchan->quat, tmp_quat); + VECCOPY(pchan->loc, tmp_loc); + VECCOPY(pchan->size, tmp_size); } } } + /* Make another pass to ensure all keyframes are set to linear interpolation mode */ for (achan = result->chanbase.first; achan; achan=achan->next){ IpoCurve* icu; |