Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Want <cwant@ualberta.ca>2004-02-20 07:57:07 +0300
committerChris Want <cwant@ualberta.ca>2004-02-20 07:57:07 +0300
commit05bff7f93823d484ca237340a5b6af546a7e99c3 (patch)
tree0a6f44ff060a9620744bee63b3f6220029685dd7 /source/blender/src/editaction.c
parent32fb5478a877fef3a0efefa0152e969b28ad3753 (diff)
Jonathan Thambidurai's patch for fixing the baking of NLA.
I added to this patch some code for keying size too ... please test. This probably fixes bug #602, but I can't say for sure: Guignot's poor ol' example blend no longer opens in blender (not since 2.26). Release notes remark: Bug causing inconsistent baking of actions fixed.
Diffstat (limited to 'source/blender/src/editaction.c')
-rw-r--r--source/blender/src/editaction.c22
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;