diff options
author | Ton Roosendaal <ton@blender.org> | 2006-05-23 21:49:21 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-05-23 21:49:21 +0400 |
commit | 7198a6cf6633fa7a5bb48647d973ce41f8fd3561 (patch) | |
tree | be3aedff71c4d5af8de106b160a04d91b981a6a7 /source/blender/src/editobject.c | |
parent | 2114b63d32390e98b00c552b096a7f0a7845b8bb (diff) |
Bugfix #4211
"Copy Modifiers" (CTRL+C) only copied a single modifer, when a specific
type was choosen. Now it copies all modifiers with indicated type.
(Like: when you have a X, Y, Z mirror modifier).
Diffstat (limited to 'source/blender/src/editobject.c')
-rw-r--r-- | source/blender/src/editobject.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 6ca4595bb8f..47fcd74b1a7 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -2642,6 +2642,7 @@ static void copymenu_modifiers(Object *ob) base->object->recalc |= OB_RECALC_OB|OB_RECALC_DATA; if (base->object->type==ob->type) { + /* copy all */ if (event==NUM_MODIFIER_TYPES) { object_free_modifiers(base->object); @@ -2653,17 +2654,27 @@ static void copymenu_modifiers(Object *ob) } } } else { - ModifierData *md = modifiers_findByType(ob, event); - - if (md) { - ModifierData *tmd = modifiers_findByType(base->object, event); - - if (!tmd) { - tmd = modifier_new(event); - BLI_addtail(&base->object->modifiers, tmd); + /* copy specific types */ + ModifierData *md, *mdn; + + /* remove all with type 'event' */ + for (md=base->object->modifiers.first; md; md=mdn) { + mdn= md->next; + if(md->type==event) { + BLI_remlink(&base->object->modifiers, md); + modifier_free(md); } + } + + /* copy all with type 'event' */ + for (md=ob->modifiers.first; md; md=md->next) { + if (md->type==event) { + + mdn = modifier_new(event); + BLI_addtail(&base->object->modifiers, mdn); - modifier_copyData(md, tmd); + modifier_copyData(md, mdn); + } } } } |