diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-19 14:14:22 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-19 14:14:22 +0400 |
commit | 36ffc7accde82eb1d1930ed8758e315339fac8bc (patch) | |
tree | f57a6786aa363babf64db3dcaa0320469224cc67 /source/blender/editors/armature/armature_skinning.c | |
parent | c46cbc602e1007a15c6d9824ec34c41f124faeaa (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.c | 5 |
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; } } } |