Bug fix: on scene append of curve deformer displist causes crash...
authorTon Roosendaal <ton@blender.org>
Mon, 27 Sep 2004 10:39:18 +0000 (10:39 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 27 Sep 2004 10:39:18 +0000 (10:39 +0000)
Crash is solved now, but create displist fails.

source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/lattice.c

index 1cd442a539126a9840d346f29fc91840ea6d2935..9df3130628a707bca987d421195fe7c6dfc4774c 100644 (file)
@@ -95,14 +95,14 @@ void calc_curvepath(Object *ob)
        else nu= cu->nurb.first;
        
        if(cu->path) free_path(cu->path);
-       cu->path= 0;
+       cu->path= NULL;
        
        bl= cu->bev.first;
-       if(bl==0) {
+       if(bl==NULL) {
                makeDispList(ob);
                bl= cu->bev.first;
        }
-       if(bl==0) return;
+       if(bl==NULL) return;
 
        cu->path=path= MEM_callocN(sizeof(Path), "path");
        
index 959cb7001fb3af3343963c00e1f4259579769ba9..0516db04a632a5bf192d7b2f2ce63c0156a050a6 100644 (file)
@@ -481,8 +481,10 @@ static void calc_curve_deform(Object *par, float *co, short axis, CurveDeform *c
                index= 2;
        }
        /* to be sure */
-       if(cu->path==NULL) calc_curvepath(par);
-
+       if(cu->path==NULL) {
+               calc_curvepath(par);
+               if(cu->path==NULL) return;      // happens on append...
+       }
        /* options */
        if(cu->flag & CU_STRETCH)
                fac= (co[index]-cd->dmin[index])/(cd->dmax[index] - cd->dmin[index]);