diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-02-26 19:20:36 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-02-26 19:20:36 +0300 |
commit | 995262728f0550b6ff12028a160bc1d37e50d546 (patch) | |
tree | 26712de57ea75da12a81683d601f490a1bce05e2 /source/blender/blenkernel/intern/mball.c | |
parent | f9fb9965aae0e2312329c04517f438718fd6a006 (diff) |
Fix for bug #6854: meta object crash with preview render. Meta objects
were using an ugly trick to store render orco's, but there's really no
reason for it, now it works like other primitives.
Diffstat (limited to 'source/blender/blenkernel/intern/mball.c')
-rw-r--r-- | source/blender/blenkernel/intern/mball.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index e731f0fdfe0..d3fb9ceac7a 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -233,13 +233,15 @@ void tex_space_mball(Object *ob) boundbox_set_from_min_max(bb, min, max); } -void make_orco_mball(Object *ob) +float *make_orco_mball(Object *ob) { BoundBox *bb; DispList *dl; - float *data; + float *data, *orco, *orcodata; float loc[3], size[3]; int a; + + orcodata= MEM_mallocN(sizeof(float)*3*dl->nr, "MballOrco"); /* restore size and loc */ bb= ob->bb; @@ -252,14 +254,18 @@ void make_orco_mball(Object *ob) dl= ob->disp.first; data= dl->verts; + orco= orcodata; a= dl->nr; while(a--) { - data[0]= (data[0]-loc[0])/size[0]; - data[1]= (data[1]-loc[1])/size[1]; - data[2]= (data[2]-loc[2])/size[2]; + orco[0]= (data[0]-loc[0])/size[0]; + orco[1]= (data[1]-loc[1])/size[1]; + orco[2]= (data[2]-loc[2])/size[2]; data+= 3; + orco+= 3; } + + return orcodata; } /** \brief Test, if Object *ob is basic MetaBall. * |