Fix #22654: Converted curve from mesh disappearing
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 23 Jun 2010 09:58:02 +0000 (09:58 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 23 Jun 2010 09:58:02 +0000 (09:58 +0000)
Curve object should have ob->bb=NULL if there is no derivedMesh

source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/mesh.c

index 24f996f..ae225fd 100644 (file)
@@ -1855,6 +1855,12 @@ void makeDispListCurveTypes(Scene *scene, Object *ob, int forOrco)
                DM_set_object_boundbox (ob, ob->derivedFinal);
        } else {
                boundbox_displist (ob);
+
+               /* if there is no derivedMesh, object's boundbox is unneeded */
+               if (ob->bb) {
+                       MEM_freeN(ob->bb);
+                       ob->bb= NULL;
+               }
        }
 }
 
index 6ddc4b8..cd8b2eb 100644 (file)
@@ -1186,6 +1186,12 @@ void mesh_to_curve(Scene *scene, Object *ob)
 
        if (needsFree) {
                ob->derivedFinal = NULL;
+
+               /* curve object could have got bounding box only in special cases */
+               if(ob->bb) {
+                       MEM_freeN(ob->bb);
+                       ob->bb= NULL;
+               }
        }
 }