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:
authorTon Roosendaal <ton@blender.org>2005-12-13 23:16:10 +0300
committerTon Roosendaal <ton@blender.org>2005-12-13 23:16:10 +0300
commitd1cc4b7a15efaeea5de1f70762c3507572fe186d (patch)
treefbdf37302a3f1bfa0888172963d0ac59273e5a04 /source/blender
parentd3338620b710ae6575aef6cbb90ae61cbc9f586a (diff)
Orange reported fix: Stride bone offset was blending with any strip, even
when strips had no stride set... causing using multiple strips not to work for stride.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/action.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index b42d60bdab6..253f9fbf326 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -355,6 +355,23 @@ bActionChannel *verify_action_channel(bAction *act, const char *name)
/* ************************ Blending with NLA *************** */
+static void blend_pose_strides(bPose *dst, bPose *src, float srcweight, short mode)
+{
+ float dstweight;
+
+ switch (mode){
+ case POSE_BLEND:
+ dstweight = 1.0F - srcweight;
+ break;
+ case POSE_ADD:
+ dstweight = 1.0F;
+ break;
+ default :
+ dstweight = 1.0F;
+ }
+
+ VecLerpf(dst->stride_offset, dst->stride_offset, src->stride_offset, srcweight);
+}
/* Only allowed for Poses with identical channels */
void blend_poses(bPose *dst, bPose *src, float srcweight, short mode)
@@ -407,8 +424,6 @@ void blend_poses(bPose *dst, bPose *src, float srcweight, short mode)
dcon->enforce= dcon->enforce*(1.0f-srcweight) + scon->enforce*srcweight;
}
}
-
- VecLerpf(dst->stride_offset, dst->stride_offset, src->stride_offset, srcweight);
}
@@ -796,7 +811,7 @@ static void do_nla(Object *ob, int blocktype)
bActionStrip *strip;
float striptime, frametime, length, actlength;
float blendfac, stripframe;
- int doit;
+ int doit, dostride;
if(blocktype==ID_AR) {
copy_pose(&tpose, ob->pose, 1);
@@ -807,7 +822,7 @@ static void do_nla(Object *ob, int blocktype)
}
for (strip=ob->nlastrips.first; strip; strip=strip->next){
- doit=0;
+ doit=dostride= 0;
if (strip->act){ /* so theres an action */
@@ -865,7 +880,7 @@ static void do_nla(Object *ob, int blocktype)
if(key)
extract_ipochannels_from_action(&tchanbase, &key->id, strip->act, "Shape", frametime);
}
- doit=1;
+ doit=dostride= 1;
}
}
}
@@ -922,8 +937,11 @@ static void do_nla(Object *ob, int blocktype)
else
blendfac = 1;
- if(blocktype==ID_AR) /* Blend this pose with the accumulated pose */
+ if(blocktype==ID_AR) {/* Blend this pose with the accumulated pose */
blend_poses (ob->pose, tpose, blendfac, strip->mode);
+ if(dostride)
+ blend_pose_strides (ob->pose, tpose, blendfac, strip->mode);
+ }
else {
blend_ipochannels(&chanbase, &tchanbase, blendfac, strip->mode);
BLI_freelistN(&tchanbase);