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:
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r--source/blender/editors/object/object_add.c30
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) {