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:
authorCampbell Barton <ideasman42@gmail.com>2009-06-16 22:25:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-06-16 22:25:48 +0400
commit2faf20c4b3ae1ca6c82dd2a942d2f2a580685436 (patch)
tree97be6b5ca42d0ab9819e844bea8436702560a012 /source/blender/blenkernel
parentaa0825a5e5c19f33cf60f72e295b5902129cfe1d (diff)
BGE Action Actuator setChannel() function was broken in a number of ways.
* extract_pose_from_pose only checked one of the list items for NULL when looping over them yet its possible they are different sizes. * game_free_pose needed to be used rather then MEM_freeN, channels would never be freed leaking memory. * setChannel() would make a new pose that wasnt aligned with the existing pose, the lists are assumed aligned so when extracting the channels its unlikely this was ever useful. * Added getChannel() - returns pose loc/size/quat * Added option args for setChannel(channel, matrix) or setChannel(channel, loc, size, quat)
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/action.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index e0afdec5e23..dea8b72bbfd 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -798,6 +798,7 @@ void calc_action_range(const bAction *act, float *start, float *end, int incl_hi
/* Copy the data from the action-pose (src) into the pose */
/* both args are assumed to be valid */
/* exported to game engine */
+/* Note! this assumes both poses are aligned, this isnt always true when dealing with user poses */
void extract_pose_from_pose(bPose *pose, const bPose *src)
{
const bPoseChannel *schan;
@@ -808,7 +809,7 @@ void extract_pose_from_pose(bPose *pose, const bPose *src)
return;
}
- for (schan=src->chanbase.first; schan; schan=schan->next, pchan= pchan->next) {
+ for (schan=src->chanbase.first; (schan && pchan); schan=schan->next, pchan= pchan->next) {
copy_pose_channel_data(pchan, schan);
}
}