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:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-08-19 14:14:22 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-08-19 14:14:22 +0400
commit36ffc7accde82eb1d1930ed8758e315339fac8bc (patch)
treef57a6786aa363babf64db3dcaa0320469224cc67 /source/blender/editors/armature/armature_skinning.c
parentc46cbc602e1007a15c6d9824ec34c41f124faeaa (diff)
Made armatures evaluation safe for threading
Apparently, some routines in armature deformation code were using static arrays. This is probably just an optimization thing, but it's very bad for threading. Now made it so bbone matrices array is allocating in callee function stack. This required exposing MAX_BBONE_SUBDIV to an external API, This is not so much crappy from code side, and it shall be the same fast as before. -- svn merge -r58278:58279 ^/branches/soc-2013-depsgraph_mt
Diffstat (limited to 'source/blender/editors/armature/armature_skinning.c')
-rw-r--r--source/blender/editors/armature/armature_skinning.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c
index 22bd22c8561..0301db4b4cf 100644
--- a/source/blender/editors/armature/armature_skinning.c
+++ b/source/blender/editors/armature/armature_skinning.c
@@ -255,7 +255,7 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
bDeformGroup *dgroup;
bPoseChannel *pchan;
Mesh *mesh;
- Mat4 *bbone = NULL;
+ Mat4 bbone_array[MAX_BBONE_SUBDIV], *bbone = NULL;
float (*root)[3], (*tip)[3], (*verts)[3];
int *selected;
int numbones, vertsfilled = 0, i, j, segments = 0;
@@ -309,7 +309,8 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
if ((par->pose) && (pchan = BKE_pose_channel_find_name(par->pose, bone->name))) {
if (bone->segments > 1) {
segments = bone->segments;
- bbone = b_bone_spline_setup(pchan, 1);
+ b_bone_spline_setup(pchan, 1, bbone_array);
+ bbone = bbone_array;
}
}
}