diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-03-12 21:57:33 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-03-12 21:57:33 +0400 |
commit | 2525f9c5f31e90bcb8f2e8c84558a2bc35e3207c (patch) | |
tree | ef78984549c84b3b00e4356d35eae3c23b5c16e3 /source/blender/editors/object/object_add.c | |
parent | 19f7f9afab1b36ca8a92e739b7591f694b902dcb (diff) |
backport revisions from master for 2.70-rc2 tagv2.70-rc2
This includes:
68ef679, d0ad48f, e913eab + 8d09ec6, 9630fa7, 4ce7d5c,
b839fb9, 43b5f0a, 4d47e75, 89c793f, b23a439, 0a3850f
de86b70, cfefc5d, 997b49a, 6919ffb, c1be7e1, 6ddd54f
7a9838b + 98abc80, 23fbc9f, 41dde55, 500088d, c2045ef
c31c8fa, 7461fea, d219312, 0844451 + c05896e, ef51b69
19935f0, b977cfd, 3c3c2cd, 9ecf73f, 20f7a34, f03df4f
2de9da6, ba81fb7, a7ab389, d7cff8f7
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r-- | source/blender/editors/object/object_add.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index a2101716dbf..b29fafea90d 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1298,6 +1298,11 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, BKE_free_animdata(&ob->id); ob->adt = NULL; + /* Proxies are not to be copied. */ + ob->proxy_from = NULL; + ob->proxy_group = NULL; + ob->proxy = NULL; + ob->parent = NULL; BLI_listbase_clear(&ob->constraints); ob->curve_cache = NULL; @@ -1453,10 +1458,24 @@ static EnumPropertyItem convert_target_items[] = { {0, NULL, 0, NULL, NULL} }; -static void curvetomesh(Object *ob) +static void convert_ensure_curve_cache(Main *bmain, Scene *scene, Object *ob) { - BLI_assert(ob->curve_cache != NULL); + if (ob->curve_cache == NULL) { + /* Force creation. This is normally not needed but on operator + * redo we might end up with an object which isn't evaluated yet. + */ + if (ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) { + BKE_displist_make_curveTypes(scene, ob, FALSE); + } + else if (ob->type == OB_MBALL) { + BKE_displist_make_mball(bmain->eval_ctx, scene, ob); + } + } +} +static void curvetomesh(Main *bmain, Scene *scene, Object *ob) +{ + convert_ensure_curve_cache(bmain, scene, ob); BKE_mesh_from_nurbs(ob); /* also does users */ if (ob->type == OB_MESH) @@ -1508,7 +1527,7 @@ static int convert_exec(bContext *C, wmOperator *op) MetaBall *mb; Mesh *me; const short target = RNA_enum_get(op->ptr, "target"); - const short keep_original = RNA_boolean_get(op->ptr, "keep_original"); + const bool keep_original = RNA_boolean_get(op->ptr, "keep_original"); int a, mballConverted = 0; /* don't forget multiple users! */ @@ -1667,7 +1686,7 @@ static int convert_exec(bContext *C, wmOperator *op) BKE_curve_curve_dimension_update(cu); if (target == OB_MESH) { - curvetomesh(newob); + curvetomesh(bmain, scene, newob); /* meshes doesn't use displist */ BKE_object_free_curve_cache(newob); @@ -1691,7 +1710,7 @@ static int convert_exec(bContext *C, wmOperator *op) newob = ob; } - curvetomesh(newob); + curvetomesh(bmain, scene, newob); /* meshes doesn't use displist */ BKE_object_free_curve_cache(newob); @@ -1729,6 +1748,7 @@ static int convert_exec(bContext *C, wmOperator *op) for (a = 0; a < newob->totcol; a++) id_us_plus((ID *)me->mat[a]); } + convert_ensure_curve_cache(bmain, scene, baseob); BKE_mesh_from_metaball(&baseob->curve_cache->disp, newob->data); if (obact->type == OB_MBALL) { |