Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-12-20 10:21:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-20 10:21:08 +0300
commit96974a95758dd24bd30f4616fb6fe1f7ca5ad495 (patch)
treeed8932608bb40fea126a41b14954cf297c268e74 /source/blender/editors/object
parent8e80ada09ae2394fabb57b3c16efddbd6f16c20d (diff)
bugfix [#25310] Twice applied modifier with Convert to mesh with several multi-user objects
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_add.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index fb0b18b011c..431fbf171b8 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1091,8 +1091,8 @@ static int convert_exec(bContext *C, wmOperator *op)
Nurb *nu;
MetaBall *mb;
Mesh *me;
- int target= RNA_enum_get(op->ptr, "target");
- int keep_original= RNA_boolean_get(op->ptr, "keep_original");
+ const short target= RNA_enum_get(op->ptr, "target");
+ const short keep_original= RNA_boolean_get(op->ptr, "keep_original");
int a, mballConverted= 0;
/* don't forget multiple users! */
@@ -1101,13 +1101,18 @@ static int convert_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
ob= base->object;
ob->flag &= ~OB_DONE;
+
+ /* flag data thats not been edited (only needed for !keep_original) */
+ if(ob->data) {
+ ((ID *)ob->data)->flag |= LIB_DOIT;
+ }
}
CTX_DATA_END;
CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
ob= base->object;
- if(ob->flag & OB_DONE) {
+ if(ob->flag & OB_DONE || !IS_TAGGED(ob->data)) {
if (ob->type != target) {
base->flag &= ~SELECT;
ob->flag &= ~SELECT;
@@ -1243,14 +1248,9 @@ static int convert_exec(bContext *C, wmOperator *op)
curvetomesh(scene, newob);
}
}
- else if(ob->type==OB_MBALL) {
+ else if(ob->type==OB_MBALL && target == OB_MESH) {
Object *baseob;
- if (target != OB_MESH) {
- ob->flag |= OB_DONE;
- continue;
- }
-
base->flag &= ~SELECT;
ob->flag &= ~SELECT;
@@ -1292,11 +1292,12 @@ static int convert_exec(bContext *C, wmOperator *op)
mballConverted= 1;
}
- else
- continue;
}
- else
+ else {
continue;
+ }
+
+ /* tag obdata if it was been changed */
/* If the original object is active then make this object active */
if(basen) {
@@ -1308,8 +1309,9 @@ static int convert_exec(bContext *C, wmOperator *op)
basen= NULL;
}
- if (!keep_original) {
+ if (!keep_original && (ob->flag & OB_DONE)) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ ((ID *)ob->data)->flag &= ~LIB_DOIT; /* flag not to convert this datablock again */
}
/* delete original if needed */