From 995262728f0550b6ff12028a160bc1d37e50d546 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 26 Feb 2008 16:20:36 +0000 Subject: 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. --- source/blender/blenkernel/intern/mball.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel/intern/mball.c') 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. * -- cgit v1.2.3