diff options
author | Daniel Dunbar <daniel@zuster.org> | 2005-08-09 20:02:23 +0400 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2005-08-09 20:02:23 +0400 |
commit | c5a223056a9aa6ccea69b2c41741d2e4ffbb992f (patch) | |
tree | 3b63e307ab838495b4c3e9426963510ec6311118 /source | |
parent | 98741ec4368e5edd238e2810c9189e8c0b45ec17 (diff) |
- bug fix, convert modifiers should free modifiers from new object
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_object.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 10 | ||||
-rw-r--r-- | source/blender/src/editobject.c | 8 |
3 files changed, 9 insertions, 10 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 21c1e869ea2..a7e37425da7 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -51,6 +51,7 @@ void copy_objectflags(void); struct SoftBody *copy_softbody(struct SoftBody *sb); void update_base_layer(struct Object *ob); void free_object(struct Object *ob); +void object_free_modifiers(struct Object *ob); void unlink_object(struct Object *ob); int exist_object(struct Object *obtest); void *add_camera(void); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 46dc90ec3b4..c8feb7f89ce 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -172,12 +172,12 @@ static void copy_hooks(ListBase *new, ListBase *old) } -static void free_modifiers(ListBase *lb) +void object_free_modifiers(Object *ob) { - while (lb->first) { - ModifierData *md = lb->first; + while (ob->modifiers.first) { + ModifierData *md = ob->modifiers.first; - BLI_remlink(lb, md); + BLI_remlink(&ob->modifiers, md); modifier_free(md); } @@ -223,7 +223,7 @@ void free_object(Object *ob) free_effects(&ob->effect); BLI_freelistN(&ob->network); free_properties(&ob->prop); - free_modifiers(&ob->modifiers); + object_free_modifiers(ob); free_sensors(&ob->sensors); free_controllers(&ob->controllers); diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 77561959a74..d3f50b2b57d 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2170,6 +2170,7 @@ void convertmenu(void) Mesh *oldme= ob->data; DispListMesh *dlm; DerivedMesh *dm; + ModifierData *md; basedel = base; @@ -2177,6 +2178,7 @@ void convertmenu(void) ob1= copy_object(ob); ob1->recalc |= OB_RECALC; + object_free_modifiers(ob1); basen= MEM_mallocN(sizeof(Base), "duplibase"); *basen= *base; @@ -2481,11 +2483,7 @@ static void copymenu_modifiers(Object *ob) if (base->object->type==OB_MESH) { if (event==NUM_MODIFIER_TYPES) { - while (base->object->modifiers.first) { - md = base->object->modifiers.first; - BLI_remlink(&base->object->modifiers, md); - modifier_free(md); - } + object_free_modifiers(base->object); for (md=ob->modifiers.first; md; md=md->next) { ModifierData *nmd = modifier_new(md->type); |