diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-19 13:36:40 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-19 13:36:40 +0400 |
commit | 7ef3f98de1339f9b25ce5670b9b5d5e5ef798327 (patch) | |
tree | bfdd9b53c3c6a382b8eb915e8cc4d1812c88a4fc /source/blender/blenkernel/intern/anim.c | |
parent | 345fff872b19a48ea674815165c7e8a0bd57f2ba (diff) |
Made curves almost thread-safe
Now modifier stack wouldn't modify original curve's nurbs
and will operate on a copy of nurbs.
This makes it possible to process curve object update with
shared curve datablocks from multiple threads. There's no
big overhead for creating a copy of nurbs comparing to old
behavior which was allocating original vertex array and
apply coordinates on curve after all modifier are applied.
The only remained issue with curves is curve's bounding box
and texture space. It's not thread-safe, but it wouldn't
lead to crashes -- it just could lead to either memory
leak or wrong texture coordinates due to difference in
modifiers stacks of objects which shares the same curve.
--
svn merge -r57959:57961 ^/branches/soc-2013-depsgraph_mt
Diffstat (limited to 'source/blender/blenkernel/intern/anim.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index f3e2b118f2e..b5a56024976 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -488,7 +488,7 @@ void free_path(Path *path) /* calculate a curve-deform path for a curve * - only called from displist.c -> do_makeDispListCurveTypes */ -void calc_curvepath(Object *ob) +void calc_curvepath(Object *ob, ListBase *nurbs) { BevList *bl; BevPoint *bevp, *bevpn, *bevpfirst, *bevplast; @@ -499,7 +499,6 @@ void calc_curvepath(Object *ob) float *fp, *dist, *maxdist, xyz[3]; float fac, d = 0, fac1, fac2; int a, tot, cycl = 0; - ListBase *nurbs; /* in a path vertices are with equal differences: path->len = number of verts */ /* NOW WITH BEVELCURVE!!! */ @@ -518,7 +517,6 @@ void calc_curvepath(Object *ob) return; } - nurbs = BKE_curve_nurbs_get(cu); nu = nurbs->first; ob->curve_cache->path = path = MEM_callocN(sizeof(Path), "calc_curvepath"); |